From: Jeffrey Altman Date: Tue, 26 Apr 2011 01:23:34 +0000 (-0400) Subject: windows: improved logging from NPLogonNotify X-Git-Tag: upstream/1.6.0.pre5^2~25 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=89196a625e11cc1c717ab1154693e1439086134f;p=packages%2Fo%2Fopenafs.git windows: improved logging from NPLogonNotify Improve the detail and formatting of the windows event log entries. Change-Id: I28350202b954765c570582540fac180bd1f68206 Reviewed-on: http://gerrit.openafs.org/4556 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-on: http://gerrit.openafs.org/4564 --- diff --git a/src/WINNT/afsd/afslogon.c b/src/WINNT/afsd/afslogon.c index 64cbf4b92..2d3d3fa3c 100644 --- a/src/WINNT/afsd/afslogon.c +++ b/src/WINNT/afsd/afslogon.c @@ -641,7 +641,7 @@ GetDomainLogonOptions( PLUID lpLogonId, char * username, char * domain, LogonOpt } if (hkTemp) { - CHAR * thesecells = NULL; + CHAR * thesecells = NULL, *p; /* dwSize still has the size of the required buffer in bytes. */ thesecells = malloc(dwSize*2); @@ -655,9 +655,16 @@ GetDomainLogonOptions( PLUID lpLogonId, char * username, char * domain, LogonOpt goto doneTheseCells; } - DebugEvent("Found TheseCells [%s]", thesecells); - opt->theseCells = thesecells; - thesecells = NULL; + /* TheseCells is a REG_MULTI_SZ */ + if ( thesecells && thesecells[0]) { + for ( p=thesecells; *p; p += (strlen(p) + 1)) { + DebugEvent("Found TheseCells [%s]", p); + } + opt->theseCells = thesecells; + thesecells = NULL; + } else { + DebugEvent("TheseCells [REG_MULTI_SZ] not found"); + } doneTheseCells: if (thesecells) free(thesecells); @@ -854,7 +861,7 @@ DWORD APIENTRY NPLogonNotify( !UnicodeStringToANSI(IL->LogonDomainName, logonDomain, MAX_DOMAIN_LENGTH)) return 0; - /* Make sure AD-DOMAINS sent from login that is sent to us is striped */ + /* Make sure AD-DOMAINS sent from login that is sent to us is stripped */ ctemp = strchr(uname, '@'); if (ctemp) { *ctemp = 0; @@ -883,7 +890,7 @@ DWORD APIENTRY NPLogonNotify( if (retryInterval < sleepInterval) sleepInterval = retryInterval; - DebugEvent("Got logon script: %S",opt.logonScript); + DebugEvent("Got logon script: [%S]", opt.logonScript); afsWillAutoStart = AFSWillAutoStart(); @@ -902,7 +909,7 @@ DWORD APIENTRY NPLogonNotify( /* Get cell name if doing integrated logon. We might overwrite this if we are logging into an AD realm and we find out that the user's home dir is in some other cell. */ - DebugEvent("About to call cm_GetRootCellName(%s)",cell); + DebugEvent("About to call cm_GetRootCellName()"); code = cm_GetRootCellName(cell); if (code < 0) { DebugEvent0("Unable to obtain Root Cell"); @@ -910,7 +917,7 @@ DWORD APIENTRY NPLogonNotify( reason = "unknown cell"; code=0; } else { - DebugEvent("Cell is %s",cell); + DebugEvent("Default cell is %s", cell); } /* We get the user's home directory path, if applicable, though we can't lookup the