dovecot-2.2: i_getpwnam(): Ignore EINVAL errors silently.

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 17:55:53 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/9dcc44d8275d
changeset: 15281:9dcc44d8275d
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Sep 26 21:14:23 2012 +0300
description:
i_getpwnam(): Ignore EINVAL errors silently.
At least FreeBSD returns it when attempting to lookup user at domain.

diffstat:

 src/lib/ipwd.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r 4e431b202cfd -r 9dcc44d8275d src/lib/ipwd.c
--- a/src/lib/ipwd.c	Wed Sep 26 21:12:37 2012 +0300
+++ b/src/lib/ipwd.c	Wed Sep 26 21:14:23 2012 +0300
@@ -58,6 +58,10 @@
 	errno = getpwnam_r(name, pwd_r, pwbuf, pwbuf_size, &result);
 	if (result != NULL)
 		return 1;
+	if (errno == EINVAL) {
+		/* FreeBSD fails here when name="user at domain" */
+		return 0;
+	}
 	return errno == 0 ? 0 : -1;
 }
 


More information about the dovecot-cvs mailing list