diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-08-30 13:17:48 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-09-11 18:46:10 +1000 |
commit | 2bb7b827d60424aaccd12bd811d4a42de72f0185 (patch) | |
tree | bb1d3757f46eec58a80966d35e7fd1209e71b3da /libcli | |
parent | ed6b4ddd71ebdcdbdea7949ecbef11f409766534 (diff) | |
download | samba-2bb7b827d60424aaccd12bd811d4a42de72f0185.tar.gz samba-2bb7b827d60424aaccd12bd811d4a42de72f0185.tar.bz2 samba-2bb7b827d60424aaccd12bd811d4a42de72f0185.zip |
libcli/security Remove luid_to_se_priv() and luid_to_privilege_name()
These functions duplicate other functions in the merged code.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/security/privileges.c | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/libcli/security/privileges.c b/libcli/security/privileges.c index 3012f71345..309a532831 100644 --- a/libcli/security/privileges.c +++ b/libcli/security/privileges.c @@ -418,29 +418,6 @@ int num_privileges_in_short_list( void ) } /**************************************************************************** - Convert a LUID to a named string -****************************************************************************/ - -const char *luid_to_privilege_name(const struct lsa_LUID *set) -{ - int i; - - uint32_t num_privs = ARRAY_SIZE(privs); - - if (set->high != 0) - return NULL; - - for ( i=0; i<num_privs; i++ ) { - if ( set->low == privs[i].luid ) { - return privs[i].name; - } - } - - return NULL; -} - - -/**************************************************************************** add a privilege to a privilege array ****************************************************************************/ @@ -495,24 +472,6 @@ bool se_priv_to_privilege_set( PRIVILEGE_SET *set, uint64_t privilege_mask ) /******************************************************************* *******************************************************************/ -static bool luid_to_se_priv( struct lsa_LUID *luid, uint64_t *privilege_mask ) -{ - int i; - uint32_t num_privs = ARRAY_SIZE(privs); - - for ( i=0; i<num_privs; i++ ) { - if ( luid->low == privs[i].luid ) { - se_priv_copy( privilege_mask, &privs[i].privilege_mask ); - return true; - } - } - - return false; -} - -/******************************************************************* -*******************************************************************/ - bool privilege_set_to_se_priv( uint64_t *privilege_mask, struct lsa_PrivilegeSet *privset ) { int i; @@ -528,8 +487,10 @@ bool privilege_set_to_se_priv( uint64_t *privilege_mask, struct lsa_PrivilegeSet if ( privset->set[i].luid.high != 0 ) return false; - if ( luid_to_se_priv( &privset->set[i].luid, &r ) ) - se_priv_add( privilege_mask, &r ); + r = sec_privilege_mask(privset->set[i].luid.low); + if (r) { + *privilege_mask |= r; + } } return true; |