From df85c8095b6333214eed42205c8be4261a28dae4 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 25 Apr 2011 21:23:34 -0400 Subject: [PATCH] windows: improved logging from NPLogonNotify Improve the detail and formatting of the windows event log entries. Change-Id: I088f6d35afb91e146e8e6030f29dec39301b020b Reviewed-on: http://gerrit.openafs.org/4556 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/afslogon.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/WINNT/afsd/afslogon.c b/src/WINNT/afsd/afslogon.c index df7dce2910..dda6d9e118 100644 --- a/src/WINNT/afsd/afslogon.c +++ b/src/WINNT/afsd/afslogon.c @@ -644,7 +644,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); @@ -658,9 +658,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); @@ -857,7 +864,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; @@ -886,7 +893,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(); @@ -905,7 +912,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"); @@ -913,7 +920,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