]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Remove OpenBSD workaround in i_getpw*()
authorTimo Sirainen <tss@iki.fi>
Tue, 6 Jan 2015 01:15:11 +0000 (03:15 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 6 Jan 2015 01:15:11 +0000 (03:15 +0200)
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?)

src/lib/ipwd.c

index e0cadb872445b28a92552c3360609bc0450f942d..560b01da3e5383bf2093126cbd8b025171548c58 100644 (file)
@@ -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;