[cifs-protocol] SMB2 File Rename

Jeff McCashland jeffm at microsoft.com
Fri Oct 20 21:27:29 UTC 2017


Thank you for the update, Jeremy!



________________________________
From: Jeremy Allison <jra at samba.org>
Sent: Friday, October 20, 2017 2:10:12 PM
To: Andreas Schneider
Cc: Interoperability Documentation Help; cifs-protocol at lists.samba.org
Subject: Re: [cifs-protocol] SMB2 File Rename

On Fri, Oct 20, 2017 at 03:21:27PM +0200, Andreas Schneider via cifs-protocol wrote:
> 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?

Just a quick follow up after research. In MS-FCC.pdf it
states:

2.1.5.1 Dot Directory Names
The pathname components of "." (single period) and ".." (two periods) are reserved as dot directory
names.
Except where explicitly permitted, a pathname component that is a dot directory name MUST NOT be
sent over the wire.

so it looks like for SMB2 the server is expecting the
client to canonicalize out all "." and ".." names before
use.

Jeremy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/cifs-protocol/attachments/20171020/5621cb2d/attachment.html>


More information about the cifs-protocol mailing list