diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2001-07-02 11:56:22 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2001-07-02 11:56:22 +0000 |
commit | 2832078a28a7fc77bd4547966e996b5e9143f820 (patch) | |
tree | b0e4c93ea71d95a4cc1faa3df39397305c693d02 /user | |
parent | 05ed6d5105a381d9fb6825dd818a93a5d11c7195 (diff) | |
download | libapr-2832078a28a7fc77bd4547966e996b5e9143f820.tar.gz |
Handle the weird case where getpwnam() returns NULL but errno is zero.
This led to a segfault on apache.org when apache did a home directory
lookup on an invalid user name. This isn't cool on the part of libc,
but oh well.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61853 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'user')
-rw-r--r-- | user/unix/userinfo.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/user/unix/userinfo.c b/user/unix/userinfo.c index ac0b386fb..aa062f442 100644 --- a/user/unix/userinfo.c +++ b/user/unix/userinfo.c @@ -74,6 +74,10 @@ static apr_status_t getpwnam_safe(const char *username, #else if ((*pw = getpwnam(username)) == NULL) { #endif + if (errno == 0) { + /* this can happen with getpwnam() on FreeBSD 4.3 */ + return APR_EGENERAL; + } return errno; } return APR_SUCCESS; |