From 84d40095e1d7ba5c66cabfd2d41012162d652970 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 8 Jun 2000 13:56:07 +0000 Subject: added a NET_USER_INFO_3 struct to user_struct. register_vuid fills it with constructed info. (This used to be commit b1889e4334012b1b2caa604b859da4271509fc87) --- source3/smbd/password.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'source3/smbd/password.c') diff --git a/source3/smbd/password.c b/source3/smbd/password.c index d3a728bf42..5815bbd164 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -214,7 +214,8 @@ has been given. vuid is biased by an offset. This allows us to tell random client vuid's (normally zero) from valid vuids. ****************************************************************************/ uint16 register_vuid(uid_t uid,gid_t gid, char *unix_name, char *requested_name, - char *domain,BOOL guest) + char *domain,BOOL guest, + NET_USER_INFO_3 *usr) { user_struct *vuser; struct passwd *pwfile; /* for getting real name from passwd file */ @@ -274,6 +275,38 @@ uint16 register_vuid(uid_t uid,gid_t gid, char *unix_name, char *requested_name, &vuser->n_groups, &vuser->groups); + if (usr == NULL) + { + int i; + extern DOM_SID global_sam_sid; + + DEBUG(0,("vuser struct usr being filled in with trash, today\n")); + DEBUG(0,("this needs to be replaced with a proper surs impl.\n")); + DEBUG(0,("e.g. the one used in winbindd. in fact, all\n")); + DEBUG(0,("occurrences of pdb_xxx_to_xxx should be replaced\n")); + DEBUG(0,("as soon as possible.\n")); + vuser->usr.user_id = pdb_uid_to_user_rid(uid); + vuser->usr.group_id = pdb_gid_to_group_rid(gid); + vuser->usr.num_groups = vuser->n_groups; + for (i = 0; i < vuser->usr.num_groups; i++) + { + DOM_GID *ntgid = &vuser->usr.gids[i]; + ntgid->attr = 0x7; + ntgid->g_rid = pdb_gid_to_group_rid(vuser->groups[i]); + } + + /* this is possibly the worst thing to do, ever. it assumes */ + /* that all users of this system are in the local SAM database */ + /* however, because there is no code to do anything otherwise, */ + /* we have no choice */ + + init_dom_sid2(&vuser->usr.dom_sid, &global_sam_sid); + } + else + { + vuser->usr = *usr; + } + DEBUG(3,("uid %d registered to name %s\n",(int)uid,unix_name)); DEBUG(3, ("Clearing default real name\n")); -- cgit