Windows: XP do not mark rdr devices as secure
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 15 Mar 2014 16:44:09 +0000 (12:44 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 18 Mar 2014 00:25:28 +0000 (17:25 -0700)
Commit 9174531dca75f1f2d235ed806f784422792c3ab2 introduced the use
of device characteristics (secure and remote) to the IoCreateDevice()
and IoCreateDeviceSecure() calls for the AFSRedirector device objects.

After this change end users began to report problems on 32-bit Windows
XP SP3 when the initial access to the AFS redirector was performed by
a Limited Access Account.

This patchset conditionalizes the specification of the secure device
characteristic when registering the redirector with MUP on 32-bit
Windows XP.

Change-Id: I0fb9671b8a05a841f2356d100e7031c961a7c482
Reviewed-on: http://gerrit.openafs.org/10906
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/fs/AFSInit.cpp
src/WINNT/afsrdr/kernel/fs/AFSRDRSupport.cpp

index a2631f3..c06d472 100644 (file)
@@ -260,7 +260,7 @@ DriverEntry( PDRIVER_OBJECT DriverObject,
                                          sizeof( AFSDeviceExt),
                                          &uniDeviceName,
                                          FILE_DEVICE_NETWORK_FILE_SYSTEM,
-                                         FILE_DEVICE_SECURE_OPEN | FILE_REMOTE_DEVICE,
+                                        FILE_DEVICE_SECURE_OPEN | FILE_REMOTE_DEVICE,
                                          FALSE,
                                          &SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RWX_RES_RWX,
                                          (LPCGUID)&GUID_SD_AFS_REDIRECTOR_CONTROL_OBJECT,
index af91123..79598da 100644 (file)
@@ -48,10 +48,19 @@ AFSInitRDRDevice()
     AFSDeviceExt  *pDeviceExt = NULL;
     UNICODE_STRING uniFsRtlRegisterUncProviderEx;
     FsRtlRegisterUncProviderEx_t pFsRtlRegisterUncProviderEx = NULL;
+    RTL_OSVERSIONINFOW sysVersion;
+    ULONG ulDeviceCharacteristics = FILE_REMOTE_DEVICE;
 
     __Enter
     {
 
+       RtlZeroMemory( &sysVersion,
+                      sizeof( RTL_OSVERSIONINFOW));
+
+       sysVersion.dwOSVersionInfoSize = sizeof( RTL_OSVERSIONINFOW);
+
+       RtlGetVersion( &sysVersion);
+
         RtlInitUnicodeString( &uniDeviceName,
                               AFS_RDR_DEVICE_NAME);
 
@@ -60,11 +69,24 @@ AFSInitRDRDevice()
 
         pFsRtlRegisterUncProviderEx = (FsRtlRegisterUncProviderEx_t)MmGetSystemRoutineAddress(&uniFsRtlRegisterUncProviderEx);
 
+       //
+       // On 32-bit Windows XP, do not set FILE_DEVICE_SECURE_OPEN
+       // flag as it interferes with initial access to \\afs from
+       // limited user accounts.
+       //
+
+       if(!(sysVersion.dwMajorVersion == 5 &&
+            sysVersion.dwMinorVersion == 1))
+       {
+
+           ulDeviceCharacteristics |= FILE_DEVICE_SECURE_OPEN;
+       }
+
         ntStatus = IoCreateDevice( AFSDriverObject,
                                    sizeof( AFSDeviceExt),
                                    pFsRtlRegisterUncProviderEx ? NULL : &uniDeviceName,
                                    FILE_DEVICE_NETWORK_FILE_SYSTEM,
-                                   FILE_DEVICE_SECURE_OPEN | FILE_REMOTE_DEVICE,
+                                  ulDeviceCharacteristics,
                                    FALSE,
                                    &AFSRDRDeviceObject);