s3:smbd: give the correct error when trying to replace a stream
authorStefan Metzmacher <metze@samba.org>
Wed, 26 Nov 2008 19:55:33 +0000 (20:55 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 26 Nov 2008 22:02:26 +0000 (23:02 +0100)
metze

source/smbd/reply.c

index 1b70f08f8932de3be7ead5f7668999976931c8dd..e445f81d028064a5240335937053d5e3ea72c7fc 100644 (file)
@@ -5555,6 +5555,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);