httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: httpd-2.0/modules/generators mod_autoindex.c
Date Wed, 10 Mar 2004 20:51:10 GMT
jorton      2004/03/10 12:51:10

  Modified:    modules/generators mod_autoindex.c
  Log:
  * modules/standard/mod_autoindex.c (index_directory): If stat() fails
  for a particular dirent, ignore that entry rather than truncating the
  directory listing.
  
  Revision  Changes    Path
  1.133     +12 -3     httpd-2.0/modules/generators/mod_autoindex.c
  
  Index: mod_autoindex.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_autoindex.c,v
  retrieving revision 1.132
  retrieving revision 1.133
  diff -w -d -u -r1.132 -r1.133
  --- mod_autoindex.c	9 Feb 2004 20:29:19 -0000	1.132
  +++ mod_autoindex.c	10 Mar 2004 20:51:10 -0000	1.133
  @@ -2126,8 +2126,16 @@
       fullpath = apr_palloc(r->pool, APR_PATH_MAX);
       dirpathlen = strlen(name);
       memcpy(fullpath, name, dirpathlen);
  -    while (apr_dir_read(&dirent, APR_FINFO_MIN | APR_FINFO_NAME,
  -                        thedir) == APR_SUCCESS) {
  +
  +    do {
  +        status = apr_dir_read(&dirent, APR_FINFO_MIN | APR_FINFO_NAME, thedir);
  +        if (APR_STATUS_IS_INCOMPLETE(status)) {
  +            continue; /* ignore un-stat()able files */
  +        }
  +        else if (status != APR_SUCCESS) {
  +            break;
  +        }
  +
           /* We want to explode symlinks here. */
           if (dirent.filetype == APR_LNK) {
               const char *savename;
  @@ -2153,7 +2161,8 @@
               head = p;
               num_ent++;
           }
  -    }
  +    } while (1);
  +
       if (num_ent > 0) {
           ar = (struct ent **) apr_palloc(r->pool,
                                           num_ent * sizeof(struct ent *));
  
  
  

Mime
View raw message