]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix bug #5797 - Moving readonly files fails. Reported by infomail@lordb.de.
authorJeremy Allison <jra@samba.org>
Fri, 26 Sep 2008 22:17:14 +0000 (15:17 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 26 Sep 2008 22:17:14 +0000 (15:17 -0700)
We don't need to deny a DELETE open on a readonly file (I'm also adding a s4
torture test for this), the set_file_disposition call will return
NT_STATUS_CANNOT_DELETE if the delete-on-close bit is set
on a readonly file (and we already do this).
Jeremy.

source3/smbd/open.c

index 71191475b365572ce212b106babc8bc07653f772..ad024a58efa5f6daec71fae79cd8aabf61a360ee 100644 (file)
@@ -2608,9 +2608,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
            && (create_disposition != FILE_CREATE)
            && (share_access & FILE_SHARE_DELETE)
            && (access_mask & DELETE_ACCESS)
-           && (((dos_mode(conn, fname, &sbuf) & FILE_ATTRIBUTE_READONLY)
-                && !lp_delete_readonly(SNUM(conn)))
-               || !can_delete_file_in_directory(conn, fname))) {
+           && (!can_delete_file_in_directory(conn, fname))) {
                status = NT_STATUS_ACCESS_DENIED;
                goto fail;
        }