diff options
author | Jeremy Allison <jra@samba.org> | 2000-06-09 18:45:31 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-06-09 18:45:31 +0000 |
commit | 03e0164270ffd7ceeb8df6f3cc3917c111dc05f8 (patch) | |
tree | 1a12467cace2c98d4fc037e6acbed783bceb24c8 /source3/passdb | |
parent | e58682eb077a79b5c54a0cea485b7d134a01f853 (diff) | |
download | samba-03e0164270ffd7ceeb8df6f3cc3917c111dc05f8.tar.gz samba-03e0164270ffd7ceeb8df6f3cc3917c111dc05f8.tar.bz2 samba-03e0164270ffd7ceeb8df6f3cc3917c111dc05f8.zip |
Luke, I am moving the code back into passdb/passdb.c, this the correct
place to do this, not in smbd/passwd.c
Please don't change this without asking first, I have run this past
Andrew so talk to him (I'm on vacation next week).
I also removed the g_newXXX macros. There are essentially a private C extension,
not used anywhere else in the code, and add no functionality over malloc(XX)
and make the code harder to understand (everyone knows what malloc does).
Jeremy.
(This used to be commit e1b1b6fb6794ba02e1fea510a981fa0ce0d12b58)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/passdb.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 957ba06874..6556503dca 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -1214,7 +1214,6 @@ BOOL lookup_local_name(char *domain, char *user, DOM_SID *psid, uint8 *psid_name return True; } -#if 0 /**************************************************************************** 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. @@ -1242,5 +1241,45 @@ BOOL setup_user_sids(user_struct *vuser) } return True; -} +#if 0 + /* Luke's code. */ + 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; + if (vuser->n_groups != 0) + { + vuser->usr.gids = g_new(DOM_GID, vuser->usr.num_groups); + if (vuser->usr.gids == NULL) + return UID_FIELD_INVALID; + } + + 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; + } #endif +} |