summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2002-07-01 16:44:10 +0000
committerJeff Trawick <trawick@apache.org>2002-07-01 16:44:10 +0000
commit2cc8a13cc1020aaf77ae3291b9be6cccbdf2367f (patch)
tree4d60591fe9ec7af21f088aafb23a2a4bb5d06e4c /user
parent330a4389798461ebdc58cb68ba95f53e71aa9596 (diff)
downloadapr-2cc8a13cc1020aaf77ae3291b9be6cccbdf2367f.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: https://svn.apache.org/repos/asf/apr/apr/trunk@63543 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'user')
-rw-r--r--user/unix/userinfo.c3
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) {