aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2005-10-21 10:08:21 +0000
committerMatthias Andree <matthias.andree@gmx.de>2005-10-21 10:08:21 +0000
commit7c57be7e7568fd784adf044bbe1af088f726ccf4 (patch)
treead798790fc3422da29c33880a4f85e31d2642c50 /pop3.c
parent5e02700dbbd1146d4d7970b9d8555bf9694a4b72 (diff)
downloadfetchmail-7c57be7e7568fd784adf044bbe1af088f726ccf4.tar.gz
fetchmail-7c57be7e7568fd784adf044bbe1af088f726ccf4.tar.bz2
fetchmail-7c57be7e7568fd784adf044bbe1af088f726ccf4.zip
Global variable cleanup, to fix daemon mode reinitialization problems.
Patch by Sunil Shetye. svn path=/trunk/; revision=4362
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/pop3.c b/pop3.c
index 67489469..a18f8bc8 100644
--- a/pop3.c
+++ b/pop3.c
@@ -26,38 +26,41 @@
#include <opie.h>
#endif /* OPIE_ENABLE */
-static int last;
-#ifdef SDPS_ENABLE
-char *sdps_envfrom;
-char *sdps_envto;
-#endif /* SDPS_ENABLE */
+/* global variables: please reinitialize them explicitly for proper
+ * working in daemon mode */
+/* TODO: session variables to be initialized before server greeting */
#ifdef OPIE_ENABLE
static char lastok[POPBUFSIZE+1];
#endif /* OPIE_ENABLE */
-/* these variables are shared between the CAPA probe and the authenticator */
+/* session variables initialized in capa_probe() or pop3_getauth() */
#if defined(GSSAPI)
- flag has_gssapi = FALSE;
+flag has_gssapi = FALSE;
#endif /* defined(GSSAPI) */
#if defined(KERBEROS_V4) || defined(KERBEROS_V5)
- flag has_kerberos = FALSE;
+flag has_kerberos = FALSE;
#endif /* defined(KERBEROS_V4) || defined(KERBEROS_V5) */
- static flag has_cram = FALSE;
+static flag has_cram = FALSE;
#ifdef OPIE_ENABLE
- flag has_otp = FALSE;
+flag has_otp = FALSE;
#endif /* OPIE_ENABLE */
#ifdef SSL_ENABLE
- static flag has_ssl = FALSE;
+static flag has_ssl = FALSE;
#endif /* SSL_ENABLE */
+/* mailbox variables initialized in pop3_getrange() */
+static int last;
+
+/* mail variables initialized in pop3_fetch() */
+#ifdef SDPS_ENABLE
+char *sdps_envfrom;
+char *sdps_envto;
+#endif /* SDPS_ENABLE */
+
#ifdef NTLM_ENABLE
#include "ntlm.h"
-static tSmbNtlmAuthRequest request;
-static tSmbNtlmAuthChallenge challenge;
-static tSmbNtlmAuthResponse response;
-
/*
* NTLM support by Grant Edwards.
*
@@ -72,6 +75,10 @@ static tSmbNtlmAuthResponse response;
static int do_pop3_ntlm(int sock, struct query *ctl,
int msn_instead /** if true, send AUTH MSN, else send AUTH NTLM */)
{
+ tSmbNtlmAuthRequest request;
+ tSmbNtlmAuthChallenge challenge;
+ tSmbNtlmAuthResponse response;
+
char msgbuf[2048];
int result,len;