From: Ryan Bloom Date: Thu, 6 Jan 2000 14:43:41 +0000 (+0000) Subject: Separate the stat structure from the file structure and use ap_stat and X-Git-Tag: 1.3.10~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f26ac7df44f65f4a7d1863015ef0975b6bcdd0d;p=apache Separate the stat structure from the file structure and use ap_stat and ap_getfileinfo in apache. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84397 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/httpd.h b/include/httpd.h index 5a1cb04555..fc3b3de01c 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -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 diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 445b5d63d7..c8026aaf03 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -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; } diff --git a/modules/generators/mod_asis.c b/modules/generators/mod_asis.c index 513f619f08..f8c4ce5e86 100644 --- a/modules/generators/mod_asis.c +++ b/modules/generators/mod_asis.c @@ -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; diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index ad87eba08f..2782a4e9c0 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -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; } } diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 4fb6a024d4..ae70aff76d 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -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"); diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 96a5f7dfde..84c806c03b 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -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; diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index eef96c310f..093e3f025a 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -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 { diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 76904bfc2d..505b5f9558 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -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); diff --git a/modules/http/mod_mime.c b/modules/http/mod_mime.c index 3c598cf44e..adccd1f33c 100644 --- a/modules/http/mod_mime.c +++ b/modules/http/mod_mime.c @@ -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; } diff --git a/modules/mappers/mod_actions.c b/modules/mappers/mod_actions.c index 2af51f7410..10051f0a84 100644 --- a/modules/mappers/mod_actions.c +++ b/modules/mappers/mod_actions.c @@ -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; diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c index 515d2fab5c..8f97e6b2b1 100644 --- a/modules/mappers/mod_dir.c +++ b/modules/mappers/mod_dir.c @@ -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) diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 14d472a142..63b7f6e1c1 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -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; } diff --git a/modules/mappers/mod_userdir.c b/modules/mappers/mod_userdir.c index ffcc59dcb9..877bbf9082 100644 --- a/modules/mappers/mod_userdir.c +++ b/modules/mappers/mod_userdir.c @@ -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 diff --git a/server/config.c b/server/config.c index d0671d0fde..2d72a08bfb 100644 --- a/server/config.c +++ b/server/config.c @@ -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; } diff --git a/server/log.c b/server/log.c index c0acff4db1..48dee5edd1 100644 --- a/server/log.c +++ b/server/log.c @@ -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. * diff --git a/server/util.c b/server/util.c index 9380f28449..17581f61c5 100644 --- a/server/util.c +++ b/server/util.c @@ -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;