summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-11-30 22:42:13 +0000
committerLuke Leighton <lkcl@samba.org>1998-11-30 22:42:13 +0000
commitc6ad04b8fb4ee5cbf862a35b4c143a6f75555718 (patch)
tree1440c27af960d14067e46535959a0906deeed333 /source3/passdb
parent279923efd357059c463544fb469851ecbc0d1133 (diff)
downloadsamba-c6ad04b8fb4ee5cbf862a35b4c143a6f75555718.tar.gz
samba-c6ad04b8fb4ee5cbf862a35b4c143a6f75555718.tar.bz2
samba-c6ad04b8fb4ee5cbf862a35b4c143a6f75555718.zip
attempting to fix "domain user map" up, but it's a bit complicated.
i may simply go for a response in the NetSamLogon returning the unix username, forcing the NT user to appear to be a unix user, however even that is fraught with implications. might just have to go the whole hog and do this tuple thing, "unix_name + nt_name" always associated together... issue with api_net_sam_logon, getsam21pwent() being called twice, the second time overwriting static buffer data (argh) so had to make a copy. noticed a nested "become_root()"/"unbecome_root()" which will have to be tracked down... (This used to be commit 474f94f419a531e33b475249da7efb99ac22f454)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/sampassdb.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source3/passdb/sampassdb.c b/source3/passdb/sampassdb.c
index 95055ed298..bcd2764abc 100644
--- a/source3/passdb/sampassdb.c
+++ b/source3/passdb/sampassdb.c
@@ -126,12 +126,15 @@ struct sam_passwd *getsam21pwent(void *vp)
does not have search facilities.
*************************************************************************/
-struct sam_passwd *iterate_getsam21pwntnam(const char *name)
+struct sam_passwd *iterate_getsam21pwntnam(const char *ntname)
{
+ fstring nt_name;
struct sam_passwd *pwd = NULL;
void *fp = NULL;
- DEBUG(10, ("search by name: %s\n", name));
+ DEBUG(10, ("search by name: %s\n", ntname));
+
+ fstrcpy(nt_name, ntname);
/* Open the smb password database - not for update. */
fp = startsmbpwent(False);
@@ -142,14 +145,14 @@ struct sam_passwd *iterate_getsam21pwntnam(const char *name)
return NULL;
}
- while ((pwd = getsam21pwent(fp)) != NULL && !strequal(pwd->nt_name, name))
+ while ((pwd = getsam21pwent(fp)) != NULL && !strequal(pwd->nt_name, nt_name))
{
DEBUG(10, ("iterate: %s 0x%x\n", pwd->nt_name, pwd->user_rid));
}
if (pwd != NULL)
{
- DEBUG(10, ("found by name: %s\n", name));
+ DEBUG(10, ("found by name: %s\n", nt_name));
}
endsmbpwent(fp);
@@ -436,6 +439,9 @@ struct sam_passwd *pwdb_sam_map_names(struct sam_passwd *sam)
if (sam->unix_uid == (uid_t)-1 ) sam->unix_uid = (uid_t)gmep.unix_id;
if (sam->user_rid == 0xffffffff) sid_split_rid(&gmep.sid, &sam->user_rid);
+ DEBUG(10,("pwdb_sam_map_name: found unix user %s nt %s uid %d rid 0x%x\n",
+ sam->unix_name, sam->nt_name, sam->unix_uid, sam->user_rid));
+
/*
* group details
*/
@@ -511,5 +517,8 @@ you will get this warning only once (for all trust accounts)\n", unix_name));
if (sam->unix_gid == (gid_t)-1 ) sam->unix_gid = (gid_t)gmep.unix_id;
if (sam->group_rid == 0xffffffff) sid_split_rid(&gmep.sid, &sam->group_rid);
+ DEBUG(10,("pwdb_sam_map_name: found gid %d and group rid 0x%x for unix user %s\n",
+ sam->unix_gid, sam->group_rid, sam->unix_name));
+
return sam;
}