mirror of
https://github.com/apache/httpd.git
synced 2026-01-26 19:01:35 +03:00
Fix some serious, hard-core breakage :-( I don't even know how it
compiled and linked. * there is no UNIX symbol, so go back to #ifndef WIN32. that other platforms can pile on as needed until we have a proper mechanism. * reinstate the liveprop callbacks and the dav_hooks_liveprop_fs structure. since the latter structure is referred to elsewhere in the file, it better be defined. * use a "feature" name of DAV_FS_HAS_EXECUTABLE rather than conditionally specifying the property. convert the tests over to that symbol. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93012 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -153,16 +153,22 @@ enum {
|
||||
};
|
||||
|
||||
/*
|
||||
** The single property that we define (in the DAV_FS_URI_MYPROPS namespace)
|
||||
** XXX this property is not usable (readable/writable) on all platforms
|
||||
** Need an abstract way to determine this.
|
||||
** Does this platform support an executable flag?
|
||||
**
|
||||
** ### need a way to portably abstract this query
|
||||
*/
|
||||
#ifdef UNIX
|
||||
#define DAV_PROPID_FS_executable 1
|
||||
#ifndef WIN32
|
||||
#define DAV_FS_HAS_EXECUTABLE
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The single property that we define (in the DAV_FS_URI_MYPROPS namespace)
|
||||
*/
|
||||
#define DAV_PROPID_FS_executable 1
|
||||
|
||||
static const dav_liveprop_spec dav_fs_props[] =
|
||||
{
|
||||
/* standard DAV properties */
|
||||
{
|
||||
DAV_FS_URI_DAV,
|
||||
"creationdate",
|
||||
@@ -187,14 +193,15 @@ static const dav_liveprop_spec dav_fs_props[] =
|
||||
DAV_PROPID_getlastmodified,
|
||||
0
|
||||
},
|
||||
#ifdef DAV_PROPID_FS_executable
|
||||
|
||||
/* our custom properties */
|
||||
{
|
||||
DAV_FS_URI_MYPROPS,
|
||||
"executable",
|
||||
DAV_PROPID_FS_executable,
|
||||
0 /* handled special in dav_fs_is_writable */
|
||||
},
|
||||
#endif
|
||||
|
||||
{ 0 } /* sentinel */
|
||||
};
|
||||
|
||||
@@ -1868,7 +1875,7 @@ static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource,
|
||||
buf);
|
||||
value = buf;
|
||||
break;
|
||||
#ifdef DAV_PROPID_FS_executable
|
||||
|
||||
case DAV_PROPID_FS_executable:
|
||||
/* our property, but not defined on collection resources */
|
||||
if (resource->collection)
|
||||
@@ -1884,7 +1891,7 @@ static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource,
|
||||
else
|
||||
value = "F";
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
/* ### what the heck was this property? */
|
||||
return DAV_PROP_INSERT_NOTDEF;
|
||||
@@ -1919,14 +1926,16 @@ static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource,
|
||||
return what;
|
||||
}
|
||||
|
||||
#ifdef DAV_PROPID_FS_executable
|
||||
|
||||
static int dav_fs_is_writable(const dav_resource *resource, int propid)
|
||||
{
|
||||
const dav_liveprop_spec *info;
|
||||
|
||||
#ifdef DAV_FS_HAS_EXECUTABLE
|
||||
/* if we have the executable property, and this isn't a collection,
|
||||
then the property is writable. */
|
||||
if (propid == DAV_PROPID_FS_executable && !resource->collection)
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
(void) dav_get_liveprop_info(propid, &dav_fs_liveprop_group, &info);
|
||||
return info->is_writable;
|
||||
@@ -2067,6 +2076,7 @@ static dav_error *dav_fs_patch_rollback(const dav_resource *resource,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static const dav_hooks_liveprop dav_hooks_liveprop_fs =
|
||||
{
|
||||
dav_fs_insert_prop,
|
||||
@@ -2078,8 +2088,6 @@ static const dav_hooks_liveprop dav_hooks_liveprop_fs =
|
||||
dav_fs_patch_rollback
|
||||
};
|
||||
|
||||
#endif /* DAV_PROPID_FS_executable */
|
||||
|
||||
static const dav_provider dav_fs_provider =
|
||||
{
|
||||
&dav_hooks_repository_fs,
|
||||
@@ -2091,7 +2099,7 @@ static const dav_provider dav_fs_provider =
|
||||
|
||||
void dav_fs_gather_propsets(apr_array_header_t *uris)
|
||||
{
|
||||
#ifdef DAV_PROPID_FS_executable
|
||||
#ifdef DAV_FS_HAS_EXECUTABLE
|
||||
*(const char **)apr_array_push(uris) =
|
||||
"<http://apache.org/dav/propset/fs/1>";
|
||||
#endif
|
||||
@@ -2132,7 +2140,9 @@ void dav_fs_insert_all_liveprops(request_rec *r, const dav_resource *resource,
|
||||
what, phdr);
|
||||
(void) dav_fs_insert_prop(resource, DAV_PROPID_getetag,
|
||||
what, phdr);
|
||||
#ifdef DAV_PROPID_FS_executable
|
||||
|
||||
#ifdef DAV_FS_HAS_EXECUTABLE
|
||||
/* Only insert this property if it is defined for this platform. */
|
||||
(void) dav_fs_insert_prop(resource, DAV_PROPID_FS_executable,
|
||||
what, phdr);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user