summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2001-08-23 22:56:40 +0000
committerGerald Carter <jerry@samba.org>2001-08-23 22:56:40 +0000
commit79d483b40e3166fefd3e3d63bcc6001642085735 (patch)
tree5ea1e20ce5b4d42ca64a00e10cad6be0a529e415
parenta58f8ff5ec4e20836bef7956619600c4579079e6 (diff)
downloadsamba-79d483b40e3166fefd3e3d63bcc6001642085735.tar.gz
samba-79d483b40e3166fefd3e3d63bcc6001642085735.tar.xz
samba-79d483b40e3166fefd3e3d63bcc6001642085735.zip
fixed bug that would cause a user list enumeration to exit early.
Caused by a users being in smbpasswd but not /etc/passwd
-rw-r--r--source/passdb/pdb_smbpasswd.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source/passdb/pdb_smbpasswd.c b/source/passdb/pdb_smbpasswd.c
index 47bdceff548..2683ac4ea36 100644
--- a/source/passdb/pdb_smbpasswd.c
+++ b/source/passdb/pdb_smbpasswd.c
@@ -1293,7 +1293,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"));
if (user==NULL) {
@@ -1304,14 +1304,19 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user)
return False;
}
- /* 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. */
- 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"));