From: Volker Lendecke Date: Tue, 3 Jan 2023 17:45:14 +0000 (+0100) Subject: lib: Make map_share_mode_to_deny_mode() static to smbstatus X-Git-Tag: talloc-2.4.0~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6907db5cf0a586db2bfe3a508c753be44bdc317f;p=thirdparty%2Fsamba.git lib: Make map_share_mode_to_deny_mode() static to smbstatus At some point in the future this might disappear, we should really not show DOS share modes in smbstatus. Maybe this can't be changed though. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/include/proto.h b/source3/include/proto.h index d848186b41c..df2240c5f48 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -353,7 +353,6 @@ bool mask_match_search(const char *string, const char *pattern, bool is_case_sen bool mask_match_list(const char *string, char **list, int listLen, bool is_case_sensitive); #include "lib/util/unix_match.h" bool name_to_fqdn(fstring fqdn, const char *name); -uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_options); #include "lib/util_procid.h" diff --git a/source3/lib/util.c b/source3/lib/util.c index 8015b7e4604..b1f2ccf55dd 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1586,27 +1586,6 @@ bool name_to_fqdn(fstring fqdn, const char *name) return true; } -uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_options) -{ - switch (share_access & ~FILE_SHARE_DELETE) { - case FILE_SHARE_NONE: - return DENY_ALL; - case FILE_SHARE_READ: - return DENY_WRITE; - case FILE_SHARE_WRITE: - return DENY_READ; - case FILE_SHARE_READ|FILE_SHARE_WRITE: - return DENY_NONE; - } - if (private_options & NTCREATEX_FLAG_DENY_DOS) { - return DENY_DOS; - } else if (private_options & NTCREATEX_FLAG_DENY_FCB) { - return DENY_FCB; - } - - return (uint32_t)-1; -} - struct server_id interpret_pid(const char *pid_string) { return server_id_from_string(get_my_vnn(), pid_string); diff --git a/source3/utils/status.c b/source3/utils/status.c index e311f067c9c..d1c69c512a8 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -164,6 +164,28 @@ static int prepare_share_mode(struct traverse_state *state) return 0; } +static uint32_t map_share_mode_to_deny_mode( + uint32_t share_access, uint32_t private_options) +{ + switch (share_access & ~FILE_SHARE_DELETE) { + case FILE_SHARE_NONE: + return DENY_ALL; + case FILE_SHARE_READ: + return DENY_WRITE; + case FILE_SHARE_WRITE: + return DENY_READ; + case FILE_SHARE_READ|FILE_SHARE_WRITE: + return DENY_NONE; + } + if (private_options & NTCREATEX_FLAG_DENY_DOS) { + return DENY_DOS; + } else if (private_options & NTCREATEX_FLAG_DENY_FCB) { + return DENY_FCB; + } + + return (uint32_t)-1; +} + static int print_share_mode(struct file_id fid, const struct share_mode_data *d, const struct share_mode_entry *e,