From: Rod Widdowson Date: Sat, 22 Oct 2011 15:46:26 +0000 (+0100) Subject: Windows: Look for 8.3 name when doing a rename X-Git-Tag: upstream/1.8.0_pre1^2~3120 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=241d3d54cebfc661cfaec6d21de091d906df3d08;p=packages%2Fo%2Fopenafs.git Windows: Look for 8.3 name when doing a rename If we are doing a destructive rename we need to find whether the target file exists. This is done in the usual way (case sensitive case insensitive), but the short name is not looked for. This means that the rename of a file to a short name will not supersede correctly; rather the service refuses the rename since the target existed already. This patch looks the target name up in the shortname tree if the target name is short and all else has failed. Change-Id: Ie054516a378edf52938d3465143a16107a99c0f6 Reviewed-on: http://gerrit.openafs.org/5652 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp index 2c73dafbd..fe93a6f19 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp @@ -1907,6 +1907,17 @@ AFSSetRenameInfo( IN PIRP Irp) &pTargetDirEntry); } + if( pTargetDirEntry == NULL && RtlIsNameLegalDOS8Dot3( &uniTargetName, + NULL, + NULL)) + { + // + // Try the short name + // + AFSLocateShortNameDirEntry( pTargetParentObject->Specific.Directory.ShortNameTree, + ulTargetCRC, + &pTargetDirEntry); + } // // Increment our ref count on the dir entry //