Fix bug #6082 - smbd_gpfs_getacl failed: Windows client canĀ“t rename or delete file
[samba.git] / source / smbd / file_access.c
index c535bc7fd8907fd63d750a690212a5d2b7e1ae32..743e0790ec5d15d080fb751f580645cb71a3e49a 100644 (file)
@@ -116,16 +116,11 @@ bool can_delete_file_in_directory(connection_struct *conn, const char *fname)
         * having the DELETE bit on the file itself and second if that does
         * not help, by the DELETE_CHILD bit on the containing directory.
         *
-        * Here we check the other way round because with just posix
-        * permissions looking at the file itself will never grant DELETE, so
-        * by looking at the directory first we save one get_acl call.
+        * Here we only check the directory permissions, we will
+        * check the file DELETE permission separately.
         */
 
-       if (can_access_file_acl(conn, dname, FILE_DELETE_CHILD)) {
-               return true;
-       }
-
-       return can_access_file_acl(conn, fname, DELETE_ACCESS);
+       return can_access_file_acl(conn, dname, FILE_DELETE_CHILD);
 }
 
 /****************************************************************************