diff options
Diffstat (limited to 'user/unix/userinfo.c')
-rw-r--r-- | user/unix/userinfo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index 603e4fa68..1455c8f5e 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -76,7 +76,8 @@ static apr_status_t getpwnam_safe(const char *username, { struct passwd *pwptr; #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWNAM_R) - if (!getpwnam_r(username, pw, pwbuf, PWBUF_SIZE, &pwptr)) { + /* IRIX getpwnam_r() returns 0 and sets pwptr to NULL on failure */ + if (!getpwnam_r(username, pw, pwbuf, PWBUF_SIZE, &pwptr) && pwptr) { /* nothing extra to do on success */ #else if ((pwptr = getpwnam(username)) != NULL) { |