resource->uri = r->uri;
}
- if (r->finfo.protection != 0) {
+ if (r->finfo.filetype != 0) {
resource->exists = 1;
resource->collection = r->finfo.filetype == APR_DIR;
/* retain proper integrity across the structures */
if (!resource->exists) {
- ctx->finfo.protection = 0;
+ ctx->finfo.filetype = 0;
}
}
}
#ifdef WIN32
return stricmp(ctx1->pathname, ctx2->pathname) == 0;
#else
- if (ctx1->finfo.protection != 0)
+ if (ctx1->finfo.filetype != 0)
return ctx1->finfo.inode == ctx2->finfo.inode;
else
return strcmp(ctx1->pathname, ctx2->pathname) == 0;
/* determine whether a simple rename will work.
* Assume source exists, else we wouldn't get called.
*/
- if (dstinfo->finfo.protection != 0) {
+ if (dstinfo->finfo.filetype != 0) {
if (dstinfo->finfo.device == srcinfo->finfo.device) {
/* target exists and is on the same device. */
can_rename = 1;
if (!resource->exists)
return apr_pstrdup(ctx->pool, "");
- if (ctx->finfo.protection != 0) {
+ if (ctx->finfo.filetype != 0) {
return apr_psprintf(ctx->pool, "\"%lx-%lx-%lx\"",
(unsigned long) ctx->finfo.inode,
(unsigned long) ctx->finfo.size,
break;
case DAV_PROPID_FS_executable:
-#ifdef WIN32
- /* our property, but not defined on the Win32 platform */
- return DAV_PROP_INSERT_NOTDEF;
-#else
/* our property, but not defined on collection resources */
if (resource->collection)
return DAV_PROP_INSERT_NOTDEF;
- /* the files are "ours" so we only need to check owner exec privs */
+ /* our property, but not defined on this platform */
+ if (!(resource->info->finfo.valid & APR_FINFO_UPROT))
+ return DAV_PROP_INSERT_NOTDEF;
+
+ /* the files are "ours" so we only need to check owner exec privs */
if (resource->info->finfo.protection & APR_UEXECUTE)
value = "T";
else
value = "F";
break;
-#endif /* WIN32 */
default:
/* ### what the heck was this property? */
if ((rr->path_info && rr->path_info[0]) || rr->args) {
return -1;
}
- if (rr->finfo.protection == 0) {
+ if (rr->finfo.filetype == 0) {
return -1;
}
we never attempt to "run" this sub request. */
rr = ap_sub_req_lookup_file(tag_val, r, NULL);
- if (rr->status == HTTP_OK && rr->finfo.protection != 0) {
+ if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
to_send = rr->filename;
if ((rv = apr_stat(finfo, to_send, APR_FINFO_GPROT
| APR_FINFO_MIN, rr->pool)) != APR_SUCCESS
we never attempt to "run" this sub request. */
rr = ap_sub_req_lookup_uri(tag_val, r, NULL);
- if (rr->status == HTTP_OK && rr->finfo.protection != 0) {
+ if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
memcpy((char *) finfo, (const char *) &rr->finfo,
sizeof(rr->finfo));
ap_destroy_sub_req(rr);
}
}
+ /* Assure the platform supports Group protections */
if ((*state == xbithack_full)
-#if !defined(OS2) && !defined(WIN32)
- /* OS/2 dosen't support Groups. */
- && (r->finfo.protection & APR_GEXECUTE)
-#endif
- ) {
+ && (r->finfo.valid & APR_FINFO_GPROT)
+ && (r->finfo.protection & APR_GEXECUTE)) {
ap_update_mtime(r, r->finfo.mtime);
ap_set_last_modified(r);
}
r->allowed |= (1 << M_GET);
if (r->method_number != M_GET)
return DECLINED;
- if (r->finfo.protection == 0) {
+ if (r->finfo.filetype == 0) {
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
"File does not exist: %s", r->filename);
return HTTP_NOT_FOUND;
if (autoindex_opts & FANCY_INDEXING) {
request_rec *rr = ap_sub_req_lookup_file(name, r, NULL);
- if (rr->finfo.protection != 0) {
+ if (rr->finfo.filetype != 0) {
p->lm = rr->finfo.mtime;
if (rr->finfo.filetype == APR_DIR) {
if (!(p->icon = find_icon(d, rr, 1))) {
* entity until the sysadmin overrides that behavior.
* Allow for cgi files without the .EXE extension on them under OS/2
*/
- if (r->finfo.protection == 0) {
+ if (r->finfo.filetype == 0) {
apr_finfo_t finfo;
char *newfile;
apr_status_t rv;
}
}
#else
- if (r->finfo.protection == 0)
+ if (r->finfo.filetype == 0)
return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
"script not found or unable to stat");
#endif
#error mod_cgid does not work on this platform. If you teach it to, look
#error at mod_cgi.c for required code in this path.
#else
- if (r->finfo.protection == 0)
+ if (r->finfo.filetype == 0)
return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
"script not found or unable to stat");
#endif
if (r->method_number == M_PUT) {
return HTTP_METHOD_NOT_ALLOWED;
}
- if (r->finfo.protection == 0 || (r->path_info && *r->path_info)) {
+ if (r->finfo.filetype == 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 ?
apr_pstrcat(r->pool, r->filename, r->path_info, NULL)
weak = ((r->request_time - r->mtime > APR_USEC_PER_SEC)
&& !force_weak) ? "" : "W/";
- if (r->finfo.protection != 0) {
+ if (r->finfo.filetype != 0) {
etag = apr_psprintf(r->pool,
"%s\"%lx-%lx-%lx\"", weak,
(unsigned long) r->finfo.inode,
static int check_safe_file(request_rec *r)
{
- if (r->finfo.protection == 0 /* doesn't exist */
+ if (r->finfo.filetype == 0 /* doesn't exist */
|| r->finfo.filetype == APR_DIR
|| r->finfo.filetype == APR_REG
|| r->finfo.filetype == APR_LNK) {
char bStripSlash=1;
#endif
- if (r->finfo.protection) {
+ if (r->finfo.filetype) {
/* assume path_info already set */
return OK;
}
* argument starts with the component after that.
*/
if (r->finfo.filetype == APR_DIR && last_cp) {
- r->finfo.protection = 0; /* XXX: Wrong test for no such file... */
r->finfo.filetype = APR_NOFILE; /* No such file... */
cp = last_cp;
}
if (r->filename == NULL) {
r->filename = apr_pstrdup(r->pool, r->uri);
- r->finfo.protection = 0; /* Not really a file... */
r->finfo.filetype = APR_NOFILE;
r->per_dir_config = per_dir_defaults;
if (((rv = apr_stat(&rnew->finfo, rnew->filename,
APR_FINFO_NORM, rnew->pool)) != APR_SUCCESS)
&& (rv != APR_INCOMPLETE)) {
- rnew->finfo.protection = 0;
+ rnew->finfo.filetype = 0;
}
if ((res = check_safe_file(rnew))) {
if ((t = apr_table_get(conf->action_types,
action ? action : ap_default_type(r)))) {
script = t;
- if (r->finfo.protection == 0) {
+ if (r->finfo.filetype == 0) {
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
"File does not exist: %s", r->filename);
return HTTP_NOT_FOUND;
int res;
int j;
- if (r->finfo.protection != 0 || !(ap_allow_options(r) & OPT_MULTI)) {
+ if (r->finfo.filetype != 0 || !(ap_allow_options(r) & OPT_MULTI)) {
return DECLINED;
}
}
/* We've already got a file of some kind or another */
- if (r->proxyreq || (r->finfo.protection != 0)) {
+ if (r->proxyreq || (r->finfo.filetype != 0)) {
return DECLINED;
}
/* if ./.web/$1.meta exists then output 'asis' */
- if (r->finfo.protection == 0) {
+ if (r->finfo.filetype == 0) {
return DECLINED;
};
switch (code[0]) {
case 'M':
- if (r->finfo.protection == 0) {
+ if (r->finfo.filetype == 0) {
/* file doesn't exist on disk, so we can't do anything based on
* modification time. Note that this does _not_ log an error.
*/
break;
default:
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, 0, r,
- MODNAME ": invalid mode 0%o.", (unsigned int)r->finfo.protection);
+ MODNAME ": invalid file type %d.", r->finfo.filetype);
return HTTP_INTERNAL_SERVER_ERROR;
}
magic_server_config_rec *conf;
/* the file has to exist */
- if (r->finfo.protection == 0 || !r->filename) {
+ if (r->finfo.filetype == 0 || !r->filename) {
return DECLINED;
}
if (autoindex_opts & FANCY_INDEXING) {
request_rec *rr = ap_sub_req_lookup_file(name, r, NULL);
- if (rr->finfo.protection != 0) {
+ if (rr->finfo.filetype != 0) {
p->lm = rr->finfo.mtime;
if (rr->finfo.filetype == APR_DIR) {
if (!(p->icon = find_icon(d, rr, 1))) {