[cifs-protocol] [REG:117102016529426] SMB2 File Rename

Sreekanth Nadendla srenaden at microsoft.com
Thu Nov 2 20:10:46 UTC 2017


Hello Andreas, I have not heard from you regarding my response below. Perhaps you would need more time to patch your rename implementation and capture traces. If you are in the process of generating those traces, let me know. Otherwise I will close this incident for now and we can revisit this when you are ready to work on this.

Regards,
Sreekanth Nadendla
Microsoft Windows Open Specifications

-----Original Message-----
From: Sreekanth Nadendla 
Sent: Friday, October 27, 2017 3:10 PM
To: Andreas Schneider <asn at samba.org>
Cc: 'Uri Simchoni' <uri at samba.org>; cifs-protocol at lists.samba.org; MSSolve Case Email <casemail at microsoft.com>
Subject: RE: [cifs-protocol] [REG:117102016529426] SMB2 File Rename

Hello Andreas, Windows SMB1 clients use SMB_COM_RENAME as Uri Simchoni mentioned below. I'm confirming that part.

Perhaps your samba 'smbclient' test used the same as Uri pointed out and that's why it worked. If that’s the case, we aren't comparing apples-apples. i.e. it would not be a problem at all as we've already documented about canonicalizing '..'

If you think in your SMB v1, command "rename README ..\dir2\README" resulted in FILE_RENAME_INFORMATION_TYPE_1 with FileName containing '..', please collect the trace and send me for review. Otherwise we can resolve this incident.

Regards,
Sreekanth Nadendla
Microsoft Windows Open Specifications

-----Original Message-----
From: Uri Simchoni [mailto:uri at samba.org]
Sent: Wednesday, October 25, 2017 3:52 PM
To: Sreekanth Nadendla <srenaden at microsoft.com>; Andreas Schneider <asn at samba.org>
Cc: cifs-protocol at lists.samba.org; MSSolve Case Email <casemail at microsoft.com>
Subject: Re: [cifs-protocol] [REG:117102016529426] SMB2 File Rename

Chiming in because I also had rename-related investigations (I don't think this answers the original question but it is relevant to the
response):
- smbclient does SMB1 rename using cifs rename, not using FILE_RENAME_INFO
- so does Windows (or so it seems)
- smbclient can be made to use FILE_RENAME_INFO using the -f option
- however, the -f implementation for NT1 is broken because NT1 expects the dest file to be relative to directory of source file, and cannot move it to another dir (SMB2 onwards expects the dest to be relative to share's root and *can* move file between dirs

The attached patch set to Samba includes a torture test that demonstrates all that (passes against both Samba and Windows 10)

Thanks,
Uri.

On 10/25/2017 10:18 PM, Sreekanth Nadendla via cifs-protocol wrote:
> Hello Andreas, in the sample traces you've sent us, I can see the setInfo request with SMB2_FILE_RENAME_INFO for SMB2 case. However I don't see similar rename structure from your first trace rename_nt1.  Let me know if I'm missing something. 
> 
> On windows OS, rename command does not allow you to specify a new drive (device) or *path* for the destination file. Before I dig in further with "move" command in my investigation, I would like to see from your traces exactly how the request was sent to server in the case of SMB v1.  Also if you can, please confirm if the same Windows 2012 server is used when your client was using SMB v3.
> 
> 
> Regards,
> Sreekanth Nadendla
> Microsoft Windows Open Specifications
> 
> -----Original Message-----
> From: Sreekanth Nadendla
> Sent: Friday, October 20, 2017 11:16 AM
> To: Andreas Schneider <asn at samba.org>
> Cc: cifs-protocol at lists.samba.org; MSSolve Case Email 
> <casemail at microsoft.com>
> Subject: [REG:117102016529426] SMB2 File Rename
> 
> Hello Andreas, I will be assisting you with your issue. I am currently researching the problem and will provide you with an update soon. Thank you for your patience.
> 
> Regards,
> Sreekanth Nadendla
> Microsoft Windows Open Specifications
> 
> -----Original Message-----
> From: Andreas Schneider [mailto:asn at samba.org]
> Sent: Friday, October 20, 2017 6:21 AM
> To: Interoperability Documentation Help <dochelp at microsoft.com>
> Cc: cifs-protocol at lists.samba.org
> Subject: SMB2 File Rename
> 
> 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
> 
> 



More information about the cifs-protocol mailing list