Windows: Send all \\AFS\PIPE to afsd_service
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 6 Aug 2012 16:19:26 +0000 (12:19 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 28 Oct 2012 16:23:56 +0000 (09:23 -0700)
Anytime there is a pipe service request, forward it to the
afsd_service.exe and permit the service to manage the request.
The prior implementation resulted in STATUS_FILE_NOT_FOUND errors
being delivered when an unexpected service was requested.

Change-Id: I2ae9c45db787c0cb422fa3fecdfb235631927415
Reviewed-on: http://gerrit.openafs.org/8320
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSFSControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h

index a892166..10cf996 100644 (file)
@@ -774,30 +774,10 @@ AFSProcessShareFsCtrl( IN IRP *Irp,
             default:
             {
 
-                if( BooleanFlagOn( Ccb->DirectoryCB->Flags, AFS_DIR_ENTRY_SERVER_SERVICE))
-                {
-
-                    //AFSPrint("AFSProcessShareFsCtrl (%08lX) For srvsvc input %08lX output %08lX\n",
-                    //                                                            ulFsControlCode,
-                    //                                                            ulInputBufferLen,
-                    //                                                            ulOutputBufferLen);
-                }
-                else if( BooleanFlagOn( Ccb->DirectoryCB->Flags, AFS_DIR_ENTRY_WORKSTATION_SERVICE))
-                {
-
-                    //AFSPrint("AFSProcessShareFsCtrl (%08lX) For wkssvc input %08lX output %08lX\n",
-                    //                                                            ulFsControlCode,
-                    //                                                            ulInputBufferLen,
-                    //                                                            ulOutputBufferLen);
-                }
-                else
-                {
-
-                    //AFSPrint("AFSProcessShareFsCtrl (%08lX) For IPC$ input %08lX output %08lX\n",
-                    //                                                            ulFsControlCode,
-                    //                                                            ulInputBufferLen,
-                    //                                                            ulOutputBufferLen);
-                }
+                AFSPrint( "AFSProcessShareFsCtrl (%08lX) For IPC$ input %08lX output %08lX\n",
+                          ulFsControlCode,
+                          ulInputBufferLen,
+                          ulOutputBufferLen);
 
                 break;
             }
index 6a7a938..dc26549 100644 (file)
@@ -4265,7 +4265,7 @@ AFSInitializeSpecialShareNameList()
     {
 
         RtlInitUnicodeString( &uniShareName,
-                              L"PIPE\\srvsvc");
+                              L"PIPE");
 
         pObjectInfoCB = AFSAllocateObjectInfo( &AFSGlobalRoot->ObjectInformation,
                                                0);
@@ -4330,7 +4330,7 @@ AFSInitializeSpecialShareNameList()
         // Set valid entry
         //
 
-        SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_VALID | AFS_DIR_ENTRY_SERVER_SERVICE);
+        SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_VALID | AFS_DIR_ENTRY_PIPE_SERVICE);
 
         pDirNode->NameInformation.FileName.Length = uniShareName.Length;
 
@@ -4349,92 +4349,6 @@ AFSInitializeSpecialShareNameList()
 
         pLastDirNode = pDirNode;
 
-        RtlInitUnicodeString( &uniShareName,
-                              L"PIPE\\wkssvc");
-
-        pObjectInfoCB = AFSAllocateObjectInfo( &AFSGlobalRoot->ObjectInformation,
-                                               0);
-
-        if( pObjectInfoCB == NULL)
-        {
-
-            try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
-        }
-
-        AFSDbgLogMsg( AFS_SUBSYSTEM_OBJECT_REF_COUNTING,
-                      AFS_TRACE_LEVEL_VERBOSE,
-                      "AFSInitializeSpecialShareNameList (wkssvc) Initializing count (1) on object %08lX\n",
-                      pObjectInfoCB);
-
-        pObjectInfoCB->ObjectReferenceCount = 1;
-
-        pObjectInfoCB->FileType = AFS_FILE_TYPE_SPECIAL_SHARE_NAME;
-
-        ulEntryLength = sizeof( AFSDirectoryCB) +
-                                     uniShareName.Length;
-
-        pDirNode = (AFSDirectoryCB *)AFSLibExAllocatePoolWithTag( PagedPool,
-                                                                  ulEntryLength,
-                                                                  AFS_DIR_ENTRY_TAG);
-
-        if( pDirNode == NULL)
-        {
-
-            AFSDeleteObjectInfo( pObjectInfoCB);
-
-            try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
-        }
-
-        pNonPagedDirEntry = (AFSNonPagedDirectoryCB *)AFSLibExAllocatePoolWithTag( NonPagedPool,
-                                                                                   sizeof( AFSNonPagedDirectoryCB),
-                                                                                   AFS_DIR_ENTRY_NP_TAG);
-
-        if( pNonPagedDirEntry == NULL)
-        {
-
-            ExFreePool( pDirNode);
-
-            AFSDeleteObjectInfo( pObjectInfoCB);
-
-            try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
-        }
-
-        RtlZeroMemory( pDirNode,
-                       ulEntryLength);
-
-        RtlZeroMemory( pNonPagedDirEntry,
-                       sizeof( AFSNonPagedDirectoryCB));
-
-        ExInitializeResourceLite( &pNonPagedDirEntry->Lock);
-
-        pDirNode->NonPaged = pNonPagedDirEntry;
-
-        pDirNode->ObjectInformation = pObjectInfoCB;
-
-        //
-        // Set valid entry
-        //
-
-        SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_VALID | AFS_DIR_ENTRY_WORKSTATION_SERVICE);
-
-        pDirNode->NameInformation.FileName.Length = uniShareName.Length;
-
-        pDirNode->NameInformation.FileName.MaximumLength = uniShareName.Length;
-
-        pDirNode->NameInformation.FileName.Buffer = (WCHAR *)((char *)pDirNode + sizeof( AFSDirectoryCB));
-
-        RtlCopyMemory( pDirNode->NameInformation.FileName.Buffer,
-                       uniShareName.Buffer,
-                       pDirNode->NameInformation.FileName.Length);
-
-        pDirNode->CaseInsensitiveTreeEntry.HashIndex = AFSGenerateCRC( &pDirNode->NameInformation.FileName,
-                                                                       TRUE);
-
-        pLastDirNode->ListEntry.fLink = pDirNode;
-
-        pDirNode->ListEntry.bLink = pLastDirNode;
-
-        pLastDirNode = pDirNode;
 
         RtlInitUnicodeString( &uniShareName,
                               L"IPC$");
@@ -4567,38 +4481,14 @@ AFSGetSpecialShareNameEntry( IN UNICODE_STRING *ShareName,
     __Enter
     {
 
-        //
-        // Build up the entire name here. We are guaranteed that if there is a
-        // secondary name, it is pointing to a portion of the share name buffer
-        //
-
-        if( SecondaryName->Length > 0 &&
-            SecondaryName->Buffer != NULL)
-        {
-
-            uniFullShareName = *SecondaryName;
 
-            //
-            // The calling routine strips off the leading slash so add it back in
-            //
-
-            uniFullShareName.Buffer--;
-            uniFullShareName.Length += sizeof( WCHAR);
-            uniFullShareName.MaximumLength += sizeof( WCHAR);
-
-            //
-            // And the share name
-            //
-
-            uniFullShareName.Buffer -= (ShareName->Length/sizeof( WCHAR));
-            uniFullShareName.Length += ShareName->Length;
-            uniFullShareName.MaximumLength += ShareName->Length;
-        }
-        else
-        {
+        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                      AFS_TRACE_LEVEL_VERBOSE_2,
+                      "AFSGetSpecialShareNameEntry share name %wZ secondary name %wZ\n",
+                      ShareName,
+                      SecondaryName);
 
-            uniFullShareName = *ShareName;
-        }
+        uniFullShareName = *ShareName;
 
         //
         // Generate our hash value
index 8f10419..b736e4a 100644 (file)
@@ -246,10 +246,9 @@ NTSTATUS
 #define AFS_DIR_ENTRY_VALID                     0x00000080
 #define AFS_DIR_ENTRY_PENDING_DELETE            0x00000100
 #define AFS_DIR_ENTRY_DELETED                   0x00000200
-#define AFS_DIR_ENTRY_SERVER_SERVICE            0x00000400
-#define AFS_DIR_ENTRY_WORKSTATION_SERVICE       0x00000800
-#define AFS_DIR_ENTRY_IPC                       0x00001000
-#define AFS_DIR_ENTRY_INSERTED_SHORT_NAME       0x00002000
+#define AFS_DIR_ENTRY_PIPE_SERVICE              0x00000400
+#define AFS_DIR_ENTRY_IPC                       0x00000800
+#define AFS_DIR_ENTRY_INSERTED_SHORT_NAME       0x00001000
 
 //
 // Network provider errors