From: Jeffrey Altman Date: Tue, 28 Nov 2006 09:02:58 +0000 (+0000) Subject: STABLE14-windows-afslogon-dont-modify-environment-20061128 X-Git-Tag: openafs-stable-1_4_3rc1~62 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3e1e9ea23672fa7f4d3d564a308b52e3da361b91;p=packages%2Fo%2Fopenafs.git STABLE14-windows-afslogon-dont-modify-environment-20061128 don't allow environment variables we set to be inherited by child processes (cherry picked from commit 97733f8dcfd08968da5173ceb5976143728b5eab) --- diff --git a/src/WINNT/afsd/afslogon.c b/src/WINNT/afsd/afslogon.c index abacaaa85..d5c403a91 100644 --- a/src/WINNT/afsd/afslogon.c +++ b/src/WINNT/afsd/afslogon.c @@ -80,7 +80,6 @@ BOOLEAN APIENTRY DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved) /* Initialization Mutex */ if (!bInit) { hInitMutex = CreateMutex(NULL, FALSE, NULL); - SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, ""); } break; @@ -839,7 +838,9 @@ DWORD APIENTRY NPLogonNotify( if (ISLOGONINTEGRATED(opt.LogonOption)) { if ( KFW_is_available() ) { + SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, ""); code = KFW_AFS_get_cred(uname, cell, password, 0, opt.smbName, &reason); + SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL); DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]", uname,opt.smbName,cell,code); if (code == 0 && opt.theseCells) { @@ -864,7 +865,9 @@ DWORD APIENTRY NPLogonNotify( p = opt.theseCells; while ( *p ) { + SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, ""); code2 = KFW_AFS_get_cred(principal, p, 0, 0, opt.smbName, &reason); + SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL); DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]", principal,opt.smbName,p,code2); p += strlen(p) + 1;