s3:smbd: give the correct error when trying to replace a stream
authorStefan Metzmacher <metze@samba.org>
Mon, 1 Dec 2008 22:23:30 +0000 (14:23 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 1 Dec 2008 22:23:30 +0000 (14:23 -0800)
metze

source3/smbd/reply.c

index a1833b55dfb4dda531a624c790daa41125d39f93..11c713ab4ad14df4bc4e59ce9ab71ef235b63472 100644 (file)
@@ -5496,6 +5496,12 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
                return NT_STATUS_OBJECT_NAME_COLLISION;
        }
 
+       if(replace_if_exists && dst_exists) {
+               if (is_ntfs_stream_name(newname)) {
+                       return NT_STATUS_INVALID_PARAMETER;
+               }
+       }
+
        if (dst_exists) {
                struct file_id fileid = vfs_file_id_from_sbuf(conn, &sbuf1);
                files_struct *dst_fsp = file_find_di_first(fileid);