summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-30 13:06:18 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-09-11 18:46:09 +1000
commitaab0b557b9577d2ef8bed7a0674b702ea94c0d4a (patch)
treeb5194d314c299f219bfd1044d352c7fa78073ca1 /libcli
parent3bb77516b841def60e08e50bafc37517dd9d3ae0 (diff)
downloadsamba-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')
-rw-r--r--libcli/security/privileges.c9
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));
}
}
}