From 039f85835d60ae48c4176891598cf24e18d0cd0a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Feb 2008 12:50:11 +1100 Subject: we need to refuse a root_fid in rename on SMB but not SMB2 (This used to be commit 9a139c35b7f1326616d26ce13bbdc7d6b22cd9b5) --- source4/ntvfs/posix/pvfs_setfileinfo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source4/ntvfs/posix/pvfs_setfileinfo.c b/source4/ntvfs/posix/pvfs_setfileinfo.c index 2a936ad8a7..ce977873c8 100644 --- a/source4/ntvfs/posix/pvfs_setfileinfo.c +++ b/source4/ntvfs/posix/pvfs_setfileinfo.c @@ -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 */ -- cgit