diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-08-30 13:06:18 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-09-11 18:46:09 +1000 |
commit | aab0b557b9577d2ef8bed7a0674b702ea94c0d4a (patch) | |
tree | b5194d314c299f219bfd1044d352c7fa78073ca1 /libcli/security | |
parent | 3bb77516b841def60e08e50bafc37517dd9d3ae0 (diff) | |
download | samba-aab0b557b9577d2ef8bed7a0674b702ea94c0d4a.tar.gz samba-aab0b557b9577d2ef8bed7a0674b702ea94c0d4a.tar.bz2 samba-aab0b557b9577d2ef8bed7a0674b702ea94c0d4a.zip |
libcli/security Improve dump of privileges: Just walk the table
This removes some logic recently added that was just too smart - it
is easier to just walk the table and do a bit match here.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'libcli/security')
-rw-r--r-- | libcli/security/privileges.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libcli/security/privileges.c b/libcli/security/privileges.c index 054ba57e37..3012f71345 100644 --- a/libcli/security/privileges.c +++ b/libcli/security/privileges.c @@ -668,13 +668,12 @@ void security_token_debug_privileges(int dbg_lev, const struct security_token *t (unsigned long long) token->privilege_mask)); if (token->privilege_mask) { + int idx = 0; int i = 0; - uint64_t mask; - for (mask = 1; mask != 0; mask = mask << 1) { - if (token->privilege_mask & mask) { - enum sec_privilege privilege = sec_privilege_from_mask(mask); + for (idx = 0; idx<ARRAY_SIZE(privs); idx++) { + if (token->privilege_mask & privs[idx].privilege_mask) { DEBUGADD(dbg_lev, (" Privilege[%3lu]: %s\n", (unsigned long)i++, - sec_privilege_name(privilege))); + privs[idx].name)); } } } |