Heiko Schlittermann
2021-Feb-25 09:36 UTC
doveadm user '*' vs sssd: enumeration works only once
Heiko Schlittermann <hs at schlittermann.de> (Do 25 Feb 2021 10:08:05 CET):> > doveadm user * > > returns the full user list only once. A 2nd invocation of the same command > within a small timeframe returns a subset of the local users only (theThe following Perl script can reproduce the behaviour: #!/usr/bin/perl use strict; use warnings; use feature 'say'; sub count { my $n; setpwent() or die("setpwent"); $n++ while getpwent(); # endpwent(); return $n; } say count(); say count(); If I miss the endpwent(), the first count retuns 400+ users, but the second one only about 30 (which matches the lines I've in the /etc/passwd file). If I use the endpwent(), I always get 400+ users. Su, I suspect, the unfortunate behaviour is on the dovecot side (in the auth processes) What do you think? Best regards from Dresden/Germany Viele Gr??e aus Dresden Heiko Schlittermann -- SCHLITTERMANN.de ---------------------------- internet & unix support - Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} - gnupg encrypted messages are welcome --------------- key ID: F69376CE - -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: <https://dovecot.org/pipermail/dovecot/attachments/20210225/4af5faf2/attachment.sig>
Heiko Schlittermann
2021-Feb-25 09:41 UTC
doveadm user '*' vs sssd: enumeration works only once
Heiko Schlittermann <hs at schlittermann.de> (Do 25 Feb 2021 10:36:21 CET):> > within a small timeframe returns a subset of the local users only (the > say count();I suppose the following would fix the issue: (not tested yet) diff --git a/src/auth/userdb-passwd.c b/src/auth/userdb-passwd.c index 70b9969f6..4682dc873 100644 --- a/src/auth/userdb-passwd.c +++ b/src/auth/userdb-passwd.c @@ -208,6 +208,7 @@ static int passwd_iterate_deinit(struct userdb_iterate_context *_ctx) cur_userdb_iter_to = timeout_add(0, passwd_iterate_next_timeout, NULL); } + endpwent(); return ret; } -- Heiko -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: <https://dovecot.org/pipermail/dovecot/attachments/20210225/2d0a2365/attachment.sig>