apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r219635 - in /apr/apr/trunk: CHANGES user/unix/groupinfo.c user/unix/userinfo.c
Date Tue, 19 Jul 2005 09:38:49 GMT
Author: pquerna
Date: Tue Jul 19 02:38:36 2005
New Revision: 219635

URL: http://svn.apache.org/viewcvs?rev=219635&view=rev
Log:
These functions can return no-error, but still contain a NULL entry, on some crazy unix that
some people use called Linux.

PR: 34053

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/user/unix/groupinfo.c
    apr/apr/trunk/user/unix/userinfo.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/CHANGES?rev=219635&r1=219634&r2=219635&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES (original)
+++ apr/apr/trunk/CHANGES Tue Jul 19 02:38:36 2005
@@ -1,5 +1,8 @@
 Changes for APR 1.2.0
 
+  *) If getpwuid_r or getgrgid_r set their results to NULL, it is an error.
+     PR 34053. [Paul Querna]
+
   *) Switch to lazy initialization of the pollset that's used within
      apr_file_t on platforms where apr_wait_for_io_or_timeout() doesn't
      use poll(2).  (This fixes a performance problem observed in httpd-2.x

Modified: apr/apr/trunk/user/unix/groupinfo.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/user/unix/groupinfo.c?rev=219635&r1=219634&r2=219635&view=diff
==============================================================================
--- apr/apr/trunk/user/unix/groupinfo.c (original)
+++ apr/apr/trunk/user/unix/groupinfo.c Tue Jul 19 02:38:36 2005
@@ -37,7 +37,7 @@
     struct group grp;
     char grbuf[512];
 
-    if (getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr)) {
+    if (getgrgid_r(groupid, &grp, grbuf, sizeof(grbuf), &gr) || gr == NULL) {
 #else
     if ((gr = getgrgid(groupid)) == NULL) {
 #endif

Modified: apr/apr/trunk/user/unix/userinfo.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/user/unix/userinfo.c?rev=219635&r1=219634&r2=219635&view=diff
==============================================================================
--- apr/apr/trunk/user/unix/userinfo.c (original)
+++ apr/apr/trunk/user/unix/userinfo.c Tue Jul 19 02:38:36 2005
@@ -115,7 +115,7 @@
     struct passwd pwd;
     char pwbuf[PWBUF_SIZE];
 
-    if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw)) {
+    if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw) || pw == NULL) {
 #else
     if ((pw = getpwuid(userid)) == NULL) {
 #endif



Mime
View raw message