]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-smb-disable-loopback-check-20090427
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 28 Apr 2009 00:37:26 +0000 (00:37 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 28 Apr 2009 00:37:26 +0000 (00:37 +0000)
LICENSE MIT

Now that BackConnectionHostNames can be set each time the smb listener
threads are stopped and restarted, we need to make sure that we do not
clear the DisableLoopbackCheck value if it was set during the same
service session because BackConnectionHostName value changes only take
effect on a reboot.

(cherry picked from commit c4006edf4022e4f80cda5afd427d43997299c890)

src/WINNT/afsd/smb.c

index 0dc5e9a279340d02b412f6484f0951b8ff4e7777..b374714f4b488f1f0b7fbcb203252229449fb2e5 100644 (file)
@@ -9446,6 +9446,9 @@ configureBackConnectionHostNames(void)
      * Starting in Longhorn Beta 1, an entry in the BackConnectionHostNames value will
      * force Windows to use the loopback authentication mechanism for the specified 
      * services.
+     * 
+     * Do not permit the "DisableLoopbackCheck" value to be removed within the same
+     * service session that set it.  
      */
     HKEY hkLsa;
     HKEY hkMSV10;
@@ -9455,6 +9458,7 @@ configureBackConnectionHostNames(void)
     DWORD dwValue;
     PBYTE pHostNames = NULL, pName = NULL;
     BOOL  bNameFound = FALSE;   
+    static BOOL bLoopbackCheckDisabled = FALSE;
 
     /* BackConnectionHostNames and DisableLoopbackCheck */
     if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, 
@@ -9528,12 +9532,13 @@ configureBackConnectionHostNames(void)
                         dwSize = sizeof(DWORD);
                         dwValue = 1;
                         RegSetValueEx( hkClient, "RemoveDisableLoopbackCheck", 0, dwType, (LPBYTE)&dwValue, dwSize);
+                        bLoopbackCheckDisabled = TRUE;
                         RegCloseKey(hkClient);
                     }
                     RegCloseKey(hkLsa);
                 }
             }
-        } else {
+        } else if (!bLoopbackCheckDisabled) {
             if (RegCreateKeyEx( HKEY_LOCAL_MACHINE, 
                                 AFSREG_CLT_OPENAFS_SUBKEY,
                                 0,