From 3e0e756104dc77059843bcef4a8d44981df28a18 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Sun, 4 Jan 2009 10:45:34 -0800 Subject: s3: Allow renames of streams via NTRENAME and fix stream error codes on rename The test_streams_rename2 test in RAW-STREAMS verifies these changes --- source3/smbd/nttrans.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/smbd/nttrans.c') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 9bfc566410..a793e614af 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1310,13 +1310,6 @@ void reply_ntrename(struct smb_request *req) return; } - if( is_ntfs_stream_name(oldname)) { - /* Can't rename a stream. */ - reply_nterror(req, NT_STATUS_ACCESS_DENIED); - END_PROFILE(SMBntrename); - return; - } - if (ms_has_wild(oldname)) { reply_nterror(req, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); END_PROFILE(SMBntrename); @@ -1364,6 +1357,13 @@ void reply_ntrename(struct smb_request *req) return; } + /* The new name must begin with a ':' if the old name is a stream. */ + if (is_ntfs_stream_name(oldname) && (newname[0] != ':')) { + reply_nterror(req, NT_STATUS_INVALID_PARAMETER); + END_PROFILE(SMBntrename); + return; + } + DEBUG(3,("reply_ntrename : %s -> %s\n",oldname,newname)); switch(rename_type) { -- cgit