Don't call can_write_to_file() if we already have 'fsp->can_write' set.
authorJeremy Allison <jra@samba.org>
Thu, 13 Sep 2012 21:36:57 +0000 (14:36 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 14 Sep 2012 20:54:29 +0000 (22:54 +0200)
source3/smbd/nttrans.c

index 997f72161aead411e723d28310c291d72cffc977..6848d10397f1a18408507e478cb7aed450dc71a6 100644 (file)
@@ -718,6 +718,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
                uint32 perms = 0;
                p += 25;
                if (fsp->is_directory ||
+                   fsp->can_write ||
                    can_write_to_file(conn, smb_fname)) {
                        perms = FILE_GENERIC_ALL;
                } else {
@@ -1345,6 +1346,7 @@ static void call_nt_transact_create(connection_struct *conn,
                uint32 perms = 0;
                p += 25;
                if (fsp->is_directory ||
+                   fsp->can_write ||
                    can_write_to_file(conn, smb_fname)) {
                        perms = FILE_GENERIC_ALL;
                } else {