]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
merge from 2.2
authorGerald Carter <jerry@samba.org>
Thu, 23 Aug 2001 22:58:00 +0000 (22:58 +0000)
committerGerald Carter <jerry@samba.org>
Thu, 23 Aug 2001 22:58:00 +0000 (22:58 +0000)
(This used to be commit 97b5499def99016b4baf97343597f1b218a69399)

source3/passdb/pdb_smbpasswd.c

index 942c232ae81747cdf72ce39bf53ecf5cb34f9557..1ef2995d71cc9a8ccfe5734e478f1c184cd2b069 100644 (file)
@@ -1297,6 +1297,7 @@ void pdb_endsampwent (void)
 BOOL pdb_getsampwent(SAM_ACCOUNT *user)
 {
        struct smb_passwd *pw_buf=NULL;
+       BOOL done = False;
 
        DEBUG(5,("pdb_getsampwent\n"));
 
@@ -1313,9 +1314,19 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user)
        if (pw_buf == NULL) 
                return False;
 
-       /* build the SAM_ACCOUNT entry from the smb_passwd struct. */
-       if (!build_sam_account(user, pw_buf))
-               return False;
+       while (!done)
+       {
+               /* do we have an entry? */
+               pw_buf = getsmbfilepwent(global_vp);
+               if (pw_buf == NULL) 
+                       return False;
+
+               /* build the SAM_ACCOUNT entry from the smb_passwd struct. 
+                  We loop in case the user in the pdb does not exist in 
+                  the local system password file */
+               if (build_sam_account(user, pw_buf))
+                       done = True;
+       }
 
        DEBUG(5,("pdb_getsampwent:done\n"));