Windows: AFSParseName always set FileName output
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 11 Aug 2014 05:38:54 +0000 (01:38 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 21 Aug 2014 03:53:10 +0000 (23:53 -0400)
The FileName output parameter is used by the caller even when an
error occurs.  In case of error it indicates that path that failed
to parse. Not all of the error paths set FileName.

Start AFSParseName() with FileName referring to
IrpSp->FileObject->FileName.  It can be updated as required later.

Reviewed-on: http://gerrit.openafs.org/11395
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 2f4f1e3f8619b1531838a62031e969cbf64be7dd)

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

src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp

index ead1b2b..69a61a5 100644 (file)
@@ -3115,6 +3115,12 @@ AFSParseRelatedName( IN PIRP Irp,
         ASSERT( pRelatedFcb != NULL);
 
         //
+        // On error, FileName indicates the path on which the failure occurred.
+        //
+
+        *FileName = pIrpSp->FileObject->FileName;
+
+        //
         // No wild cards in the name
         //
 
@@ -3145,8 +3151,6 @@ AFSParseRelatedName( IN PIRP Irp,
 
         pDirEntry = pRelatedCcb->DirectoryCB;
 
-        *FileName = pIrpSp->FileObject->FileName;
-
         //
         // Grab the root node while checking state
         //
@@ -3510,9 +3514,15 @@ AFSParseName( IN PIRP Irp,
 
        *ParentDirectoryCB = NULL;
 
-        //
-        // No wild cards in the name
-        //
+       //
+       // On error, FileName indicates the path on which the failure occurred
+       //
+
+       *FileName = pIrpSp->FileObject->FileName;
+
+       //
+       // No wild cards in the name
+       //
 
         uniFullName = pIrpSp->FileObject->FileName;