diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2002-07-01 16:44:10 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2002-07-01 16:44:10 +0000 |
commit | d5e957c9a3b6c9181b9071774502ac760a60eda9 (patch) | |
tree | 4d60591fe9ec7af21f088aafb23a2a4bb5d06e4c /user | |
parent | 93d3c68935c3cf322022094bd41fd6d145e07029 (diff) | |
download | libapr-d5e957c9a3b6c9181b9071774502ac760a60eda9.tar.gz |
Fix the userid functions on Irix to handle the way that Irix
reports a failure from getpwnam_r().
PR: 10095
Submitted by: Robert I. Cowles <ric@cs.uregina.ca>, Jeff Trawick
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63543 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'user')
-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) { |