Hi Folks,

I've been doing some work on Extended Attributes support for APR and
thought now is the time to get feedback on a potential user of the
proposed API.

The following patch adds an option to mod_dav_fs to store properties in
file system extended attributes and removes the requirement for .DAV
metadata directories and the dbm database per file with properties.

http://privsep.org/patches/2.3.0-dev/xattr-patches/httpd-dav-fs-xattrs.patch

It requires the proposed patch to APR for Extended Attributes support
(implemented for and tested on Mac OS X, Linux, FreeBSD and Solaris).
See: http://issues.apache.org/bugzilla/show_bug.cgi?id=44127

http://privsep.org/patches/2.3.0-dev/xattr-patches/apr-xattr-all.patch

Note: This code is at the experimental/test stage (there are no litmus
regressions and works with simple tests - not put in production yet).

The patch adds a new global resource conf directive DAVPropDBType
(Allowed values are "sdbm" (default) or "xattr"). e.g.

  # Enabled mod_dav_fs extended attributes
  DAVPropDBType "xattr"

The patch does not change the default behaviour of mod_dav_fs (sdbm is
is the default - extended attribute support must be explicitly enabled).

modules/dav/fs/dbm.c is split into 2 files by the patch:
  props.c - props provider and namespace handling from dbm.c
  dbm.c - contains the db specific functions from dbm.c

No changes are made to dbm.c functions other than adding a function
dispatch structure to call either the existing dbm wrapper routines
or the new xattr routines. The dispatch is switched globally by the
config directive.

* Passes all litmus properties tests (more testing required).
* Creates attributes with the same namespace storage mapping and meta-
  data as the SDBM properties (not sure if this is the best approach).
* Extended attribute properties are prefixed with apache.org:mod_dav_fs:
  (this is so we do not clash with existing extended attributes).
* It may be desirable later to add directives to map certain
  namespaces+key combinations to non-prefixed extended attributes
  to allow outside applications easier access to the extended attributes
  set by mod_dav_fs.
* Example Extended Attributes set during litmus run (with apxattr util)
  http://privsep.org/patches/2.3.0-dev/xattr-patches/apxattr.c

# apxattr -l /opt/apache2.3-davxattrs/uploads/litmus/prop2
apache.org:mod_dav_fs:1:prop5
apache.org:mod_dav_fs:1:prop6
apache.org:mod_dav_fs:1:prop7
apache.org:mod_dav_fs:1:prop8
apache.org:mod_dav_fs:1:prop9
apache.org:mod_dav_fs:METADATA
apache.org:mod_dav_fs:1:valnspace
apache.org:mod_dav_fs::nonamespace
apache.org:mod_dav_fs:1:high-unicode

Reply via email to