From 28555ec92e061aafb31a9b071caf00e44132c70f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 Jun 2000 17:50:19 +0000 Subject: include/smb.h: Removed NET_USER_3 struct from user struct. It doesn't belong there (yet) as there is no infrastructure for it. Replaced it with a dynamic array of group SIDs plus a user. passdb/passdb.c: Added setup_user_sids() function. This is where the lookup should be done, eventually calling winbind. smbd/password.c: Changed to call setup_user_sids(). Removed spurious DEBUG(0) statements. smbd/reply.c: Removed extra parameter to register_vuid(). Jeremy. (This used to be commit 425f4ad9a5e0e7d49620276100ade7a0cae47011) --- source3/passdb/passdb.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source3/passdb/passdb.c') diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index bb7bbcaa01..12c6e1ca4e 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -1213,3 +1213,32 @@ BOOL lookup_local_name(char *domain, char *user, DOM_SID *psid, uint8 *psid_name return True; } + +/**************************************************************************** + Create a list of SIDS for a user - primary and group. + This is really the wrong way to do this and needs to go via winbind. JRA. +****************************************************************************/ + +BOOL setup_user_sids(user_struct *vuser) +{ + extern DOM_SID global_sam_sid; + + sid_copy(&vuser->user_sid, &global_sam_sid); + sid_append_rid( &vuser->user_sid, pdb_uid_to_user_rid(vuser->uid)); + + if (vuser->n_groups != 0) { + int i; + + vuser->group_sids = (DOM_SID *)malloc(sizeof(DOM_SID) * vuser->n_groups); + + if (vuser->group_sids == NULL) + return False; + + for (i = 0; i < vuser->n_groups; i++) { + sid_copy(&vuser->group_sids[i], &global_sam_sid); + sid_append_rid( &vuser->group_sids[i], pdb_gid_to_group_rid(vuser->groups[i])); + } + } + + return True; +} -- cgit