]> granicus.if.org Git - apache/commitdiff
The changes required for the APR_FINFO_wanted argument to
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 20 Jan 2001 21:42:23 +0000 (21:42 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 20 Jan 2001 21:42:23 +0000 (21:42 +0000)
  apr_stat/lstat/getfileinfo.  These are -NOT- optimal, they
  are simply the required changes to get the server working.
  The size of the patch is a warning about how we need to
  really look at what we are trying to accomplish with all
  of these stat/lstat calls.

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

27 files changed:
modules/arch/win32/mod_isapi.c
modules/cache/mod_file_cache.c
modules/dav/fs/lock.c
modules/dav/fs/repos.c
modules/filters/mod_include.c
modules/generators/mod_cgi.c
modules/http/http_request.c
modules/mappers/mod_negotiation.c
modules/mappers/mod_rewrite.c
modules/mappers/mod_userdir.c
modules/proxy/proxy_util.c
os/unix/unixd.c
os/win32/mod_isapi.c
server/config.c
server/log.c
server/mpm/beos/beos.c
server/mpm/dexter/dexter.c
server/mpm/experimental/perchild/perchild.c
server/mpm/mpmt_beos/mpmt_beos.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/perchild/perchild.c
server/mpm/prefork/prefork.c
server/mpm/spmt_os2/spmt_os2.c
server/mpm/winnt/mpm_winnt.c
server/util.c
support/ab.c
support/htpasswd.c

index 543fff835f0e2ef8d7b5bed40ec5b183c11ec1c1..b2a551b33ab73058633e885a41fd511e71b71738 100644 (file)
@@ -1238,7 +1238,8 @@ static const char *isapi_cmd_cachefile(cmd_parms *cmd, void *dummy,
     char *fspec;
     
     fspec = ap_os_case_canonical_filename(cmd->pool, filename);
-    if (apr_stat(&tmp, fspec, cmd->temp_pool) != APR_SUCCESS) { 
+    if (apr_stat(&tmp, fspec, 
+                 APR_FINFO_NORM, cmd->temp_pool) != APR_SUCCESS) { 
        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
            "ISAPI: unable to stat(%s), skipping", filename);
        return NULL;
index ed78b65473ecda2601886e7ade113e357aec901e..cb815d82a2a5c28459d54e9cef831de3024f4105 100644 (file)
@@ -157,39 +157,6 @@ static void *create_server_config(apr_pool_t *p, server_rec *s)
     return sconf;
 }
 
-#if APR_HAS_SENDFILE
-static apr_status_t open_file(apr_file_t **file, const char *filename, int flg1, int flg2, 
-                             apr_pool_t *p)
-{
-    apr_status_t rv;
-#ifdef WIN32
-    /* The Windows file needs to be opened for overlapped i/o, which APR doesn't
-     * support.
-     */
-    HANDLE hFile;
-    /* XXX: This is wrong for unicode FS ... and it doesn't belong in httpd */
-    hFile = CreateFile(filename,          /* pointer to name of the file */
-                       GENERIC_READ,      /* access (read-write) mode */
-                       FILE_SHARE_READ,   /* share mode */
-                       NULL,              /* pointer to security attributes */
-                       OPEN_EXISTING,     /* how to create */
-                       FILE_FLAG_OVERLAPPED | FILE_FLAG_SEQUENTIAL_SCAN, /* file attributes */
-                       NULL);            /* handle to file with attributes to copy */
-    if (hFile != INVALID_HANDLE_VALUE) {
-        rv = apr_put_os_file(file, &hFile, p);
-    }
-    else {
-        rv = GetLastError();
-        *file = NULL;
-    }
-#else
-    rv = apr_open(file, filename, flg1, flg2, p);
-#endif
-
-    return rv;
-}
-#endif /* APR_HAS_SENDFILE */
-
 static apr_status_t cleanup_file_cache(void *sconfv)
 {
     a_server_config *sconf = sconfv;
@@ -219,8 +186,8 @@ static const char *cachefile(cmd_parms *cmd, void *dummy, const char *filename)
 {
     /* ToDo:
      * Disable the file cache on a Windows 9X box. APR_HAS_SENDFILE will be
-     * defined in an Apache for Windows build, but apr_sendfile is not
-     * implemened on Windows 9X because TransmitFile is not available.
+     * defined in an Apache for Windows build, but apr_sendfile returns
+     * APR_ENOTIMPL on Windows 9X because TransmitFile is not available.
      */
 
 #if APR_HAS_SENDFILE
@@ -232,7 +199,9 @@ static const char *cachefile(cmd_parms *cmd, void *dummy, const char *filename)
 
     /* canonicalize the file name? */
     /* os_canonical... */
-    if ((rc = apr_stat(&tmp.finfo, filename, cmd->temp_pool)) != APR_SUCCESS) {
+    /* XXX: uh... yea, or expect them to be -very- accurate typists */
+    if ((rc = apr_stat(&tmp.finfo, filename, APR_FINFO_NORM, 
+                       cmd->temp_pool)) != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
            "mod_file_cache: unable to stat(%s), skipping", filename);
        return NULL;
@@ -243,11 +212,7 @@ static const char *cachefile(cmd_parms *cmd, void *dummy, const char *filename)
        return NULL;
     }
 
-    /* Note: open_file should call apr_open for Unix and CreateFile for Windows.
-     * The Windows file needs to be opened for async I/O to allow multiple threads
-     * to serve it up at once.
-     */
-    rc = open_file(&fd, filename, APR_READ, APR_OS_DEFAULT, cmd->pool);
+    rc = apr_open(&fd, filename, APR_READ | APR_XTHREAD, APR_OS_DEFAULT, cmd->pool);
     if (rc != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
                      "mod_file_cache: unable to open(%s, O_RDONLY), skipping", filename);
@@ -285,7 +250,8 @@ static const char *mmapfile(cmd_parms *cmd, void *dummy, const char *filename)
     const char *fspec;
 
     fspec = ap_os_case_canonical_filename(cmd->pool, filename);
-    if ((rc = apr_stat(&tmp.finfo, fspec, cmd->temp_pool)) != APR_SUCCESS) {
+    if ((rc = apr_stat(&tmp.finfo, fspec, APR_FINFO_NORM, 
+                       cmd->temp_pool)) != APR_SUCCESS) {
        ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
            "mod_file_cache: unable to stat(%s), skipping", filename);
        return NULL;
index f04267ddae1e4763c3a18ebf1ee1e3c1639ef820..66b73cffce7e106949397aafdf431bf62ba8bec9 100644 (file)
@@ -446,7 +446,7 @@ static dav_datum dav_fs_build_key(apr_pool_t *p, const dav_resource *resource)
     apr_finfo_t finfo;
 
     /* ### use lstat() ?? */
-    if (apr_stat(&finfo, file, p) == 0) {
+    if (apr_stat(&finfo, file, APR_FINFO_NORM, p) == APR_SUCCESS) {
 
        /* ### can we use a buffer for this? */
        key.dsize = 1 + sizeof(finfo.inode) + sizeof(finfo.device);
@@ -663,7 +663,7 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, dav_datum key,
                    apr_finfo_t finfo;
 
                    /* if we don't see the file, then it's a locknull */
-                   if (apr_lstat(&finfo, fname, p) != 0) {
+                   if (apr_lstat(&finfo, fname, APR_FINFO_NORM, p) != APR_SUCCESS) {
                        if ((err = dav_fs_remove_locknull_member(p, fname, &buf)) != NULL) {
                             /* ### push a higher-level description? */
                             return err;
@@ -833,7 +833,7 @@ static dav_error * dav_fs_load_locknull_list(apr_pool_t *p, const char *dirpath,
        return NULL;
     }
 
-    if (apr_getfileinfo(&finfo, file) != APR_SUCCESS) {
+    if (apr_getfileinfo(&finfo, APR_FINFO_NORM, file) != APR_SUCCESS) {
        err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
                            apr_psprintf(p,
                                        "Opened but could not stat file %s",
index f9ac747ff37cc89b1bf6bb99efccbefcd81b5645..120efbc9be16759a012ba3ca45599b2472a36052 100644 (file)
@@ -427,7 +427,7 @@ static dav_error * dav_fs_copymove_state(
     src = apr_pstrcat(p, src_dir, "/" DAV_FS_STATE_DIR "/", src_file, NULL);
 
     /* the source file doesn't exist */
-    if (apr_stat(&src_finfo, src, p) != 0) {
+    if (apr_stat(&src_finfo, src, APR_FINFO_NORM, p) != APR_SUCCESS) {
        return NULL;
     }
 
@@ -447,7 +447,7 @@ static dav_error * dav_fs_copymove_state(
     }
 
     /* get info about the state directory */
-    if (apr_stat(&dst_state_finfo, dst, p) != 0) {
+    if (apr_stat(&dst_state_finfo, dst, APR_FINFO_NORM, p) != APR_SUCCESS) {
        /* Ack! Where'd it go? */
        /* ### use something besides 500? */
        return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
@@ -735,7 +735,8 @@ static dav_resource * dav_fs_get_parent_resource(const dav_resource *resource)
        parent_resource->uri = uri;
     }
 
-    if (apr_stat(&parent_ctx->finfo, parent_ctx->pathname, ctx->pool) == 0) {
+    if (apr_stat(&parent_ctx->finfo, parent_ctx->pathname, 
+                 APR_FINFO_NORM, ctx->pool) == APR_SUCCESS) {
         parent_resource->exists = 1;
     }
 
@@ -1138,7 +1139,7 @@ static dav_error * dav_fs_move_resource(
         * so try it
         */
        dirpath = ap_make_dirstr_parent(dstinfo->pool, dstinfo->pathname);
-       if (apr_stat(&finfo, dirpath, dstinfo->pool) == 0
+       if (apr_stat(&finfo, dirpath, APR_FINFO_NORM, dstinfo->pool) == 0
            && finfo.device == srcinfo->finfo.device) {
            can_rename = 1;
        }
@@ -1386,7 +1387,8 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth)
        /* append this file onto the path buffer (copy null term) */
        dav_buffer_place_mem(pool, &fsctx->path1, name, len + 1, 0);
 
-       if (apr_lstat(&fsctx->info1.finfo, fsctx->path1.buf, pool) != 0) {
+        if (apr_lstat(&fsctx->info1.finfo, fsctx->path1.buf, 
+                      APR_FINFO_NORM, pool) != APR_SUCCESS) {
            /* woah! where'd it go? */
            /* ### should have a better error here */
            err = dav_new_error(pool, HTTP_NOT_FOUND, 0, NULL);
index d6be15638265c73c70d47baadb644c1c1cc9f58d..eae9f798b6aa7c6e5a1990a8bbf88c39ef53cb06 100644 (file)
@@ -1268,6 +1268,7 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
     request_rec *rr = NULL;
     int ret=0;
     char *error_fmt = NULL;
+    apr_status_t rv = APR_SUCCESS;
 
     if (!strcmp(tag, "file")) {
         /* be safe; only files in this directory or below allowed */
@@ -1284,7 +1285,8 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
 
             if (rr->status == HTTP_OK && rr->finfo.protection != 0) {
                 to_send = rr->filename;
-                if (apr_stat(finfo, to_send, rr->pool) != APR_SUCCESS) {
+                if (apr_stat(finfo, to_send, 
+                             APR_FINFO_NORM, rr->pool) != APR_SUCCESS) {
                     error_fmt = "unable to get information about \"%s\" "
                         "in parsed file %s";
                 }
@@ -1297,10 +1299,8 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
 
         if (error_fmt) {
             ret = -1;
-            /* TODO: pass APLOG_NOERRNO if no apr_stat() failure; pass rv from apr_stat()
-             * otherwise
-             */
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, error_fmt, to_send, r->filename);
+            ap_log_rerror(APLOG_MARK, APLOG_ERR | (rv ? 0 : APLOG_NOERRNO),
+                          rv, r, error_fmt, to_send, r->filename);
         }
 
         if (rr) ap_destroy_sub_req(rr);
index 8ce1e8811bc3f4bd5b5cbc8cc333c5ac16fd3e2f..aaf4d10dc1931a512d26527adc34b14de0b7bbad 100644 (file)
@@ -194,10 +194,12 @@ static int log_scripterror(request_rec *r, cgi_server_conf * conf, int ret,
                   "%s: %s", error, r->filename);
 
     if (!conf->logname ||
-        ((apr_stat(&finfo, ap_server_root_relative(r->pool, conf->logname), r->pool) == APR_SUCCESS)
+        ((apr_stat(&finfo, ap_server_root_relative(r->pool, conf->logname),
+                   APR_FINFO_NORM, r->pool) == APR_SUCCESS)
          &&  (finfo.size > conf->logbytes)) ||
           (apr_open(&f, ap_server_root_relative(r->pool, conf->logname),
-                   APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) {
+                   APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool)
+              != APR_SUCCESS)) {
        return ret;
     }
 
@@ -244,7 +246,8 @@ static int log_script(request_rec *r, cgi_server_conf * conf, int ret,
     char time_str[APR_CTIME_LEN];
 
     if (!conf->logname ||
-        ((apr_stat(&finfo, ap_server_root_relative(r->pool, conf->logname), r->pool) == APR_SUCCESS)
+        ((apr_stat(&finfo, ap_server_root_relative(r->pool, conf->logname),
+                   APR_FINFO_NORM, r->pool) == APR_SUCCESS)
          &&  (finfo.size > conf->logbytes)) ||
          (apr_open(&f, ap_server_root_relative(r->pool, conf->logname),
                   APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) {
@@ -553,8 +556,8 @@ static int cgi_handler(request_rec *r)
         apr_status_t rv;
 
         newfile = apr_pstrcat(r->pool, r->filename, ".EXE", NULL);
-        if (((rv = apr_stat(&finfo, newfile, r->pool)) != APR_SUCCESS) || 
-            (finfo.filetype != APR_REG)) {
+        if (((rv = apr_stat(&finfo, newfile, APR_FINFO_TYPE, r->pool))
+                != APR_SUCCESS) || (finfo.filetype != APR_REG)) {
             return log_scripterror(r, conf, HTTP_NOT_FOUND, rv,
                                    "script not found or unable to stat");
         } else {
index 528e60808623d8561f3346dad8889ca90a3de58d..f8a69f8409dfbe1ebf31d1fb36b940847e13b9ed 100644 (file)
@@ -176,7 +176,7 @@ static int check_symlinks(char *d, int opts, apr_pool_t *p)
     else
         lastp = NULL;
 
-    res = apr_lstat(&lfi, d, p);
+    res = apr_lstat(&lfi, d, APR_FINFO_NORM, p);
 
     if (lastp)
         *lastp = '/';
@@ -194,10 +194,11 @@ static int check_symlinks(char *d, int opts, apr_pool_t *p)
     if (!(opts & OPT_SYM_OWNER))
         return HTTP_FORBIDDEN;
 
-    if (apr_stat(&fi, d, p) < 0)
+    if (apr_stat(&fi, d, APR_FINFO_NORM, p) != APR_SUCCESS)
         return HTTP_FORBIDDEN;
 
-    return (fi.user == lfi.user) ? OK : HTTP_FORBIDDEN;
+    return ((fi.valid & lfi.valid & APR_FINFO_OWNER)
+            && (fi.user == lfi.user)) ? OK : HTTP_FORBIDDEN;
 
 #endif
 }
@@ -271,7 +272,7 @@ static int get_path_info(request_rec *r)
          * an APR_PATHINCOMPLETE result to indicate that we are staring at
          * an partial virtual root.  Only OS2/Win32/Netware need apply it :-)
          */
-        rv = apr_stat(&r->finfo, path, r->pool);
+        rv = apr_stat(&r->finfo, path, APR_FINFO_NORM, r->pool);
 
         if (cp != end)
             *cp = '/';
@@ -283,8 +284,8 @@ static int get_path_info(request_rec *r)
              * argument starts with the component after that.
              */
             if (r->finfo.filetype == APR_DIR && last_cp) {
-                r->finfo.protection = 0;   /* No such file... */
-                r->finfo.filetype = APR_NOFILE;   /* No such file... */
+                r->finfo.protection = 0;  /* XXX: Wrong test for no such file... */
+                r->finfo.filetype = APR_NOFILE;  /* No such file... */
                 cp = last_cp;
             }
 
@@ -967,7 +968,8 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
         rnew->filename = ap_make_full_path(rnew->pool, fdir, new_file);
         ap_parse_uri(rnew, rnew->uri);    /* fill in parsed_uri values */
 
-        if (apr_stat(&rnew->finfo, rnew->filename, rnew->pool) != APR_SUCCESS) {
+        if (apr_stat(&rnew->finfo, rnew->filename,
+                     APR_FINFO_NORM, rnew->pool) != APR_SUCCESS) {
             rnew->finfo.protection = 0;
         }
 
index 0c76b1ae25cfb872cde857a1010a73d699f7a6f8..b7036b7de6d1ce5796b0ebb52e55c4cc67c0f623 100644 (file)
@@ -1469,7 +1469,8 @@ static float find_content_length(negotiation_state *neg, var_rec *variant)
         char *fullname = ap_make_full_path(neg->pool, neg->dir_name,
                                            variant->file_name);
 
-        if (apr_stat(&statb, fullname, neg->pool) == APR_SUCCESS) {
+        if (apr_stat(&statb, fullname,
+                     APR_FINFO_NORM, neg->pool) == APR_SUCCESS) {
             /* Note, precision may be lost */
             variant->bytes = (float) statb.size;
         }
index 5236a996939a7e279058444b384dc65407273330..222f07c466652b4262dfab040f7e6ddf2fc9d85a 100644 (file)
@@ -497,7 +497,8 @@ static const char *cmd_rewritemap(cmd_parms *cmd, void *dconf, const char *a1,
     newmap->fpout = NULL;
 
     if (newmap->checkfile && (sconf->state == ENGINE_ENABLED)
-        && (apr_stat(&st, newmap->checkfile, cmd->pool) != APR_SUCCESS)) {
+        && (apr_stat(&st, newmap->checkfile, APR_FINFO_NORM, 
+                     cmd->pool) != APR_SUCCESS)) {
         return apr_pstrcat(cmd->pool,
                           "RewriteMap: map file or program not found:",
                           newmap->checkfile, NULL);
@@ -2119,14 +2120,14 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p,
 
     rc = 0;
     if (strcmp(p->pattern, "-f") == 0) {
-        if (apr_stat(&sb, input, r->pool) == APR_SUCCESS) {
+        if (apr_stat(&sb, input, APR_FINFO_NORM, r->pool) == APR_SUCCESS) {
             if (sb.filetype == APR_REG) {
                 rc = 1;
             }
         }
     }
     else if (strcmp(p->pattern, "-s") == 0) {
-        if (apr_stat(&sb, input, r->pool) == APR_SUCCESS) {
+        if (apr_stat(&sb, input, APR_FINFO_NORM, r->pool) == APR_SUCCESS) {
             if ((sb.filetype == APR_REG) && sb.size > 0) {
                 rc = 1;
             }
@@ -2134,7 +2135,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p,
     }
     else if (strcmp(p->pattern, "-l") == 0) {
 #if !defined(OS2)
-        if (apr_lstat(&sb, input, r->pool) == APR_SUCCESS) {
+        if (apr_lstat(&sb, input, APR_FINFO_NORM, r->pool) == APR_SUCCESS) {
             if (sb.filetype == APR_LNK) {
                 rc = 1;
             }
@@ -2142,7 +2143,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p,
 #endif
     }
     else if (strcmp(p->pattern, "-d") == 0) {
-        if (apr_stat(&sb, input, r->pool) == APR_SUCCESS) {
+        if (apr_stat(&sb, input, APR_FINFO_NORM, r->pool) == APR_SUCCESS) {
             if (sb.filetype == APR_DIR) {
                 rc = 1;
             }
@@ -2179,7 +2180,8 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p,
             /* file exists for any result up to 2xx, no redirects */
             if (rsub->status < 300 &&
                 /* double-check that file exists since default result is 200 */
-                apr_stat(&sb, rsub->filename, r->pool) == APR_SUCCESS) {
+                apr_stat(&sb, rsub->filename, APR_FINFO_NORM, 
+                         r->pool) == APR_SUCCESS) {
                 rc = 1;
             }
 
@@ -2661,7 +2663,8 @@ static char *lookup_map(request_rec *r, char *name, char *key)
         s = &entries[i];
         if (strcmp(s->name, name) == 0) {
             if (s->type == MAPTYPE_TXT) {
-                if ((rv = apr_stat(&st, s->checkfile, r->pool)) != APR_SUCCESS) {
+                if ((rv = apr_stat(&st, s->checkfile, 
+                                   APR_FINFO_NORM, r->pool)) != APR_SUCCESS) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                                  "mod_rewrite: can't access text RewriteMap "
                                  "file %s", s->checkfile);
@@ -2698,7 +2701,8 @@ static char *lookup_map(request_rec *r, char *name, char *key)
             }
             else if (s->type == MAPTYPE_DBM) {
 #ifndef NO_DBM_REWRITEMAP
-                if ((rv = apr_stat(&st, s->checkfile, r->pool)) != APR_SUCCESS) {
+                if ((rv = apr_stat(&st, s->checkfile,
+                                   APR_FINFO_NORM, r->pool)) != APR_SUCCESS) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                                  "mod_rewrite: can't access DBM RewriteMap "
                                  "file %s", s->checkfile);
@@ -2760,7 +2764,8 @@ static char *lookup_map(request_rec *r, char *name, char *key)
                 }
             }
             else if (s->type == MAPTYPE_RND) {
-                if ((rv = apr_stat(&st, s->checkfile, r->pool)) != APR_SUCCESS) {
+                if ((rv = apr_stat(&st, s->checkfile,
+                                   APR_FINFO_NORM, r->pool)) != APR_SUCCESS) {
                     ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                                  "mod_rewrite: can't access text RewriteMap "
                                  "file %s", s->checkfile);
@@ -3596,7 +3601,8 @@ static char *lookup_variable(request_rec *r, char *var)
             }
         }
         else {
-            if (apr_stat(&finfo, r->filename, r->pool) == APR_SUCCESS) {
+            if (apr_stat(&finfo, r->filename,
+                         APR_FINFO_NORM, r->pool) == APR_SUCCESS) {
                 if ((pw = getpwuid(finfo.user)) != NULL) {
                     result = pw->pw_name;
                 }
@@ -3611,7 +3617,8 @@ static char *lookup_variable(request_rec *r, char *var)
             }
         }
         else {
-            if (apr_stat(&finfo, r->filename, r->pool) == 0) {
+            if (apr_stat(&finfo, r->filename,
+                         APR_FINFO_NORM, r->pool) == 0) {
                 if ((gr = getgrgid(finfo.group)) != NULL) {
                     result = gr->gr_name;
                 }
@@ -4034,7 +4041,7 @@ static int prefix_stat(const char *path, apr_finfo_t *sb)
     if ((cp = strchr(curpath+1, '/')) != NULL) {
         *cp = '\0';
     }
-    if (apr_stat(sb, curpath, NULL) == 0) {
+    if (apr_stat(sb, curpath, APR_FINFO_NORM, NULL) == APR_SUCCESS) {
         return 1;
     }
     else {
index 06ce5e2f89ddea296afdf238e216ee6fb54c2611..76845020aa4d8bf95343ffc6b0cab2146bc6403b 100644 (file)
@@ -344,7 +344,8 @@ static int translate_userdir(request_rec *r)
          * used, for example, to run a CGI script for the user.
          */
         if (filename && (!*userdirs || 
-            apr_stat(&statbuf, filename, r->pool) == APR_SUCCESS)) {
+            apr_stat(&statbuf, filename, 
+                     APR_FINFO_NORM, r->pool) == APR_SUCCESS)) {
             r->filename = apr_pstrcat(r->pool, filename, dname, NULL);
            /* when statbuf contains info on r->filename we can save a syscall
             * by copying it to r->finfo
index 5e2d1ae28c6bede792509e8cff5915978b54eecc..8060f62fb4896d4b6ce854ba5aa2aa998c449bf2 100644 (file)
@@ -1271,7 +1271,7 @@ int ap_proxy_cache_send(request_rec *r, ap_cache_el *c)
     len = 2;
     apr_send(fp, CRLF, &len);
     /* send data */
-    apr_getfileinfo(&finfo, cachefp);
+    apr_getfileinfo(&finfo, APR_FINFO_NORM, cachefp);
     if(!r->header_only && ap_send_fd(cachefp, r, offset, finfo.size, &len))
         return HTTP_INTERNAL_SERVER_ERROR;
     return OK;
index dc2eb2def28e959970dbd80aaeec504e31986d4e..3c13dd4e3e6b165aac0ebf606d1d0e8c9d6b8796 100644 (file)
@@ -230,7 +230,8 @@ void unixd_pre_config(apr_pool_t *ptemp)
 
     /* Check for suexec */
     unixd_config.suexec_enabled = 0;
-    if ((apr_stat(&wrapper, SUEXEC_BIN, ptemp)) != APR_SUCCESS) {
+    if ((apr_stat(&wrapper, SUEXEC_BIN, 
+                  APR_FINFO_NORM, ptemp)) != APR_SUCCESS) {
         return;
     }
 
index 543fff835f0e2ef8d7b5bed40ec5b183c11ec1c1..b2a551b33ab73058633e885a41fd511e71b71738 100644 (file)
@@ -1238,7 +1238,8 @@ static const char *isapi_cmd_cachefile(cmd_parms *cmd, void *dummy,
     char *fspec;
     
     fspec = ap_os_case_canonical_filename(cmd->pool, filename);
-    if (apr_stat(&tmp, fspec, cmd->temp_pool) != APR_SUCCESS) { 
+    if (apr_stat(&tmp, fspec, 
+                 APR_FINFO_NORM, cmd->temp_pool) != APR_SUCCESS) { 
        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server,
            "ISAPI: unable to stat(%s), skipping", filename);
        return NULL;
index 2fe8fca10a35ca158eab5000ae940e7611a296ea..290f966cc654d7febe5360a52aa4ac9b9430d1e9 100644 (file)
@@ -1284,7 +1284,7 @@ void ap_process_resource_config(server_rec *s, const char *fname,
     if ((ap_server_pre_read_config->nelts
         || ap_server_post_read_config->nelts)
        && !(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE)))) {
-       if (apr_stat(&finfo, fname, p) != APR_SUCCESS)     
+       if (apr_stat(&finfo, fname, APR_FINFO_NORM, p) != APR_SUCCESS)
            return;
     }
 
index 8fe8b89ad33bceb5de1ff9ac38aab58af26079de..24751d570cccccd0658695c4175053d24d22a1ce 100644 (file)
@@ -520,7 +520,8 @@ void ap_log_pid(apr_pool_t *p, const char *fname)
 
     fname = ap_server_root_relative(p, fname);
     mypid = getpid();
-    if (mypid != saved_pid && apr_stat(&finfo, fname, p) == APR_SUCCESS) {
+    if (mypid != saved_pid 
+         && apr_stat(&finfo, fname, APR_FINFO_NORM, p) == APR_SUCCESS) {
       /* WINCH and HUP call this on each restart.
        * Only warn on first time through for this pid.
        *
index cbd607c44be6fff6621c246ca446f5b6a624fed7..efd1f735d3ce9f24b78d0d0f78cb156518564bae 100644 (file)
@@ -1003,8 +1003,8 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, const char *arg
     }
 
     fname = ap_server_root_relative(cmd->pool, arg);
-    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) || 
-        (finfo.filetype != APR_DIR)) {
+    if ((apr_stat(&finfo, fname, APR_FINFO_NORM, cmd->pool) != APR_SUCCESS) 
+        || (finfo.filetype != APR_DIR)) {
        return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
                          " does not exist or is not a directory", NULL);
     }
index c4b035eee7cd7bd56d8cd86e8133fac6c087fd5c..be7732250478694ef89a26f2c59b214c7c03c775 100644 (file)
@@ -1347,8 +1347,8 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, const char *arg
     }
 
     fname = ap_server_root_relative(cmd->pool, arg);
-    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) || 
-        (finfo.filetype != APR_DIR)) {
+    if ((apr_stat(&finfo, fname, APR_FINFO_NORM, cmd->pool) != APR_SUCCESS) 
+        || (finfo.filetype != APR_DIR)) {
        return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
                          " does not exist or is not a directory", NULL);
     }
index c9dd28a850465f3747a3bda73e5746af476c4126..10932bc8e032f74e78c565082269ab53ca12a08e 100644 (file)
@@ -1719,8 +1719,8 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, const char *arg
     }
 
     fname = ap_server_root_relative(cmd->pool, arg);
-    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) || 
-        (finfo.filetype != APR_DIR)) {
+    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) 
+        || (finfo.filetype != APR_DIR)) {
        return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
                          " does not exist or is not a directory", NULL);
     }
index c2cb11d4b9ea41d2b2d773041385d9ad0f530707..618ec8a9904925724dea867f01124fc3cabf1fcc 100644 (file)
@@ -1015,8 +1015,8 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
     }
 
     fname = ap_server_root_relative(cmd->pool, arg);
-    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) || 
-        (finfo.filetype != APR_DIR)) {
+    if ((apr_stat(&finfo, fname, APR_FINFO_NORM, cmd->pool) != APR_SUCCESS) 
+        || (finfo.filetype != APR_DIR)) {
        return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
                          " does not exist or is not a directory", NULL);
     }
index 4b8a92ddc8b5cdb0884ccd43684610e4b75e1ffd..19a234eb973e16319f5ae0211539336e12cc3516 100644 (file)
@@ -1364,8 +1364,8 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy,
     }
 
     fname = ap_server_root_relative(cmd->pool, arg);
-    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) || 
-        (finfo.filetype != APR_DIR)) {
+    if ((apr_stat(&finfo, fname, APR_FINFO_NORM, cmd->pool) != APR_SUCCESS) 
+        || (finfo.filetype != APR_DIR)) {
        return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
                          " does not exist or is not a directory", NULL);
     }
index c9dd28a850465f3747a3bda73e5746af476c4126..10932bc8e032f74e78c565082269ab53ca12a08e 100644 (file)
@@ -1719,8 +1719,8 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, const char *arg
     }
 
     fname = ap_server_root_relative(cmd->pool, arg);
-    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) || 
-        (finfo.filetype != APR_DIR)) {
+    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) 
+        || (finfo.filetype != APR_DIR)) {
        return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
                          " does not exist or is not a directory", NULL);
     }
index caf41e169db93fe0155b107bbbea8317d8c7ad06..eb1968482b8f4466d5017c2c85e7597f53ef2d1e 100644 (file)
@@ -1715,8 +1715,8 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, const char *arg
     }
 
     fname = ap_server_root_relative(cmd->pool, arg);
-    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) || 
-        (finfo.filetype != APR_DIR)) {
+    if ((apr_stat(&finfo, fname, APR_FINFO_NORM, cmd->pool) != APR_SUCCESS) 
+        || (finfo.filetype != APR_DIR)) {
        return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
                          " does not exist or is not a directory", NULL);
     }
index 84f8a77b76679bb7eece40156ebe71c36aa32f7d..1c5cfaf32db35f54ed8fe1e0ae41837294c30e59 100644 (file)
@@ -1496,8 +1496,8 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
     }
 
     fname = ap_server_root_relative(cmd->pool, arg);
-    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) || 
-        (finfo.filetype != APR_DIR)) {
+    if ((apr_stat(&finfo, fname, APR_FINFO_NORM, cmd->pool) != APR_SUCCESS) 
+        || (finfo.filetype != APR_DIR)) {
        return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
                          " does not exist or is not a directory", NULL);
     }
index 43502a440e516fca8e6962adf099b99dc17bc6f6..cd31219080fcf0e4df3488c1c31c6e912851fe46 100644 (file)
@@ -2299,8 +2299,8 @@ static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
     }
 
     fname = ap_server_root_relative(cmd->pool, arg);
-    if ((apr_stat(&finfo, fname, cmd->pool) != APR_SUCCESS) || 
-        (finfo.filetype != APR_DIR)) {
+    if ((apr_stat(&finfo, fname, APR_FINFO_NORM, cmd->pool) != APR_SUCCESS) 
+        || (finfo.filetype != APR_DIR)) {
        return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
                          " does not exist or is not a directory", NULL);
     }
index 891e3112edb93d01a49b0447ffeed41993213434..fd5a82de40d94c76111903ea808f5728dfd11a42 100644 (file)
@@ -895,7 +895,7 @@ AP_DECLARE(apr_status_t) ap_pcfg_openfile(configfile_t **ret_cfg, apr_pool_t *p,
     if (status != APR_SUCCESS)
         return status;
 
-    status = apr_getfileinfo(&finfo, file);
+    status = apr_getfileinfo(&finfo, APR_FINFO_NORM, file);
     if (status != APR_SUCCESS)
         return status;
 
@@ -1679,7 +1679,7 @@ AP_DECLARE(int) ap_is_directory(apr_pool_t *p, const char *path)
 {
     apr_finfo_t finfo;
 
-    if (apr_stat(&finfo, path, p) == -1)
+    if (apr_stat(&finfo, path, APR_FINFO_NORM, p) != APR_SUCCESS)
        return 0;               /* in error condition, just return no */
 
     return (finfo.filetype == APR_DIR);
@@ -1689,7 +1689,7 @@ AP_DECLARE(int) ap_is_rdirectory(apr_pool_t *p, const char *path)
 {
     apr_finfo_t finfo;
 
-    if (apr_lstat(&finfo, path, p) == -1)
+    if (apr_lstat(&finfo, path, APR_FINFO_NORM, p) != APR_SUCCESS)
        return 0;               /* in error condition, just return no */
 
     return (finfo.filetype == APR_DIR);
index d1924709f94d0a306a03edd2d62b40394a122b16..723f7a2a905d309de6ed97fcf6b7ebb5d2001010 100644 (file)
@@ -903,14 +903,14 @@ static void test(void)
 static void copyright(void)
 {
     if (!use_html) {
-        printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.52 $> apache-2.0");
+        printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.53 $> apache-2.0");
         printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
         printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n");
         printf("\n");
     }
     else {
         printf("<p>\n");
-        printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.52 $");
+        printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.53 $");
         printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
         printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/<br>\n");
         printf("</p>\n<p>\n");
@@ -1002,7 +1002,7 @@ static int open_postfile(const char *pfile)
         return rv;
     }
 
-    apr_getfileinfo(&finfo, postfd);
+    apr_getfileinfo(&finfo, APR_FINFO_NORM, postfd);
     postlen = finfo.size;
     postdata = (char *)malloc(postlen);
     if (!postdata) {
index e9eeefab00949063acf08631d574cf8e35598924..ea79e83372fde1e20253433081426d917df154ba 100644 (file)
@@ -357,7 +357,7 @@ static int exists(char *fname)
     apr_finfo_t sbuf;
     apr_status_t check;
 
-    check = apr_stat(&sbuf, fname, NULL);
+    check = apr_stat(&sbuf, fname, APR_FINFO_NORM, NULL);
     return (check ? 0 : 1);
 }