]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: reply_setatr(), smbd_check_access_rights() -> smbd_check_access_rights_fsp().
authorJeremy Allison <jra@samba.org>
Wed, 2 Jun 2021 20:37:30 +0000 (13:37 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/reply.c

index 6168ffc4610a0ec3140482120d86b0deb0bd8830..44747408256862cca1b941ff71a4f7d7ee85cff2 100644 (file)
@@ -1492,6 +1492,12 @@ void reply_setatr(struct smb_request *req)
                goto out;
        }
 
+       if (smb_fname->fsp == NULL) {
+               /* Can't set access rights on a symlink. */
+               reply_nterror(req, NT_STATUS_ACCESS_DENIED);
+               goto out;
+       }
+
        mode = SVAL(req->vwv+0, 0);
        mtime = srv_make_unix_date3(req->vwv+1);
 
@@ -1501,9 +1507,7 @@ void reply_setatr(struct smb_request *req)
                else
                        mode &= ~FILE_ATTRIBUTE_DIRECTORY;
 
-               status = smbd_check_access_rights(conn,
-                                       conn->cwd_fsp,
-                                       smb_fname,
+               status = smbd_check_access_rights_fsp(smb_fname->fsp,
                                        false,
                                        FILE_WRITE_ATTRIBUTES);
                if (!NT_STATUS_IS_OK(status)) {