]> granicus.if.org Git - apache/commitdiff
Separate the stat structure from the file structure and use ap_stat and
authorRyan Bloom <rbb@apache.org>
Thu, 6 Jan 2000 14:43:41 +0000 (14:43 +0000)
committerRyan Bloom <rbb@apache.org>
Thu, 6 Jan 2000 14:43:41 +0000 (14:43 +0000)
ap_getfileinfo in apache.

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

16 files changed:
include/httpd.h
modules/filters/mod_include.c
modules/generators/mod_asis.c
modules/generators/mod_autoindex.c
modules/generators/mod_cgi.c
modules/http/http_core.c
modules/http/http_protocol.c
modules/http/http_request.c
modules/http/mod_mime.c
modules/mappers/mod_actions.c
modules/mappers/mod_dir.c
modules/mappers/mod_negotiation.c
modules/mappers/mod_userdir.c
server/config.c
server/log.c
server/util.c

index 5a1cb04555593d75c1e85e298634205090632a97..fc3b3de01c39b03dc5aee057134a7bf3d710df88 100644 (file)
@@ -768,7 +768,7 @@ struct request_rec {
     char *filename;
     char *path_info;
     char *args;                        /* QUERY_ARGS, if any */
-    struct stat finfo;         /* ST_MODE set to zero if no such file */
+    ap_finfo_t finfo;          /* ST_MODE set to zero if no such file */
     uri_components parsed_uri; /* components of uri, dismantled */
 
     /* Various other config info which may change with .htaccess files
index 445b5d63d74239c32afe5b3e784f945bbe6c75ad..c8026aaf0391b9b8824e283756049decba0125ff 100644 (file)
@@ -127,23 +127,21 @@ static void add_include_vars(request_rec *r, char *timefmt)
     ap_time_t *date = r->request_time;
     ap_time_t *mtime = NULL;
 
-    ap_make_time(&mtime, r->pool);
-    ap_set_curtime(mtime, r->finfo.st_mtime); 
 
     ap_table_setn(e, "DATE_LOCAL", ap_ht_time(r->pool, date, timefmt, 0));
     ap_table_setn(e, "DATE_GMT", ap_ht_time(r->pool, date, timefmt, 1));
     ap_table_setn(e, "LAST_MODIFIED",
-              ap_ht_time(r->pool, mtime, timefmt, 0));
+              ap_ht_time(r->pool, r->finfo.mtime, timefmt, 0));
     ap_table_setn(e, "DOCUMENT_URI", r->uri);
     ap_table_setn(e, "DOCUMENT_PATH_INFO", r->path_info);
 #ifndef WIN32
-    pw = getpwuid(r->finfo.st_uid);
+    pw = getpwuid(r->finfo.user);
     if (pw) {
         ap_table_setn(e, "USER_NAME", ap_pstrdup(r->pool, pw->pw_name));
     }
     else {
         ap_table_setn(e, "USER_NAME", ap_psprintf(r->pool, "user#%lu",
-                    (unsigned long) r->finfo.st_uid));
+                    (unsigned long) r->finfo.user));
     }
 #endif /* ndef WIN32 */
 
@@ -596,7 +594,7 @@ static int include_cgi(char *s, request_rec *r)
     if ((rr->path_info && rr->path_info[0]) || rr->args) {
         return -1;
     }
-    if (rr->finfo.st_mode == 0) {
+    if (rr->finfo.protection == 0) {
         return -1;
     }
 
@@ -1026,16 +1024,12 @@ static int handle_config(ap_file_t *in, request_rec *r, char *error, char *tf,
         }
         else if (!strcmp(tag, "timefmt")) {
             ap_time_t *date = r->request_time;
-            ap_time_t *mtime = NULL;
-
-            ap_make_time(&mtime, r->pool);
-            ap_set_curtime(mtime, r->finfo.st_mtime);
 
             parse_string(r, tag_val, tf, MAX_STRING_LEN, 0);
             ap_table_setn(env, "DATE_LOCAL", ap_ht_time(r->pool, date, tf, 0));
             ap_table_setn(env, "DATE_GMT", ap_ht_time(r->pool, date, tf, 1));
             ap_table_setn(env, "LAST_MODIFIED",
-                      ap_ht_time(r->pool, mtime, tf, 0));
+                      ap_ht_time(r->pool, r->finfo.mtime, tf, 0));
         }
         else if (!strcmp(tag, "sizefmt")) {
             parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0);
@@ -1078,7 +1072,7 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
             ap_getparents(tag_val);    /* get rid of any nasties */
             rr = ap_sub_req_lookup_file(tag_val, r);
 
-            if (rr->status == HTTP_OK && rr->finfo.st_mode != 0) {
+            if (rr->status == HTTP_OK && rr->finfo.protection != 0) {
                 to_send = rr->filename;
                 if (stat(to_send, finfo)) {
                     error_fmt = "unable to get information about \"%s\" "
@@ -1104,7 +1098,7 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
     else if (!strcmp(tag, "virtual")) {
         rr = ap_sub_req_lookup_uri(tag_val, r);
 
-        if (rr->status == HTTP_OK && rr->finfo.st_mode != 0) {
+        if (rr->status == HTTP_OK && rr->finfo.protection != 0) {
             memcpy((char *) finfo, (const char *) &rr->finfo,
                    sizeof(struct stat));
             ap_destroy_sub_req(rr);
@@ -2361,7 +2355,7 @@ static int send_parsed_file(request_rec *r)
     if (r->method_number != M_GET) {
         return DECLINED;
     }
-    if (r->finfo.st_mode == 0) {
+    if (r->finfo.protection == 0) {
         ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
                    "File does not exist: %s",
                     (r->path_info
@@ -2381,12 +2375,10 @@ static int send_parsed_file(request_rec *r)
     if ((*state == xbithack_full)
 #if !defined(OS2) && !defined(WIN32)
     /*  OS/2 dosen't support Groups. */
-        && (r->finfo.st_mode & S_IXGRP)
+        && (r->finfo.protection & S_IXGRP)
 #endif
         ) {
-        ap_make_time(&mtime, r->pool);
-        ap_set_curtime(mtime, r->finfo.st_mtime);
-        ap_update_mtime(r, mtime);
+        ap_update_mtime(r, r->finfo.mtime);
         ap_set_last_modified(r);
     }
     if ((errstatus = ap_meets_conditions(r)) != OK) {
@@ -2411,7 +2403,7 @@ static int send_parsed_file(request_rec *r)
         */
        r->subprocess_env = parent->subprocess_env;
        ap_pool_join(parent->pool, r->pool);
-       r->finfo.st_mtime = parent->finfo.st_mtime;
+       r->finfo.mtime = parent->finfo.mtime;
     }
     else {
        /* we're not a nested include, so we create an initial
@@ -2455,7 +2447,7 @@ static int xbithack_handler(request_rec *r)
 #else
     enum xbithack *state;
 
-    if (!(r->finfo.st_mode & S_IXUSR)) {
+    if (!(r->finfo.protection & S_IXUSR)) {
         return DECLINED;
     }
 
index 513f619f081f97110944795085d56e0e3d10b7a5..f8c4ce5e86453bebf3c6e859bc7eebf17cf6fd88 100644 (file)
@@ -72,7 +72,7 @@ static int asis_handler(request_rec *r)
     r->allowed |= (1 << M_GET);
     if (r->method_number != M_GET)
        return DECLINED;
-    if (r->finfo.st_mode == 0) {
+    if (r->finfo.protection == 0) {
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
                    "File does not exist: %s", r->filename);
        return NOT_FOUND;
index ad87eba08f8262bbc9e120fc92a93aab518df3ca..2782a4e9c074b66282e6d6323b60ff95df15b1b3 100644 (file)
@@ -953,7 +953,7 @@ static void emit_head(request_rec *r, char *header_fname, int suppress_amble,
        && (rr = ap_sub_req_lookup_uri(header_fname, r))
        && (rr->status == HTTP_OK)
        && (rr->filename != NULL)
-       && S_ISREG(rr->finfo.st_mode)) {
+       && S_ISREG(rr->finfo.protection)) {
        /*
         * Check for the two specific cases we allow: text/html and
         * text/anything-else.  The former is allowed to be processed for
@@ -1036,7 +1036,7 @@ static void emit_tail(request_rec *r, char *readme_fname, int suppress_amble)
        && (rr = ap_sub_req_lookup_uri(readme_fname, r))
        && (rr->status == HTTP_OK)
        && (rr->filename != NULL)
-       && S_ISREG(rr->finfo.st_mode)) {
+       && S_ISREG(rr->finfo.protection)) {
        /*
         * Check for the two specific cases we allow: text/html and
         * text/anything-else.  The former is allowed to be processed for
@@ -1161,9 +1161,9 @@ static struct ent *make_autoindex_entry(char *name, int autoindex_opts,
     if (autoindex_opts & FANCY_INDEXING) {
         request_rec *rr = ap_sub_req_lookup_file(name, r);
 
-       if (rr->finfo.st_mode != 0) {
-           p->lm = rr->finfo.st_mtime;
-           if (S_ISDIR(rr->finfo.st_mode)) {
+       if (rr->finfo.protection != 0) {
+           ap_get_curtime(rr->finfo.mtime, (ap_int64_t *)&p->lm);
+           if (S_ISDIR(rr->finfo.protection)) {
                if (!(p->icon = find_icon(d, rr, 1))) {
                    p->icon = find_default_icon(d, "^^DIRECTORY^^");
                }
@@ -1176,7 +1176,7 @@ static struct ent *make_autoindex_entry(char *name, int autoindex_opts,
            else {
                p->icon = find_icon(d, rr, 0);
                p->alt = find_alt(d, rr, 0);
-               p->size = rr->finfo.st_size;
+               p->size = rr->finfo.size;
            }
        }
 
index 4fb6a024d47eeb30f7ed6b269d8422e057137ba8..ae70aff76dfe4669d8afb6ea2aaedae0f3c7b13f 100644 (file)
@@ -492,11 +492,11 @@ static int cgi_handler(request_rec *r)
         }
     }
 #else
-    if (r->finfo.st_mode == 0)
+    if (r->finfo.protection == 0)
        return log_scripterror(r, conf, NOT_FOUND, APLOG_NOERRNO,
                               "script not found or unable to stat");
 #endif
-    if (S_ISDIR(r->finfo.st_mode))
+    if (S_ISDIR(r->finfo.protection))
        return log_scripterror(r, conf, FORBIDDEN, APLOG_NOERRNO,
                               "attempt to invoke directory as script");
 
index 96a5f7dfdec68f637843618f53faf95d43a857a5..84c806c03bb7cd2200644d7e98565eb77e502615 100644 (file)
@@ -2491,7 +2491,7 @@ static int default_handler(request_rec *r)
     if (r->method_number == M_PUT) {
         return METHOD_NOT_ALLOWED;
     }
-    if (r->finfo.st_mode == 0 || (r->path_info && *r->path_info)) {
+    if (r->finfo.protection == 0 || (r->path_info && *r->path_info)) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
                      "File does not exist: %s",r->path_info ?
                      ap_pstrcat(r->pool, r->filename, r->path_info, NULL)
@@ -2507,25 +2507,23 @@ static int default_handler(request_rec *r)
                     "file permissions deny server access: %s", r->filename);
         return FORBIDDEN;
     }
-    ap_make_time(&temp, r->pool);      
-    ap_set_curtime(temp, r->finfo.st_mtime);
-    ap_update_mtime(r, temp);
+    ap_update_mtime(r, r->finfo.mtime);
     ap_set_last_modified(r);
     ap_set_etag(r);
     ap_table_setn(r->headers_out, "Accept-Ranges", "bytes");
     if (((errstatus = ap_meets_conditions(r)) != OK)
-       || (errstatus = ap_set_content_length(r, r->finfo.st_size))) {
+       || (errstatus = ap_set_content_length(r, r->finfo.size))) {
         ap_close(fd);
         return errstatus;
     }
 
 #ifdef USE_MMAP_FILES
-    if ((r->finfo.st_size >= MMAP_THRESHOLD)
-       && (r->finfo.st_size < MMAP_LIMIT)
+    if ((r->finfo.size >= MMAP_THRESHOLD)
+       && (r->finfo.size < MMAP_LIMIT)
        && (!r->header_only || (d->content_md5 & 1))) {
        /* we need to protect ourselves in case we die while we've got the
         * file mmapped */
-    if (ap_mmap_create(&mm, fd, 0, r->finfo.st_size, r->pool) != APR_SUCCESS){
+    if (ap_mmap_create(&mm, fd, 0, r->finfo.size, r->pool) != APR_SUCCESS){
            ap_log_rerror(APLOG_MARK, APLOG_CRIT, errno, r,
                         "default_handler: mmap failed: %s", r->filename);
            mm = NULL;
@@ -2584,7 +2582,7 @@ static int default_handler(request_rec *r)
            AP_MD5_CTX context;
            
            ap_MD5Init(&context);
-           ap_MD5Update(&context, addr, (unsigned int)r->finfo.st_size);
+           ap_MD5Update(&context, addr, (unsigned int)r->finfo.size);
            ap_table_setn(r->headers_out, "Content-MD5",
                          ap_md5contextTo64(r->pool, &context));
        }
@@ -2594,7 +2592,7 @@ static int default_handler(request_rec *r)
        
        if (!r->header_only) {
            if (!rangestatus) {
-               ap_send_mmap(mm, r, 0, r->finfo.st_size);
+               ap_send_mmap(mm, r, 0, r->finfo.size);
            }
            else {
                ap_off_t offset;
index eef96c310fe56cc4c867a5f168748cc685231d72..093e3f025abd2bd81cdee30fec278e364e18d7d1 100644 (file)
@@ -537,11 +537,11 @@ API_EXPORT(char *) ap_make_etag(request_rec *r, int force_weak)
     ap_timediff(r->request_time, r->mtime, &diff);
     weak = ((diff > 1) && !force_weak) ? "" : "W/";
 
-    if (r->finfo.st_mode != 0) {
+    if (r->finfo.protection != 0) {
         etag = ap_psprintf(r->pool,
                     "%s\"%lx-%lx-%lx\"", weak,
-                    (unsigned long) r->finfo.st_ino,
-                    (unsigned long) r->finfo.st_size,
+                    (unsigned long) r->finfo.inode,
+                    (unsigned long) r->finfo.size,
                     (unsigned long) r->mtime);
     }
     else {
index 76904bfc2de162799d4c7b231766193f03e503ac..505b5f9558c57ef6be9da2349646e832f9d0c058 100644 (file)
@@ -116,10 +116,10 @@ IMPLEMENT_HOOK_RUN_FIRST(int,auth_checker,(request_rec *r),(r),DECLINED)
 static int check_safe_file(request_rec *r)
 {
 
-    if (r->finfo.st_mode == 0         /* doesn't exist */
-        || S_ISDIR(r->finfo.st_mode)
-        || S_ISREG(r->finfo.st_mode)
-        || S_ISLNK(r->finfo.st_mode)) {
+    if (r->finfo.protection == 0         /* doesn't exist */
+        || S_ISDIR(r->finfo.protection)
+        || S_ISREG(r->finfo.protection)
+        || S_ISLNK(r->finfo.protection)) {
         return OK;
     }
     ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
@@ -200,7 +200,7 @@ static int get_path_info(request_rec *r)
     char bStripSlash=1;
 #endif
 
-    if (r->finfo.st_mode) {
+    if (r->finfo.protection) {
        /* assume path_info already set */
        return OK;
     }
@@ -260,20 +260,20 @@ static int get_path_info(request_rec *r)
          }
          else {
              errno = 0;
-             rv = stat(path, &r->finfo);
+             rv = ap_stat(&r->finfo, path, r->pool);
          }
 
         if (cp != end)
             *cp = '/';
 
-        if (!rv) {    
+        if (rv != APR_SUCCESS) {    
             /*
              * Aha!  Found something.  If it was a directory, we will search
              * contents of that directory for a multi_match, so the PATH_INFO
              * argument starts with the component after that.
              */
-            if (S_ISDIR(r->finfo.st_mode) && last_cp) {
-                r->finfo.st_mode = 0;   /* No such file... */
+            if (S_ISDIR(r->finfo.protection) && last_cp) {
+                r->finfo.protection = 0;   /* No such file... */
                 cp = last_cp;
             }
 
@@ -284,7 +284,7 @@ static int get_path_info(request_rec *r)
        /* must set this to zero, some stat()s may have corrupted it
         * even if they returned an error.
         */
-       r->finfo.st_mode = 0;
+       r->finfo.protection = 0;
 
 #if defined(ENOENT) && defined(ENOTDIR)
         if (errno == ENOENT || errno == ENOTDIR) {
@@ -354,7 +354,7 @@ static int directory_walk(request_rec *r)
 
     if (r->filename == NULL) {
         r->filename = ap_pstrdup(r->pool, r->uri);
-        r->finfo.st_mode = 0;   /* Not really a file... */
+        r->finfo.protection = 0;   /* Not really a file... */
         r->per_dir_config = per_dir_defaults;
 
         return OK;
@@ -436,7 +436,7 @@ static int directory_walk(request_rec *r)
     if (test_filename[test_filename_len - 1] == '/')
         --num_dirs;
 
-    if (S_ISDIR(r->finfo.st_mode))     
+    if (S_ISDIR(r->finfo.protection))     
         ++num_dirs;
 
     /*
@@ -571,7 +571,7 @@ static int directory_walk(request_rec *r)
      * S_ISDIR test.  But if you accessed /symlink/index.html, for example,
      * you would *not* get the 403.
      */
-    if (!S_ISDIR(r->finfo.st_mode
+    if (!S_ISDIR(r->finfo.protection
         && (res = check_symlinks(r->filename, ap_allow_options(r)))) {
         ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
                     "Symbolic link not allowed: %s", r->filename);
@@ -860,8 +860,8 @@ API_EXPORT(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 (stat(rnew->filename, &rnew->finfo) < 0) {
-            rnew->finfo.st_mode = 0;
+        if (ap_stat(&rnew->finfo, rnew->filename, rnew->pool) != APR_SUCCESS) {
+            rnew->finfo.protection = 0;
         }
 
         if ((res = check_safe_file(rnew))) {
@@ -875,7 +875,7 @@ API_EXPORT(request_rec *) ap_sub_req_lookup_file(const char *new_file,
          * no matter what, if it's a subdirectory, we need to re-run
          * directory_walk
          */
-        if (S_ISDIR(rnew->finfo.st_mode)) {  
+        if (S_ISDIR(rnew->finfo.protection)) {  
             res = directory_walk(rnew);
             if (!res) {
                 res = file_walk(rnew);
index 3c598cf44eec67fc80046dd6cc5e2e445bbbe809..adccd1f33c8166681b92802590d41a4d88616298 100644 (file)
@@ -286,7 +286,7 @@ static int find_ct(request_rec *r)
     const char *orighandler = r->handler;
     const char *type;
 
-    if (S_ISDIR(r->finfo.st_mode)) {
+    if (S_ISDIR(r->finfo.protection)) {
         r->content_type = DIR_MAGIC_TYPE;
         return OK;
     }
index 2af51f7410e388e7826dbbb4b8c7bd91e12ecd1d..10051f0a84f2da7352067e9d88903780e24a1e08 100644 (file)
@@ -187,7 +187,7 @@ static int action_handler(request_rec *r)
     if ((t = ap_table_get(conf->action_types,
                       action ? action : ap_default_type(r)))) {
        script = t;
-       if (r->finfo.st_mode == 0) {
+       if (r->finfo.protection == 0) {
            ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
                        "File does not exist: %s", r->filename);
            return NOT_FOUND;
index 515d2fab5c315fa0dff26d7c6999f765011384a1..8f97e6b2b1a9f1a1cb1eacebee363fbd63785425 100644 (file)
@@ -161,7 +161,7 @@ static int handle_dir(request_rec *r)
         char *name_ptr = *names_ptr;
         request_rec *rr = ap_sub_req_lookup_uri(name_ptr, r);
 
-        if (rr->status == HTTP_OK && S_ISREG(rr->finfo.st_mode)) {
+        if (rr->status == HTTP_OK && S_ISREG(rr->finfo.protection)) {
             char *new_uri = ap_escape_uri(r->pool, rr->uri);
 
             if (rr->args != NULL)
index 14d472a142e6a4be37cc023c862fa01534979be6..63b7f6e1c134e9a86155a95a88416a3003a6907c 100644 (file)
@@ -284,15 +284,12 @@ static void set_mime_fields(var_rec *var, accept_rec *mime_info)
 
 static void set_vlist_validator(request_rec *r, request_rec *vlistr)
 {
-    ap_time_t *temp;
     /* Calculating the variant list validator is similar to
      * calculating an etag for the source of the variant list
      * information, so we use ap_make_etag().  Note that this
      * validator can be 'weak' in extreme case.
      */
-    ap_make_time(&temp, vlistr->pool);
-    ap_set_curtime(temp, vlistr->finfo.st_mtime);
-    ap_update_mtime(vlistr, temp);
+    ap_update_mtime(vlistr, vlistr->finfo.mtime);
     r->vlist_validator = ap_make_etag(vlistr, 0);
 
     /* ap_set_etag will later take r->vlist_validator into account
@@ -2581,7 +2578,7 @@ static int handle_multi(request_rec *r)
     int res;
     int j;
 
-    if (r->finfo.st_mode != 0 || !(ap_allow_options(r) & OPT_MULTI)) {
+    if (r->finfo.protection != 0 || !(ap_allow_options(r) & OPT_MULTI)) {
         return DECLINED;
     }
 
@@ -2624,7 +2621,7 @@ static int handle_multi(request_rec *r)
 
     /* BLECH --- don't multi-resolve non-ordinary files */
 
-    if (!S_ISREG(sub_req->finfo.st_mode)) {
+    if (!S_ISREG(sub_req->finfo.protection)) {
         res = NOT_FOUND;
         goto return_from_multi;
     }
index ffcc59dcb9112d397fd92b5e953e9558eb4d528f..877bbf90826fb7a039ac9deddbaaa4b16fffc90e 100644 (file)
@@ -199,7 +199,7 @@ static int translate_userdir(request_rec *r)
     const char *w, *dname;
     char *redirect;
     char *x = NULL;
-    struct stat statbuf;
+    ap_finfo_t statbuf;
 
     /*
      * If the URI doesn't match our basic pattern, we've nothing to do with
@@ -313,7 +313,8 @@ static int translate_userdir(request_rec *r)
          * anyway, in the hope that some handler might handle it. This can be
          * used, for example, to run a CGI script for the user.
          */
-        if (filename && (!*userdirs || stat(filename, &statbuf) != -1)) {
+        if (filename && (!*userdirs || 
+            ap_stat(&statbuf, filename, r->pool) == APR_SUCCESS)) {
             r->filename = ap_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 d0671d0fde16b909ca7f35b3ca7f78f667d997d1..2d72a08bfb98a6dbce1ec5e2ed7e3693ebc7c96f 100644 (file)
@@ -1021,20 +1021,20 @@ void ap_process_resource_config(server_rec *s, const char *fname, ap_context_t *
 {
     const char *errmsg;
     cmd_parms parms;
-    ap_file_t *finfo = NULL;
+    ap_finfo_t finfo;
 
     fname = ap_server_root_relative(p, fname);
 
     if (!(strcmp(fname, ap_server_root_relative(p, RESOURCE_CONFIG_FILE))) ||
        !(strcmp(fname, ap_server_root_relative(p, ACCESS_CONFIG_FILE)))) {
-       if (ap_stat(&finfo, fname, ptemp) != APR_SUCCESS)   
+       if (ap_stat(&finfo, fname, p) != APR_SUCCESS)   
            return;
     }
 
     /* don't require conf/httpd.conf if we have a -C or -c switch */
     if((ap_server_pre_read_config->nelts || ap_server_post_read_config->nelts) &&
        !(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE)))) {
-       if (ap_stat(&finfo, fname, ptemp) != APR_SUCCESS)     
+       if (ap_stat(&finfo, fname, p) != APR_SUCCESS)     
            return;
     }
 
index c0acff4db1d0d8c87d4f00ca016fe59b8133e17e..48dee5edd1816d43bf74e0033fe46b9fa77424c2 100644 (file)
@@ -514,6 +514,7 @@ API_EXPORT(void) ap_log_rerror(const char *file, int line, int level,
 void ap_log_pid(ap_context_t *p, const char *fname)
 {
     ap_file_t *pid_file = NULL;
+    ap_finfo_t finfo;
     static pid_t saved_pid = -1;
     pid_t mypid;
 
@@ -522,7 +523,7 @@ void ap_log_pid(ap_context_t *p, const char *fname)
 
     fname = ap_server_root_relative(p, fname);
     mypid = getpid();
-    if (mypid != saved_pid && ap_stat(&pid_file, fname, p) == 0) {
+    if (mypid != saved_pid && ap_stat(&finfo, fname, p) == APR_SUCCESS) {
       /* WINCH and HUP call this on each restart.
        * Only warn on first time through for this pid.
        *
index 9380f2844911221b267f13de8c656ec95274855a..17581f61c5d59faa7298003675fb6c8fd56fa4f0 100644 (file)
@@ -766,6 +766,7 @@ API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **ret_cfg, ap_context_t *p
 {
     configfile_t *new_cfg;
     ap_file_t *file = NULL;
+    ap_finfo_t finfo;
     ap_status_t stat;
     ap_filetype_e type;
 
@@ -791,7 +792,8 @@ API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **ret_cfg, ap_context_t *p
     if (stat != APR_SUCCESS)
         return stat;
 
-    stat = ap_get_filetype(&type, file);
+    ap_getfileinfo(&finfo, file);
+    stat = ap_get_filetype(&type, finfo.protection);
     if (stat != APR_SUCCESS)
         return stat;