From aab0b557b9577d2ef8bed7a0674b702ea94c0d4a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 30 Aug 2010 13:06:18 +1000 Subject: 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 --- libcli/security/privileges.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libcli') 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; idxprivilege_mask & privs[idx].privilege_mask) { DEBUGADD(dbg_lev, (" Privilege[%3lu]: %s\n", (unsigned long)i++, - sec_privilege_name(privilege))); + privs[idx].name)); } } } -- cgit