From 8ff6bc2350894924ad362e0f058a24de3e459270 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 30 Aug 2010 13:33:19 +1000 Subject: libcli/security Remove unused functions and constants. All the callers to these functions have been removed or reworked. Andrew Bartlett Signed-off-by: Andrew Tridgell --- libcli/security/privileges.c | 229 +++---------------------------------------- libcli/security/privileges.h | 27 ----- 2 files changed, 14 insertions(+), 242 deletions(-) (limited to 'libcli') diff --git a/libcli/security/privileges.c b/libcli/security/privileges.c index 1e22f54280..2b241c91aa 100644 --- a/libcli/security/privileges.c +++ b/libcli/security/privileges.c @@ -39,20 +39,6 @@ /* The use of strcasecmp here is safe, all the comparison strings are ASCII */ #undef strcasecmp -const uint64_t se_priv_all = SE_ALL_PRIVS; - -/* Define variables for all privileges so we can use the - uint64_t* in the various se_priv_XXX() functions */ - -const uint64_t se_priv_none = SE_NONE; -const uint64_t se_machine_account = SE_MACHINE_ACCOUNT; -const uint64_t se_print_operator = SE_PRINT_OPERATOR; -const uint64_t se_add_users = SE_ADD_USERS; -const uint64_t se_disk_operators = SE_DISK_OPERATOR; -const uint64_t se_remote_shutdown = SE_REMOTE_SHUTDOWN; -const uint64_t se_restore = SE_RESTORE; -const uint64_t se_take_ownership = SE_TAKE_OWNERSHIP; - #define NUM_SHORT_LIST_PRIVS 8 static const struct { @@ -182,18 +168,19 @@ static const struct { "Remote Interactive logon"} }; -/*************************************************************************** - copy an uint64_t privilege bitmap -****************************************************************************/ - -bool se_priv_copy( uint64_t *dst, const uint64_t *src ) +/* + return a privilege mask given a privilege id +*/ +static uint64_t sec_privilege_mask(enum sec_privilege privilege) { - if ( !dst || !src ) - return false; - - *dst = *src; + int i; + for (i=0;iprivilege_mask, privilege_bit ); -} - -/**************************************************************************** - Does the user have any of the specified privileges ? We only deal with one privilege - at a time here. -*****************************************************************************/ - -bool user_has_any_privilege(struct security_token *token, const uint64_t *privilege_mask) -{ - if ( !token ) - return false; - - return is_any_privilege_assigned( &token->privilege_mask, privilege_mask ); -} - /******************************************************************* return the number of elements in the 'short' privlege array (traditional source3 behaviour) *******************************************************************/ @@ -543,20 +371,6 @@ enum sec_privilege sec_privilege_id(const char *name) return -1; } -/* - map a privilege name to a privilege id. Return -1 if not found -*/ -enum sec_privilege sec_privilege_from_mask(uint64_t mask) -{ - int i; - for (i=0;i