bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cp/mv: xattr support


From: Kamil Dudka
Subject: Re: [PATCH] cp/mv: xattr support
Date: Tue, 18 Nov 2008 19:30:13 +0100
User-agent: KMail/1.9.9

On Saturday 15 November 2008 18:12:09 Jim Meyering wrote:
> Then it looks like you can adjust your patch to check for, and use,
> attr_copy_fd, rather than attr_copy_file.  The only reason we use
> name-oriented interfaces (rather than fd-oriented ones) in copy.c
> is when there is no fd-oriented analog.
This seems to be trivial change in function copy_reg, but I can't see any easy 
solution for copy_internal function. So in the attached patch are used both 
variants:
        copy_attr_by_fd - fd-oriented
        copy_attr_by_name - name-oriented

> Also, please avoid this warning (seen at least on rawhide):
>
>   copy.c:160: warning: passing argument 4 of 'attr_copy_file' from
> incompatible pointer type
It was actually a bug. It is fixed and tested in the attached patch. It is not 
easy to cause error within libattr. I tested it with malformed libattr forced 
by LD_PRELOAD, but no idea how to do this automatically.

> From /usr/include/attr/libattr.h:
>
>   extern int attr_copy_file (const char *, const char *,
>                              int (*) (const char *, struct error_context
> *), struct error_context *);
>   extern int attr_copy_fd (const char *, int, const char *, int,
>                            int (*) (const char *, struct error_context *),
>                            struct error_context *);
>
> When the above is fixed, maybe copy_attr_error will be gone.
Looking at libattr/attr_copy_fd.c code I can see it needs to print error 
messages in the fd-oriented variant as well.

> If not, rewrite copy_attr_error not to use xmalloc (the comment
> there is now false: you can use gnulib's verror module),
> since copy.c is intended to be library-grade, when feasible.
Thanks for advice, rewritten to use verror module...

Let me just mention the patch for cp/mv -n option:
http://lists.gnu.org/archive/html/bug-coreutils/2008-10/msg00298.html

What is the status of this patch?


Kamil

Attachment: 0001-cp-mv-add-xattr-support.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]