1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00

Fixup for accounts without a local /etc/passwd entry.

- Now perfectly valid.
(This used to be commit be04aad90da341fb1b4ef472f2279aefab972258)
This commit is contained in:
Andrew Bartlett 2001-11-04 01:10:21 +00:00
parent 8ae815e31e
commit 971181179b

View File

@ -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);