diff options
author | Joe Orton <jorton@apache.org> | 2004-03-10 21:51:10 +0100 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2004-03-10 21:51:10 +0100 |
commit | 7d90e82bac96289f968633a29566c61dcc2bb6fb (patch) | |
tree | 1c40bb2560af6bb768838c4d7202a41a815ed854 /modules | |
parent | Win32: Tweak worker thread accounting to fix hang when number of Listen direc... (diff) | |
download | apache2-7d90e82bac96289f968633a29566c61dcc2bb6fb.tar.xz apache2-7d90e82bac96289f968633a29566c61dcc2bb6fb.zip |
* modules/standard/mod_autoindex.c (index_directory): If stat() fails
for a particular dirent, ignore that entry rather than truncating the
directory listing.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102924 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r-- | modules/generators/mod_autoindex.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index 6ddf50d15e..50854a4dae 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -2126,8 +2126,16 @@ static int index_directory(request_rec *r, 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 @@ static int index_directory(request_rec *r, head = p; num_ent++; } - } + } while (1); + if (num_ent > 0) { ar = (struct ent **) apr_palloc(r->pool, num_ent * sizeof(struct ent *)); |