summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-07 12:15:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:21:53 -0500
commitd4799f5c7ade91e01d8d4967e58f423b0890aadd (patch)
tree24a47323e17deb278ffd0e63029651a2a3de030e
parentf79a4b85f291a46f64af97e1dcc2176a4eecd642 (diff)
downloadsamba-d4799f5c7ade91e01d8d4967e58f423b0890aadd.tar.gz
samba-d4799f5c7ade91e01d8d4967e58f423b0890aadd.tar.bz2
samba-d4799f5c7ade91e01d8d4967e58f423b0890aadd.zip
r22740: Move debug_*_user_token to token_utils.c
(This used to be commit 4ad9f8aa61cef94be8d38c6e91aac3a5c848f81f)
-rw-r--r--source3/auth/auth_util.c45
-rw-r--r--source3/auth/token_util.c49
2 files changed, 47 insertions, 47 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index db92c50df0..399cf3ad9e 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -430,51 +430,6 @@ BOOL make_user_info_guest(auth_usersupplied_info **user_info)
return NT_STATUS_IS_OK(nt_status) ? True : False;
}
-/****************************************************************************
- prints a NT_USER_TOKEN to debug output.
-****************************************************************************/
-
-void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token)
-{
- size_t i;
-
- if (!token) {
- DEBUGC(dbg_class, dbg_lev, ("NT user token: (NULL)\n"));
- return;
- }
-
- DEBUGC(dbg_class, dbg_lev,
- ("NT user token of user %s\n",
- sid_string_static(&token->user_sids[0]) ));
- DEBUGADDC(dbg_class, dbg_lev,
- ("contains %lu SIDs\n", (unsigned long)token->num_sids));
- for (i = 0; i < token->num_sids; i++)
- DEBUGADDC(dbg_class, dbg_lev,
- ("SID[%3lu]: %s\n", (unsigned long)i,
- sid_string_static(&token->user_sids[i])));
-
- dump_se_priv( dbg_class, dbg_lev, &token->privileges );
-}
-
-/****************************************************************************
- prints a UNIX 'token' to debug output.
-****************************************************************************/
-
-void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
- int n_groups, gid_t *groups)
-{
- int i;
- DEBUGC(dbg_class, dbg_lev,
- ("UNIX token of user %ld\n", (long int)uid));
-
- DEBUGADDC(dbg_class, dbg_lev,
- ("Primary group is %ld and contains %i supplementary "
- "groups\n", (long int)gid, n_groups));
- for (i = 0; i < n_groups; i++)
- DEBUGADDC(dbg_class, dbg_lev, ("Group[%3i]: %ld\n", i,
- (long int)groups[i]));
-}
-
static int server_info_dtor(auth_serversupplied_info *server_info)
{
TALLOC_FREE(server_info->sam_account);
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index 1eb9d12ab5..d68f44cbf1 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -147,8 +147,8 @@ NT_USER_TOKEN *get_root_nt_token( void )
* Add alias SIDs from memberships within the partially created token SID list
*/
-static NTSTATUS add_aliases(const DOM_SID *domain_sid,
- struct nt_user_token *token)
+NTSTATUS add_aliases(const DOM_SID *domain_sid,
+ struct nt_user_token *token)
{
uint32 *aliases;
size_t i, num_aliases;
@@ -455,4 +455,49 @@ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
return result;
}
+/****************************************************************************
+ prints a NT_USER_TOKEN to debug output.
+****************************************************************************/
+
+void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token)
+{
+ size_t i;
+
+ if (!token) {
+ DEBUGC(dbg_class, dbg_lev, ("NT user token: (NULL)\n"));
+ return;
+ }
+
+ DEBUGC(dbg_class, dbg_lev,
+ ("NT user token of user %s\n",
+ sid_string_static(&token->user_sids[0]) ));
+ DEBUGADDC(dbg_class, dbg_lev,
+ ("contains %lu SIDs\n", (unsigned long)token->num_sids));
+ for (i = 0; i < token->num_sids; i++)
+ DEBUGADDC(dbg_class, dbg_lev,
+ ("SID[%3lu]: %s\n", (unsigned long)i,
+ sid_string_static(&token->user_sids[i])));
+
+ dump_se_priv( dbg_class, dbg_lev, &token->privileges );
+}
+
+/****************************************************************************
+ prints a UNIX 'token' to debug output.
+****************************************************************************/
+
+void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
+ int n_groups, gid_t *groups)
+{
+ int i;
+ DEBUGC(dbg_class, dbg_lev,
+ ("UNIX token of user %ld\n", (long int)uid));
+
+ DEBUGADDC(dbg_class, dbg_lev,
+ ("Primary group is %ld and contains %i supplementary "
+ "groups\n", (long int)gid, n_groups));
+ for (i = 0; i < n_groups; i++)
+ DEBUGADDC(dbg_class, dbg_lev, ("Group[%3i]: %ld\n", i,
+ (long int)groups[i]));
+}
+
/* END */