summaryrefslogtreecommitdiff
path: root/libcli/security
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-09-17 15:23:19 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-10-12 02:54:16 +0000
commit0487ef0a70a9758da31cff0832ee8decbeb92e82 (patch)
treeae221f1bce1c523e84b75a1e53c585b84af11dc9 /libcli/security
parentd406e511a5f46b7212584b23d17e97508e7f537b (diff)
downloadsamba-0487ef0a70a9758da31cff0832ee8decbeb92e82.tar.gz
samba-0487ef0a70a9758da31cff0832ee8decbeb92e82.tar.bz2
samba-0487ef0a70a9758da31cff0832ee8decbeb92e82.zip
libcli/security Add debug class to security_token_debug() et al
This will allow it to replace functions in source3 that use debug classes. Andrew Bartlett
Diffstat (limited to 'libcli/security')
-rw-r--r--libcli/security/privileges.c20
-rw-r--r--libcli/security/privileges.h2
-rw-r--r--libcli/security/security_token.c10
-rw-r--r--libcli/security/security_token.h2
4 files changed, 18 insertions, 16 deletions
diff --git a/libcli/security/privileges.c b/libcli/security/privileges.c
index 65000aa754..5d4cf77490 100644
--- a/libcli/security/privileges.c
+++ b/libcli/security/privileges.c
@@ -443,31 +443,33 @@ void security_token_set_right_bit(struct security_token *token, uint32_t right_b
token->rights_mask |= right_bit;
}
-void security_token_debug_privileges(int dbg_lev, const struct security_token *token)
+void security_token_debug_privileges(int dbg_class, int dbg_lev, const struct security_token *token)
{
- DEBUGADD(dbg_lev, (" Privileges (0x%16llX):\n",
- (unsigned long long) token->privilege_mask));
+ DEBUGADDC(dbg_class, dbg_lev, (" Privileges (0x%16llX):\n",
+ (unsigned long long) token->privilege_mask));
if (token->privilege_mask) {
int idx = 0;
int i = 0;
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++,
- privs[idx].name));
+ DEBUGADDC(dbg_class, dbg_lev,
+ (" Privilege[%3lu]: %s\n", (unsigned long)i++,
+ privs[idx].name));
}
}
}
- DEBUGADD(dbg_lev, (" Rights (0x%16lX):\n",
- (unsigned long) token->rights_mask));
+ DEBUGADDC(dbg_class, dbg_lev, (" Rights (0x%16lX):\n",
+ (unsigned long) token->rights_mask));
if (token->rights_mask) {
int idx = 0;
int i = 0;
for (idx = 0; idx<ARRAY_SIZE(rights); idx++) {
if (token->rights_mask & rights[idx].right_mask) {
- DEBUGADD(dbg_lev, (" Right[%3lu]: %s\n", (unsigned long)i++,
- rights[idx].name));
+ DEBUGADDC(dbg_class, dbg_lev,
+ (" Right[%3lu]: %s\n", (unsigned long)i++,
+ rights[idx].name));
}
}
}
diff --git a/libcli/security/privileges.h b/libcli/security/privileges.h
index f67a38bc27..a65dbdfcd7 100644
--- a/libcli/security/privileges.h
+++ b/libcli/security/privileges.h
@@ -98,6 +98,6 @@ void security_token_set_privilege(struct security_token *token, enum sec_privile
*/
void security_token_set_right_bit(struct security_token *token, uint32_t right_bit);
-void security_token_debug_privileges(int dbg_lev, const struct security_token *token);
+void security_token_debug_privileges(int dbg_class, int dbg_lev, const struct security_token *token);
#endif /* PRIVILEGES_H */
diff --git a/libcli/security/security_token.c b/libcli/security/security_token.c
index 4e5aff87da..03dc528b93 100644
--- a/libcli/security/security_token.c
+++ b/libcli/security/security_token.c
@@ -44,13 +44,13 @@ struct security_token *security_token_initialise(TALLOC_CTX *mem_ctx)
/****************************************************************************
prints a struct security_token to debug output.
****************************************************************************/
-void security_token_debug(int dbg_lev, const struct security_token *token)
+void security_token_debug(int dbg_class, int dbg_lev, const struct security_token *token)
{
TALLOC_CTX *mem_ctx;
uint32_t i;
if (!token) {
- DEBUG(dbg_lev, ("Security token: (NULL)\n"));
+ DEBUGC(dbg_class, dbg_lev, ("Security token: (NULL)\n"));
return;
}
@@ -59,14 +59,14 @@ void security_token_debug(int dbg_lev, const struct security_token *token)
return;
}
- DEBUG(dbg_lev, ("Security token SIDs (%lu):\n",
+ DEBUGC(dbg_class, dbg_lev, ("Security token SIDs (%lu):\n",
(unsigned long)token->num_sids));
for (i = 0; i < token->num_sids; i++) {
- DEBUGADD(dbg_lev, (" SID[%3lu]: %s\n", (unsigned long)i,
+ DEBUGADDC(dbg_class, dbg_lev, (" SID[%3lu]: %s\n", (unsigned long)i,
dom_sid_string(mem_ctx, &token->sids[i])));
}
- security_token_debug_privileges(dbg_lev, token);
+ security_token_debug_privileges(dbg_class, dbg_lev, token);
talloc_free(mem_ctx);
}
diff --git a/libcli/security/security_token.h b/libcli/security/security_token.h
index 87978e2811..b8ca990035 100644
--- a/libcli/security/security_token.h
+++ b/libcli/security/security_token.h
@@ -37,7 +37,7 @@ struct security_token *security_token_initialise(TALLOC_CTX *mem_ctx);
/****************************************************************************
prints a struct security_token to debug output.
****************************************************************************/
-void security_token_debug(int dbg_lev, const struct security_token *token);
+void security_token_debug(int dbg_class, int dbg_lev, const struct security_token *token);
bool security_token_is_sid(const struct security_token *token, const struct dom_sid *sid);