apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/user/unix userinfo.c
Date Mon, 02 Jul 2001 11:56:24 GMT
trawick     01/07/02 04:56:23

  Modified:    .        CHANGES
               user/unix userinfo.c
  Log:
  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.
  
  Revision  Changes    Path
  1.117     +3 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- CHANGES	2001/06/27 19:40:29	1.116
  +++ CHANGES	2001/07/02 11:56:19	1.117
  @@ -1,5 +1,8 @@
   Changes with APR b1  
   
  +  *) Handle the weird case where getpwnam() returns NULL but errno is zero.
  +     [Jeff Trawick]
  +
     *) Add apr_file_flags_get() which returns the flags that were originally
        passed in to apr_file_open().  [Cliff Woolley]
   
  
  
  
  1.12      +4 -0      apr/user/unix/userinfo.c
  
  Index: userinfo.c
  ===================================================================
  RCS file: /home/cvs/apr/user/unix/userinfo.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- userinfo.c	2001/03/08 16:05:12	1.11
  +++ userinfo.c	2001/07/02 11:56:22	1.12
  @@ -74,6 +74,10 @@
   #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;
  
  
  

Mime
View raw message