Fixup for accounts without a local /etc/passwd entry.
authorAndrew Bartlett <abartlet@samba.org>
Sun, 4 Nov 2001 01:10:21 +0000 (01:10 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 4 Nov 2001 01:10:21 +0000 (01:10 +0000)
 - Now perfectly valid.

source/passdb/pdb_tdb.c

index a6c40eb9706c9b6125cd242f8dc1238db710887e..3153b4733746d4ac8805463f475cc26a91071a79 100644 (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);