diff options
author | Andrew Bartlett <abartlet@samba.org> | 2001-11-04 01:10:21 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2001-11-04 01:10:21 +0000 |
commit | 971181179b8f5c1ffebcb3bb43a137677aa4124a (patch) | |
tree | 183b0b3944fe384813b626c770745719116b676d /source3/passdb | |
parent | 8ae815e31eb1034344448325a72721062f35046d (diff) | |
download | samba-971181179b8f5c1ffebcb3bb43a137677aa4124a.tar.gz samba-971181179b8f5c1ffebcb3bb43a137677aa4124a.tar.bz2 samba-971181179b8f5c1ffebcb3bb43a137677aa4124a.zip |
Fixup for accounts without a local /etc/passwd entry.
- Now perfectly valid.
(This used to be commit be04aad90da341fb1b4ef472f2279aefab972258)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/pdb_tdb.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index a6c40eb970..3153b47337 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -530,17 +530,13 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, const char *sname) /* validate the account and fill in UNIX uid and gid. sys_getpwnam() is used instaed of Get_Pwnam() as we do not need to try case permutations */ - if ((pw=sys_getpwnam(pdb_get_username(user))) == NULL) { - DEBUG(0,("pdb_getsampwent: getpwnam(%s) return NULL. User does not exist!\n", - pdb_get_username(user))); - return False; + if ((pw=sys_getpwnam(pdb_get_username(user)))) { + uid = pw->pw_uid; + gid = pw->pw_gid; + pdb_set_uid (user, &uid); + pdb_set_gid (user, &gid); } - uid = pw->pw_uid; - gid = pw->pw_gid; - pdb_set_uid (user, &uid); - pdb_set_gid (user, &gid); - /* cleanup */ tdb_close (pwd_tdb); |