You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2007/12/22 06:29:15 UTC

DO NOT REPLY [Bug 44127] New: - File Extended Attributes Support

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127

           Summary: File Extended Attributes Support
           Product: APR
           Version: HEAD
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: michael@metaparadigm.com


I have been doing some work on implementing extended attributes
support for apr.

I am doing this as I would like to add a property provider to
mod_dav_fs that uses extended attributes instead of a db per file
(TwistedDAV on Mac OS X also uses extended attributes for this BTW)
and I want to do this portably so it could potentially be included.

Extended attributes can also be used for setting mime-types on files
(mod_mime_xattr uses the native Linux API so this could be ported
to use portable apr xattrs and work on more platforms). Another nice
idea is setting file listing 'description' attributes and getting
mod_autoindex to look at them.

I have looked at a few of the OS extended attributes interface and
have come up with an API proposal.

It addresses:
 * setting, getting, listing and removing of 'user' extended attributes
   on a file specified by its filepath.

It does not address:
 * system namespaces on platforms with more than one attribute namespace
   (only the user namespace is accessible on platforms with multiple
    attr namespaces, new flags could potentially be added to access
    platform specific system namespaces)
 * setting, getting, listing and removing attributes on a file
   specified by a file descriptor (apr_os_file_t)

I have working sample implementations for Linux, Mac OS X, FreeBSD 6
and Solaris 10 (which each have different APIs BTW):

* Linux impl use l?(get|set|list|remove)xattr
* Mac OS X impl use (get|set|list|remove)xattr (different args to linux)
* FreeBSD impl uses extattr_(get|set|list|delete)_(file|link)
* Solaris impl uses subfiles (attropen,unlinkat and friends)

Not implemented:

* Windows - should be able to use named :streams (similar to Solaris)
* OS/2 - it has extended attributes but that's all I know.
* Irix/HPUX/AIX/OS390/netware/... - unknown? do they have them?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From davi@apache.org  2008-01-06 14:17 -------
More comments on the implementation:

A pathname based implementation doesn't play well for some situations
when the file is unlinked or when the pathname needs special handling.
I think what you can do is to support both ways:

typedef struct apr_file_xattr_t;

apr_file_xattr_open(apr_file_xattr_t **xattr, const char *pathname, ....)
apr_file_xattr_fdopen(apr_file_xattr_t **xattr, apr_file_t *file, ....)
apr_file_xattr_destroy(apr_file_xattr_t *xattr);

and in the implementation you use which one is most convenient, the file
handle or the pathname, even when the pathname only is used you can keep
the file descriptor open between xattr calls. This is the way most APR
interfaces are implemented and tends to make more sense APR/API wide.

I think you don't need to pass flags/pool to each function, by using the
above interface you can keep the flags inside the apr_file_xattr_t struct.

The way the files are built should be done the other way around, look at
how the atomic files are built. Since you already have the USE_XATTR_*
macros you just need to cover each file if a #if on the macro. This way
all the files are built and dependencies are automatically tracked.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2007-12-21 22:54 -------
Created an attachment (id=21306)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21306&action=view)
apxattr - sample utility to view/modify extended attributes on files


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2008-02-04 05:31 -------
Created an attachment (id=21465)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21465&action=view)
header for revised interface

Here is the header for the revised interface (before I get too deep into the
implementation):

  * A new type apr_xattr_t representing an extended attribute context opened
    on a file or directory. apr_xattr_(get|set|exists|list|remove) now take
    apr_xattr_t* instead of a path name.
  * New methods apr_xattr_(file|path|dir)_open and apr_xattr_destroy
  * Allows access to extended attributes on a file or directory specified by
    a path name, on an already open apr_file* or on an already open apr_dir*
    (apr_xattr_open_path version is required in cases where we have a path name

    that could point to either a file or directory, avoiding the need for an
    extra apr_stat and a apr_file_open or apr_dir_open).
  * flags argument on apr_xattr_(get|exists|list|remove) retained to allow for
    potential addition of namespace flags (only set requires flags presently).
  * pool argument dropped from apr_xattr_(get|exists|list|remove) as the pool
    is specified when opening the context.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2007-12-21 21:43 -------
Attached patch implements changes based on feedback from the apr mailing list

Changes (based on the initial patches sent to the list):

* Moved headers out of apr_file_info.h into apr_file_xattr.h
* Change interface from const char* filename to use apr_file_t *file
* Removed APR_XATTR_NOFOLLOW from flags
  (in line with change to apr_file_t* based interface)
* Changed flags apr_int32_t from to apr_uint32_t
* Updated tests and sample client apxattr to API revisions
* Clarified apr_get_xattr docs on pool allocation of void **value
* Moved from file_io/unix/xattr_(darwin|linux|freebsd|solaris).c to
  file_io/unix/xattr/(darwin|linux|freebsd|solaris).c
* Added code to escape and unescape '/' characters in Solaris
  subfile (attribute) names. Also added special char test cases.
* Added APR_ENOTIMPL stubs for netware, os2, win32 and unsupported unix
* Added --disable-xattr configure flag (enabled by default if detected)



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127


michael@metaparadigm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21303|0                           |1
        is obsolete|                            |
  Attachment #21329|0                           |1
        is obsolete|                            |




------- Additional Comments From michael@metaparadigm.com  2007-12-28 18:45 -------
Created an attachment (id=21330)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21330&action=view)
Complete re-diff with last fixes added

Also contains a small number of whitespace changes as a small number of lines
in the first patch had tabs instead of 8 spaces.

I have (setq indent-tabs-mode nil) in my .emacs now :)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127


michael@metaparadigm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21330|0                           |1
        is obsolete|                            |




------- Additional Comments From michael@metaparadigm.com  2008-01-05 06:50 -------
Created an attachment (id=21346)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21346&action=view)
Revised build infrastrucutre, headers, implementations and tests

* Change interface from apr_file_t *file to const char *pathname
  This was needed to support extended attributes on directories and to
  keep the interface simple.

  The use case that the interface was created for (mod_dav_fs xattr props)
  has a pathname that could point to either a file or a directory.
  With an apr_file_t (and the addition of an apr_dir_t based interface),
  it would require an apr_stat followed by an apr_file_open or apr_dir_open
  and then to conditionally call the file_xattr or dir_xattr interface.

* Added APR_ENOATTR and APR_STATUS_IS_ENOATTR() definitions to apr_errno.h

* Added interface apr_file_xattr_exists() to check for the existence of
  an attribute but without the overhead of fetching and allocating space

* Doxygen documentation updates

* Made solaris implementation disambiguate return in cases where the
  attribute does not exist but the file does. Previously it returned
  ENOENT when it should have returned ENOATTR

* Added test cases for APR_STATUS_IS_ENOATTR() return when getting or
  removing a non-existent attribute

* Changed set replace test case to check for APR_STATUS_IS_ENOATTR()
  when setting a non existant attribute with the APR_XATTR_REPLACE flag

* Changed set create test cases to check for APR_STATUS_IS_EEXISTS()
  when setting an existing attribute with the APR_XATTR_CREATE flag

* Added test cases for APR_STATUS_IS_ENOENT() return when getting, setting
  listing, or removing an attribute from a file that does not exist

* Added test cases for extended attributes on directories

* Changed example apxattr.c to use revised interface


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2008-01-06 18:24 -------
(In reply to comment #10)
> typedef struct apr_file_xattr_t;
> 
> apr_file_xattr_open(apr_file_xattr_t **xattr, const char *pathname, ....)
> apr_file_xattr_fdopen(apr_file_xattr_t **xattr, apr_file_t *file, ....)
> apr_file_xattr_destroy(apr_file_xattr_t *xattr);

OK. I like this approach. I was also wondering about dropping the _file
prefix due to them also working on directories (apr_stat as an example):

apr_xattr_path_open(apr_file_xattr_t **xattr, const char *pathname, ....)
apr_xattr_file_open(apr_file_xattr_t **xattr, apr_file_t *file, ....)
apr_xattr_dir_open(apr_file_xattr_t **xattr, apr_dir_t *dir, ....)
apr_xattr_get(apr_file_xattr_t *xattr, const char *name, ...)
...
apr_xattr_destroy(apr_file_xattr_t *xattr)

with a cleanup similar to file_open (call to apr_xattr_destroy explicitly runs
cleanup otherwise it is run at pool cleanup time - path_open variant cleanup
would close the fd but not the file_open or dir_open variants).

> I think you don't need to pass flags/pool to each function, by using the
> above interface you can keep the flags inside the apr_file_xattr_t struct.

The APR_XATTR_NOFOLLOW could be used on the pathname _open variants but the
flags are needed on xattr_set for APR_XATTR_CREATE or APR_XATTR_REPLACE. This
needs to be operation specific (not chosen at open time).

It may be a good idea to keep flags on all ops as in the future we could add
APR_NAMESPACE_SYSTEM for example which would be relevant for all functions e.g.
set|get|list|remove and should be operation specific (not chosen at open time).

> The way the files are built should be done the other way around, look at
> how the atomic files are built. Since you already have the USE_XATTR_*
> macros you just need to cover each file if a #if on the macro. This way
> all the files are built and dependencies are automatically tracked.

OK. I'll look into this. Thanks for the feedback. I'll roll another patch in a
few days time based on this approach.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From davi@apache.org  2008-02-02 07:16 -------
Any progress? I'm looking forward to seeing the new version.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2007-12-28 18:39 -------
Created an attachment (id=21329)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21329&action=view)
Removes null check for value (correct APR behaviour) and adds EINTR read/write
retries on solaris


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127


michael@metaparadigm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21306|0                           |1
        is obsolete|                            |




------- Additional Comments From michael@metaparadigm.com  2008-01-05 06:51 -------
Created an attachment (id=21347)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21347&action=view)
apxattr - sample utility to view/modify extended attributes on files

Revised version of apxattr that uses pathname based interface.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2007-12-21 21:41 -------
Created an attachment (id=21303)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21303&action=view)
Build infrastrucutre, headers and implementations

Currently implemented for Linux, Solaris, FreeBSD and Mac OS X

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127


iwade@optusnet.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iwade@optusnet.com.au




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2008-01-05 06:45 -------
I have been working on an implementation of mod_dav_fs properties using this
extended attribute interface and have found that the apr_file_t* based interface
is not really that usable (especially with regards to directories). It would
need apr_dir_xattr_(get|set|list|remove) interfaces added doubling the number of
functions. I had very ugly code as follows (where const char *pathname would be
much more appropriate) - needs an apr_stat to work out if it is a file or dir.

    apr_finfo_t finfo;
    apr_dir_t *dir = NULL;
    apr_file_t *file = NULL;
    apr_os_dir_t *osdir;
    apr_os_file_t osfile;
    apr_status_t status;

    status = apr_stat(&finfo, fname, APR_FINFO_TYPE, p);
    if(status != APR_SUCCESS) {
        return status;
    }
    if(finfo.filetype == APR_DIR) {
        status = apr_dir_open(&dir, fname, p);
        if(status != APR_SUCCESS) {
            return status;
        }
        apr_os_dir_get(&osdir, dir);
        osfile = dirfd(osdir); /* non-portable */
        apr_os_file_put(&file, &osfile, 0, p);
    } else {
        status = apr_file_open(&file, fname, APR_READ | APR_WRITE, 0, p);
        if(status != APR_SUCCESS) {
            return status;
        }
    }
    status = apr_file_xattr_get(file, attrname, &attrvalue, &attrsize, 0);

where if I had a pathname based interface it would just be:

    status = apr_file_xattr_get(fname, attrname, &attrvalue, &attrsize, 0);

I have since changed the interface back to my original proposal of const char
*pathname (as well as adding more test cases). Patches to follow.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127


michael@metaparadigm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21346|0                           |1
        is obsolete|                            |
  Attachment #21465|0                           |1
        is obsolete|                            |




------- Additional Comments From michael@metaparadigm.com  2008-02-06 00:55 -------
Created an attachment (id=21482)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21482&action=view)
Revised build infrastrucutre, headers, implementations and tests

Here is the implementation based on the proposed changes.

* Moved to toplevel xattr module and made all unix implementations build with 
  ifdef'd empty units on inactive platforms as per atomics.
  This fixes the source dependency problem.
* Function name prefixes changed from apr_file_xattr_ to apr_xattr_
  (to avoid confusing function names, plus we support dirs - see next item)
* Added apr_xattr_open_path, apr_xattr_open_file, apr_xattr_open_dir
  It is now possible to access extended attributes from an open file handle.
  Implementations use file descriptor based interfaces instead of path based.
* Added new type apr_xattr_t (allocated by above methods) and new function
  apr_xattr_destroy (will close the fd only if opened with apr_xattr_open_path)

* apr_xattr_(get|set|exists|list|remove) now take apr_xattr_t* instead of path
* Drop APR_XATTR_NOFOLLOW flag as it does not make sense with new interface.
  There is no similar support on apr_file_open for this flag anyway.
* Updated test cases to revised interface


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2008-01-05 06:57 -------
A httpd mod_dav_fs xattr properties implementation that uses these interfaces:

  http://privsep.org/ModDavExtendedAttributes


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127





------- Additional Comments From michael@metaparadigm.com  2008-02-03 05:17 -------
Thanks for the encouragement. I am sort of half way. I had to suspend my efforts
due to some pressing work on a competition entry. I will have some free time to
continue this over the next week.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


DO NOT REPLY [Bug 44127] - File Extended Attributes Support

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44127


michael@metaparadigm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21347|0                           |1
        is obsolete|                            |




------- Additional Comments From michael@metaparadigm.com  2008-02-06 00:56 -------
Created an attachment (id=21483)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21483&action=view)
apxattr - sample utility to view/modify extended attributes on files

Updated sample utility to use revised interface

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org