diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-11-26 19:17:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:35 -0500 |
commit | ae4ffc1cfb745a756d047c35f947f80acf4b0e55 (patch) | |
tree | 6c87adecc1905520ac20d4131f9dc2400378fa75 | |
parent | 8e5bea3f84c61ea312278cbbb70542664be7bd14 (diff) | |
download | samba-ae4ffc1cfb745a756d047c35f947f80acf4b0e55.tar.gz |
r11917: Move nt_token_to_group_list to srv_netlog_nt.c. srv_util.c is empty now.
Volker
-rw-r--r-- | source/Makefile.in | 2 | ||||
-rw-r--r-- | source/rpc_server/srv_netlog_nt.c | 29 | ||||
-rw-r--r-- | source/rpc_server/srv_util.c | 29 |
3 files changed, 30 insertions, 30 deletions
diff --git a/source/Makefile.in b/source/Makefile.in index cca0715a3aa..26095f6d830 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -298,7 +298,7 @@ RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog.o rpc_server/srv_eventlog_nt.o rpc_server/srv_eventlog_lib.o -RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o rpc_server/srv_util.o \ +RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o \ rpc_server/srv_pipe.o rpc_server/srv_lsa_hnd.o RPC_ECHO_OBJ = rpc_server/srv_echo.o rpc_server/srv_echo_nt.o diff --git a/source/rpc_server/srv_netlog_nt.c b/source/rpc_server/srv_netlog_nt.c index 7903adff6d5..d0d47be9f29 100644 --- a/source/rpc_server/srv_netlog_nt.c +++ b/source/rpc_server/srv_netlog_nt.c @@ -584,6 +584,35 @@ NTSTATUS _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOF } +/******************************************************************* + gets a domain user's groups from their already-calculated NT_USER_TOKEN + ********************************************************************/ +static NTSTATUS nt_token_to_group_list(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, + const NT_USER_TOKEN *nt_token, + int *numgroups, DOM_GID **pgids) +{ + DOM_GID *gids; + int i; + + gids = TALLOC_ARRAY(mem_ctx, DOM_GID, nt_token->num_sids); + + if (!gids) { + return NT_STATUS_NO_MEMORY; + } + + *numgroups=0; + + for (i=PRIMARY_GROUP_SID_INDEX; i < nt_token->num_sids; i++) { + if (sid_compare_domain(domain_sid, &nt_token->user_sids[i])==0) { + sid_peek_rid(&nt_token->user_sids[i], &(gids[*numgroups].g_rid)); + gids[*numgroups].attr= (SE_GROUP_MANDATORY|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_ENABLED); + (*numgroups)++; + } + } + *pgids = gids; + return NT_STATUS_OK; +} + /************************************************************************* _net_sam_logon *************************************************************************/ diff --git a/source/rpc_server/srv_util.c b/source/rpc_server/srv_util.c index 3666d474787..924e08cc23a 100644 --- a/source/rpc_server/srv_util.c +++ b/source/rpc_server/srv_util.c @@ -81,32 +81,3 @@ static const rid_name domain_group_rids[] = }; #endif -/******************************************************************* - gets a domain user's groups from their already-calculated NT_USER_TOKEN - ********************************************************************/ -NTSTATUS nt_token_to_group_list(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, - const NT_USER_TOKEN *nt_token, - int *numgroups, DOM_GID **pgids) -{ - DOM_GID *gids; - int i; - - gids = TALLOC_ARRAY(mem_ctx, DOM_GID, nt_token->num_sids); - - if (!gids) { - return NT_STATUS_NO_MEMORY; - } - - *numgroups=0; - - for (i=PRIMARY_GROUP_SID_INDEX; i < nt_token->num_sids; i++) { - if (sid_compare_domain(domain_sid, &nt_token->user_sids[i])==0) { - sid_peek_rid(&nt_token->user_sids[i], &(gids[*numgroups].g_rid)); - gids[*numgroups].attr= (SE_GROUP_MANDATORY|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_ENABLED); - (*numgroups)++; - } - } - *pgids = gids; - return NT_STATUS_OK; -} - |