Windows: Handle "(Default)" regsitry value in MountGlobalDrivesThread
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 11 Sep 2009 15:54:27 +0000 (11:54 -0400)
committerJeffrey Altman <jaltman|account-1000011@unknown>
Fri, 11 Sep 2009 15:59:52 +0000 (08:59 -0700)
In MountGlobalDrivesThread(), if the "(Default)" registry value
is defined that should be interpreted as a drive mapping to a
device with no name.  This is specified using NULL instead of the
nul-string.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/446
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/afsd_service.c

index 31adc14..2b7298a 100644 (file)
@@ -467,7 +467,7 @@ static DWORD __stdcall MountGlobalDrivesThread(void * notUsed)
 
             nr.dwScope = RESOURCE_GLOBALNET;              /* ignored parameter */
             nr.dwType=RESOURCETYPE_DISK;
-            nr.lpLocalName=szDriveToMapTo;
+            nr.lpLocalName=strlen(szDriveToMapTo) > 0 ? szDriveToMapTo : NULL;
             nr.lpRemoteName=szAfsPath;
             nr.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE; /* ignored parameter */
             nr.dwUsage = RESOURCEUSAGE_CONNECTABLE;       /* ignored parameter */