]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: replace calls to check_access() with smbd_check_access_rights()
authorRalph Boehme <slow@samba.org>
Tue, 27 Oct 2020 11:23:00 +0000 (12:23 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 19 Nov 2020 20:00:38 +0000 (20:00 +0000)
check_access() is a 1:1 wrapper arounf smbd_check_access_rights().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/trans2.c

index ae790e10705932fee6ded3116b4e4ef0ea6ced32..5266e8f316b3ee5fd61cb2b958569f16cc1243ba 100644 (file)
@@ -191,23 +191,6 @@ done:
 }
 #endif
 
-/********************************************************************
- The canonical "check access" based on path.
-********************************************************************/
-
-static NTSTATUS check_access(connection_struct *conn,
-                       struct files_struct *dirfsp,
-                       const struct smb_filename *smb_fname,
-                       uint32_t access_mask)
-{
-       SMB_ASSERT(dirfsp == dirfsp->conn->cwd_fsp);
-       return smbd_check_access_rights(conn,
-                       dirfsp,
-                       smb_fname,
-                       false,
-                       access_mask);
-}
-
 /********************************************************************
  Roundup a value to the nearest allocation roundup size boundary.
  Only do this for Windows clients.
@@ -819,9 +802,10 @@ NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
        if (fsp != NULL) {
                status = check_access_fsp(fsp, FILE_WRITE_EA);
        } else {
-               status = check_access(conn,
+               status = smbd_check_access_rights(conn,
                                conn->cwd_fsp,
                                smb_fname,
+                               false,
                                FILE_WRITE_EA);
        }
        if (!NT_STATUS_IS_OK(status)) {
@@ -7836,9 +7820,10 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn,
        if (fsp != NULL) {
                status = check_access_fsp(fsp, FILE_WRITE_ATTRIBUTES);
        } else {
-               status = check_access(conn,
+               status = smbd_check_access_rights(conn,
                                conn->cwd_fsp,
                                smb_fname,
+                               false,
                                FILE_WRITE_ATTRIBUTES);
        }
        if (!NT_STATUS_IS_OK(status)) {
@@ -7910,9 +7895,10 @@ static NTSTATUS smb_set_info_standard(connection_struct *conn,
        if (fsp != NULL) {
                status = check_access_fsp(fsp, FILE_WRITE_ATTRIBUTES);
        } else {
-               status = check_access(conn,
+               status = smbd_check_access_rights(conn,
                                conn->cwd_fsp,
                                smb_fname,
+                               false,
                                FILE_WRITE_ATTRIBUTES);
        }
        if (!NT_STATUS_IS_OK(status)) {