diff options
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 +} |