]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-windows-afslogon-dont-modify-environment-20061128
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 28 Nov 2006 09:02:58 +0000 (09:02 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 28 Nov 2006 09:02:58 +0000 (09:02 +0000)
don't allow environment variables we set to be inherited by child
processes

(cherry picked from commit 97733f8dcfd08968da5173ceb5976143728b5eab)

src/WINNT/afsd/afslogon.c

index abacaaa8527a9162d21db3bf234eda6b066125be..d5c403a91f51c2be2e81bccc900b4c9429a60851 100644 (file)
@@ -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;