[cifs-protocol] SMB2 File Rename

Andreas Schneider asn at samba.org
Fri Oct 20 13:21:27 UTC 2017


Hello,

I disovered that a file rename operation (SetInfo with 
FILE_RENAME_INFORMATION_TYPE_2) fails for a SMB3 connection but works for 
SMB1.

I've run smbclient from Samba again Windows 2012:

File rename (move) over SMB1 with smbclient:

bin/smbclient //win-dc02.earth.milkyway.site/Test -Ubob1%Secret007! -mNT1
Try "help" to get a list of possible commands.
smb: \> cd dir1
smb: \dir1\> rename README ..\dir2\README
smb: \dir1\>

This works!

File rename (move) over SMB3 with smbclient:

bin/smbclient //win-dc02.earth.milkyway.site/Test -Ubob1%Secret007! -mSMB3
Try "help" to get a list of possible commands.
smb: \> cd dir1
smb: \dir1\> rename README ..\dir2\README
NT_STATUS_OBJECT_NAME_NOT_FOUND renaming files \dir1\README -> \dir1\..
\dir2\README 
smb: \dir1\>

As you can see, it fails with NT_STATUS_OBJECT_NAME_NOT_FOUND.

I do not see that we're doing anything wrong in the SetInfo request. The doc 
does not mention that '..' is not allowed.

Is a path of dir1\..\dir2\file not allowed?


Attached are the network traces.


Thanks for your help!


Best regards,


	Andreas


-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rename_nt1.pcapng
Type: application/x-pcapng
Size: 12760 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20171020/715617b7/rename_nt1-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rename_smb3.pcapng
Type: application/x-pcapng
Size: 14692 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20171020/715617b7/rename_smb3-0001.bin>


More information about the cifs-protocol mailing list