From 7c57be7e7568fd784adf044bbe1af088f726ccf4 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Fri, 21 Oct 2005 10:08:21 +0000 Subject: Global variable cleanup, to fix daemon mode reinitialization problems. Patch by Sunil Shetye. svn path=/trunk/; revision=4362 --- pop3.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'pop3.c') diff --git a/pop3.c b/pop3.c index 67489469..a18f8bc8 100644 --- a/pop3.c +++ b/pop3.c @@ -26,38 +26,41 @@ #include #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; -- cgit v1.2.3