summaryrefslogtreecommitdiff
path: root/source3/smbd/uid.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-02-08 07:17:30 +0000
committerAndrew Bartlett <abartlet@samba.org>2004-02-08 07:17:30 +0000
commitae2c8656b22ca855aaf1ab7382a92996b362a900 (patch)
treebe379d137caab5c2673c10ec32acb7aeaa437470 /source3/smbd/uid.c
parenta69cb9c9639dc06a0be16958cbc29867b71f584e (diff)
downloadsamba-ae2c8656b22ca855aaf1ab7382a92996b362a900.tar.gz
samba-ae2c8656b22ca855aaf1ab7382a92996b362a900.tar.bz2
samba-ae2c8656b22ca855aaf1ab7382a92996b362a900.zip
Samba hasn't used this function for ages - it's now handled deep in the
auth subsystem. Andrew Bartlett (This used to be commit 5693730594b1a861c7916cac7d156cf6a9d913cd)
Diffstat (limited to 'source3/smbd/uid.c')
-rw-r--r--source3/smbd/uid.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index 7979ffe854..09cf899522 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -369,72 +369,3 @@ BOOL unbecome_user(void)
return True;
}
-/*****************************************************************
- Convert the supplementary SIDs returned in a netlogon into UNIX
- group gid_t's. Add to the total group array.
-*****************************************************************/
-
-void add_supplementary_nt_login_groups(int *n_groups, gid_t **pp_groups, NT_USER_TOKEN **pptok)
-{
- int total_groups;
- int current_n_groups = *n_groups;
- gid_t *final_groups = NULL;
- size_t i;
- NT_USER_TOKEN *ptok = *pptok;
- NT_USER_TOKEN *new_tok = NULL;
-
- if (!ptok || (ptok->num_sids == 0))
- return;
-
- new_tok = dup_nt_token(ptok);
- if (!new_tok) {
- DEBUG(0,("add_supplementary_nt_login_groups: Failed to malloc new token\n"));
- return;
- }
- /* Leave the allocated space but empty the number of SIDs. */
- new_tok->num_sids = 0;
-
- total_groups = current_n_groups + ptok->num_sids;
-
- final_groups = (gid_t *)malloc(total_groups * sizeof(gid_t));
- if (!final_groups) {
- DEBUG(0,("add_supplementary_nt_login_groups: Failed to malloc new groups.\n"));
- delete_nt_token(&new_tok);
- return;
- }
-
- memcpy(final_groups, *pp_groups, current_n_groups * sizeof(gid_t));
- for (i = 0; i < ptok->num_sids; i++) {
- gid_t new_grp;
-
- if (NT_STATUS_IS_OK(sid_to_gid(&ptok->user_sids[i], &new_grp))) {
- /*
- * Don't add the gid_t if it is already in the current group
- * list. Some UNIXen don't like the same group more than once.
- */
- int j;
-
- for (j = 0; j < current_n_groups; j++)
- if (final_groups[j] == new_grp)
- break;
-
- if ( j == current_n_groups) {
- /* Group not already present. */
- final_groups[current_n_groups++] = new_grp;
- }
- } else {
- /* SID didn't map. Copy to the new token to be saved. */
- sid_copy(&new_tok->user_sids[new_tok->num_sids++], &ptok->user_sids[i]);
- }
- }
-
- SAFE_FREE(*pp_groups);
- *pp_groups = final_groups;
- *n_groups = current_n_groups;
-
- /* Replace the old token with the truncated one. */
- delete_nt_token(&ptok);
- *pptok = new_tok;
-}
-
-