From: Timo Sirainen Date: Tue, 6 Jan 2015 01:15:11 +0000 (+0200) Subject: lib: Remove OpenBSD workaround in i_getpw*() X-Git-Tag: 2.2.16.rc1~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb655ad59813aa2b072ac9a228c840ee9a5c09cf;p=thirdparty%2Fdovecot%2Fcore.git lib: Remove OpenBSD workaround in i_getpw*() Originally added in 801714cba91b. It was requested to be removed now that 1) it's fixed in OpenBSD v5.6+ and 2) The workaround caused nonexistent users to not work correctly (process running out of memory I guess?) --- diff --git a/src/lib/ipwd.c b/src/lib/ipwd.c index e0cadb8724..560b01da3e 100644 --- a/src/lib/ipwd.c +++ b/src/lib/ipwd.c @@ -50,11 +50,6 @@ int i_getpwnam(const char *name, struct passwd *pwd_r) do { pw_init(); errno = getpwnam_r(name, pwd_r, pwbuf, pwbuf_size, &result); -#ifdef __OpenBSD__ - /* OpenBSD returns 1 for all errors, assume it's ERANGE */ - if (errno == 1) - errno = ERANGE; -#endif } while (errno == ERANGE); if (result != NULL) return 1; @@ -73,11 +68,6 @@ int i_getpwuid(uid_t uid, struct passwd *pwd_r) do { pw_init(); errno = getpwuid_r(uid, pwd_r, pwbuf, pwbuf_size, &result); -#ifdef __OpenBSD__ - /* OpenBSD returns 1 for all errors, assume it's ERANGE */ - if (errno == 1) - errno = ERANGE; -#endif } while (errno == ERANGE); if (result != NULL) return 1;