]> granicus.if.org Git - apache/commitdiff
* If APR_FINFO_NAME is added to the list of wanted information, apr_stat
authorRuediger Pluem <rpluem@apache.org>
Sat, 30 Dec 2006 20:07:14 +0000 (20:07 +0000)
committerRuediger Pluem <rpluem@apache.org>
Sat, 30 Dec 2006 20:07:14 +0000 (20:07 +0000)
  always returns APR_INCOMPLETE on Unix platforms in the case that the
  call to the native stat / lstat did not fail. So we can safely assume
  that the stat / lstat call has been successful in this case.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@491297 13f79535-47bb-0310-9956-ffa450edef68

server/request.c

index 03493e32d38ba90a8c76c1d4848fba9a415d7350..34ffbafb4e105c3a4f5f00eed973f01b91eea8ba 100644 (file)
@@ -556,7 +556,14 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
                 rv = apr_stat(&thisinfo, r->filename,
                               APR_FINFO_MIN | APR_FINFO_NAME | APR_FINFO_LINK,
                               r->pool);
-                if (rv != APR_SUCCESS) {
+                /*
+                 * APR_INCOMPLETE is as fine as result as APR_SUCCESS as we
+                 * have added APR_FINFO_NAME to the wanted parameter of
+                 * apr_stat above. On Unix platforms this means that apr_stat
+                 * is always going to return APR_INCOMPLETE in the case that
+                 * the call to the native stat / lstat did not fail.
+                 */
+                if ((rv != APR_INCOMPLETE) && (rv != APR_SUCCESS)) {
                     /*
                      * This should never happen, because we did a stat on the
                      * same file, resolving a possible symlink several lines