summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEray Aslan <eras@gentoo.org>2018-10-11 13:56:52 +0300
committerEray Aslan <eras@gentoo.org>2018-10-11 13:56:52 +0300
commit5261930a4d34c3cd4fdf31fc319e423958a875cc (patch)
treeac0ddbc1aebbd96d4e435c6c26bcc12b02e6ac00 /net-mail/dovecot/files
parentsys-fs/lvm2: Removed old. (diff)
downloadgentoo-5261930a4d34c3cd4fdf31fc319e423958a875cc.tar.gz
gentoo-5261930a4d34c3cd4fdf31fc319e423958a875cc.tar.bz2
gentoo-5261930a4d34c3cd4fdf31fc319e423958a875cc.zip
net-mail/dovecot: fix userdb-passwd errno
In https://bugs.gentoo.org/667118 Reuben Farrelly noticed that running # doveadm user '*' causes auth daemon to generate errors like: auth-worker(3585): Error: getpwent() failed: Invalid argument This happens because on successful call getpwent() now sets errno=EINVAL starting from glibc-2.28. See https://sourceware.org/PR16004 for details. The fix is to check 'errno' only when 'getpwent()' fails. Reported-by: Reuben Farrelly Bug: https://bugs.gentoo.org/667118 Bug: https://sourceware.org/PR16004 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Eray Aslan <eras@gentoo.org> Package-Manager: Portage-2.3.51, Repoman-2.3.11
Diffstat (limited to 'net-mail/dovecot/files')
-rw-r--r--net-mail/dovecot/files/dovecot-userdb-passwd-fix.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/net-mail/dovecot/files/dovecot-userdb-passwd-fix.patch b/net-mail/dovecot/files/dovecot-userdb-passwd-fix.patch
new file mode 100644
index 000000000000..d5bff016394e
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-userdb-passwd-fix.patch
@@ -0,0 +1,18 @@
+diff --git a/src/auth/userdb-passwd.c b/src/auth/userdb-passwd.c
+index 03cbd554ff..699db314ce 100644
+--- a/src/auth/userdb-passwd.c
++++ b/src/auth/userdb-passwd.c
+@@ -172,8 +172,11 @@ static void passwd_iterate_next(struct userdb_iterate_context *_ctx)
+ return;
+ }
+
+- errno = 0;
+- while ((pw = getpwent()) != NULL) {
++ for (;;) {
++ errno = 0;
++ pw = getpwent();
++ if (pw == NULL)
++ break;
+ if (passwd_iterate_want_pw(pw, set)) {
+ _ctx->callback(pw->pw_name, _ctx->context);
+ return;