Final part of patchset to fix bug #8556 - ACL permissions ignored when SMBsetatr...
[mat/samba.git] / source3 / smbd / reply.c
index 18ebca1ce2bb61583e8ab5fb452ef47c35762b44..7dd3260f0b05532a992cc26b447b9070c45835c5 100644 (file)
@@ -1275,6 +1275,13 @@ void reply_setatr(struct smb_request *req)
                else
                        mode &= ~FILE_ATTRIBUTE_DIRECTORY;
 
+               status = check_access(conn, NULL, smb_fname,
+                                       FILE_WRITE_ATTRIBUTES);
+               if (!NT_STATUS_IS_OK(status)) {
+                       reply_nterror(req, status);
+                       goto out;
+               }
+
                if (file_set_dosmode(conn, smb_fname, mode, NULL,
                                     false) != 0) {
                        reply_nterror(req, map_nt_error_from_unix(errno));