summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-06-08 17:50:19 +0000
committerJeremy Allison <jra@samba.org>2000-06-08 17:50:19 +0000
commit28555ec92e061aafb31a9b071caf00e44132c70f (patch)
treed83686ff0f944834ce7dfb258d6fdcbdf6d3b264 /source3/passdb
parentce17aace9944541f430645c373025ad98dded75d (diff)
downloadsamba-28555ec92e061aafb31a9b071caf00e44132c70f.tar.gz
samba-28555ec92e061aafb31a9b071caf00e44132c70f.tar.bz2
samba-28555ec92e061aafb31a9b071caf00e44132c70f.zip
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)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c29
1 files changed, 29 insertions, 0 deletions
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;
+}