From 5a1c2b4774c914a45bf2da7e666f6acf7f6927c6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 10 Jul 2011 13:00:25 +0200 Subject: [PATCH] s3:smbd: make smbd_calculate_access_mask() non-static metze (cherry picked from commit ce66d4e4a885add09edfa8e6d5eab0f3b5d63081) --- source3/smbd/globals.h | 5 +++++ source3/smbd/open.c | 29 +++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index d9a54d214d8..58e03a5d836 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -224,6 +224,11 @@ bool smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx, int *_last_entry_off, struct ea_list *name_list); +NTSTATUS smbd_calculate_access_mask(connection_struct *conn, + const struct smb_filename *smb_fname, + bool file_existed, + uint32_t access_mask, + uint32_t *access_mask_out); NTSTATUS smbd_check_open_rights(struct connection_struct *conn, const struct smb_filename *smb_fname, uint32_t access_mask, diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d58744f05f8..58102e4c9ad 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1522,11 +1522,11 @@ static void schedule_defer_open(struct share_mode_lock *lck, Work out what access_mask to use from what the client sent us. ****************************************************************************/ -static NTSTATUS calculate_access_mask(connection_struct *conn, - const struct smb_filename *smb_fname, - bool file_existed, - uint32_t access_mask, - uint32_t *access_mask_out) +NTSTATUS smbd_calculate_access_mask(connection_struct *conn, + const struct smb_filename *smb_fname, + bool file_existed, + uint32_t access_mask, + uint32_t *access_mask_out) { NTSTATUS status; @@ -1549,8 +1549,8 @@ static NTSTATUS calculate_access_mask(connection_struct *conn, SECINFO_DACL),&sd); if (!NT_STATUS_IS_OK(status)) { - DEBUG(10, ("calculate_access_mask: Could not get acl " - "on file %s: %s\n", + DEBUG(10,("smbd_calculate_access_mask: " + "Could not get acl on file %s: %s\n", smb_fname_str_dbg(smb_fname), nt_errstr(status))); return NT_STATUS_ACCESS_DENIED; @@ -1565,8 +1565,9 @@ static NTSTATUS calculate_access_mask(connection_struct *conn, TALLOC_FREE(sd); if (!NT_STATUS_IS_OK(status)) { - DEBUG(10, ("calculate_access_mask: Access denied on " - "file %s: when calculating maximum access\n", + DEBUG(10, ("smbd_calculate_access_mask: " + "Access denied on file %s: " + "when calculating maximum access\n", smb_fname_str_dbg(smb_fname))); return NT_STATUS_ACCESS_DENIED; } @@ -1898,11 +1899,11 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, } } - status = calculate_access_mask(conn, smb_fname, file_existed, + status = smbd_calculate_access_mask(conn, smb_fname, file_existed, access_mask, &access_mask); if (!NT_STATUS_IS_OK(status)) { - DEBUG(10, ("open_file_ntcreate: calculate_access_mask " + DEBUG(10, ("open_file_ntcreate: smbd_calculate_access_mask " "on file %s returned %s\n", smb_fname_str_dbg(smb_fname), nt_errstr(status))); return status; @@ -2745,10 +2746,10 @@ static NTSTATUS open_directory(connection_struct *conn, return NT_STATUS_NOT_A_DIRECTORY; } - status = calculate_access_mask(conn, smb_dname, dir_existed, - access_mask, &access_mask); + status = smbd_calculate_access_mask(conn, smb_dname, dir_existed, + access_mask, &access_mask); if (!NT_STATUS_IS_OK(status)) { - DEBUG(10, ("open_directory: calculate_access_mask " + DEBUG(10, ("open_directory: smbd_calculate_access_mask " "on file %s returned %s\n", smb_fname_str_dbg(smb_dname), nt_errstr(status))); -- 2.11.4.GIT