we need to refuse a root_fid in rename on SMB but not SMB2
authorAndrew Tridgell <tridge@samba.org>
Thu, 14 Feb 2008 01:50:11 +0000 (12:50 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 14 Feb 2008 01:50:11 +0000 (12:50 +1100)
(This used to be commit 9a139c35b7f1326616d26ce13bbdc7d6b22cd9b5)

source4/ntvfs/posix/pvfs_setfileinfo.c

index 2a936ad8a716962aa3b1086d93ce4202da0241f5..ce977873c85a5743e73193d573ce0a361da57897 100644 (file)
@@ -103,9 +103,11 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       /* w2k3 does not appear to allow relative rename */
-       if (info->rename_information.in.root_fid != 0) {
-               DEBUG(1,("WARNING: got invalid root_fid in rename_information.\n"));
+       /* w2k3 does not appear to allow relative rename. On SMB2, vista sends it sometimes,
+          but I suspect it is just uninitialised memory */
+       if (info->rename_information.in.root_fid != 0 && 
+           (req->ctx->protocol != PROTOCOL_SMB2)) {
+               return NT_STATUS_INVALID_PARAMETER;
        }
 
        /* construct the fully qualified windows name for the new file name */