emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#16131: closed (copy extended attributes of a symbo


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#16131: closed (copy extended attributes of a symbolic link)
Date: Tue, 06 May 2014 09:35:02 +0000

Your message dated Tue, 06 May 2014 10:33:50 +0100
with message-id <address@hidden>
and subject line Re: bug#16131: copy extended attributes of a symbolic link
has caused the debbugs.gnu.org bug report #16131,
regarding copy extended attributes of a symbolic link
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
16131: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16131
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Re: copy extended attributes of a symbolic link Date: Fri, 13 Dec 2013 08:43:36 -0800 User-agent: SquirrelMail/1.4.22
I wonder if this is a bug or I just did it the wrong way.  I can't seem to
copy extended attributes of symbolic links.  Example is to populate the
upperdir of an overlayfs in Linux.

coreutils 8.21
libattr 2.4.47

I can only use mv to preserve extended attributes of symbolic links,
and only when the destination is in the same filesystem.  (It looks like
mv summons copy when destination is in a different filesystem)

Steps to reproduce:  (The same happens in either ext2 or tmpfs)

--- cut here ---
touch a
ln -sv '(overlay-whiteout)' b

| ‘b’ -> ‘(overlay-whiteout)’

setfattr -hn trusted.overlay.whiteout -v y a
setfattr -hn trusted.overlay.whiteout -v y b
getfattr -hn trusted.overlay.whiteout a

| # file: a
| trusted.overlay.whiteout="y"

getfattr -hn trusted.overlay.whiteout b

| # file: b
| trusted.overlay.whiteout="y"

cp -vaP a c

| ‘a’ -> ‘c’

cp -vaP b d

| ‘b’ -> ‘d’

getfattr -hn trusted.overlay.whiteout c

| # file: c
| trusted.overlay.whiteout="y"

getfattr -hn trusted.overlay.whiteout d

| d: trusted.overlay.whiteout: No such attribute

--- cut here ---




--- End Message ---
--- Begin Message --- Subject: Re: bug#16131: copy extended attributes of a symbolic link Date: Tue, 06 May 2014 10:33:50 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2
On 05/06/2014 07:22 AM, Bernhard Voelker wrote:
> On 05/06/2014 03:00 AM, Pádraig Brady wrote:
>>> I'll add a root only test later along the lines of the above.
>> and the test...
> 
> Both, the change in copy.c and the test look good to me.
> 2 minor nits:
> 
>> --- a/tests/cp/cp-mv-enotsup-xattr.sh
>> +++ b/tests/cp/cp-mv-enotsup-xattr.sh
>> @@ -106,4 +106,24 @@ mv xattr/a noxattr/ 2>err || fail=1
>>  test -s noxattr/a         || fail=1  # destination file must not be empty
>>  test -s err               && fail=1  # there must be no stderr output
>>
>> +# This should pass and copy xattrs of the symlink
>> +# since they're not in the 'user.' namespace.
>> +# Up to and including coreutils-8.22 xattrs of symlinks
>> +# were not copied across file systems.
>> +ln -s 'foo' xattr/symlink || framework_failure_
>> +# Note 'user.' namespace is only supported on regular files/dirs
>> +# so use the 'trusted.' namespace here
>> +txattr='trusted.overlay.whiteout'
>> +if setfattr -hn trusted.overlay.whiteout -v y xattr/symlink; then
> 
> s/trusted,overlay.whiteout/"$txattr"/
> 
>> +  # Note only root can read the 'trusted.' namespace
>> +  if getfattr -h -m- -d xattr/symlink | grep -F "$txattr"; then
>> +    mv xattr/symlink noxattr/ || fail=1
>> +    getfattr -h -m- -d noxattr/symlink | grep -F "$txattr" || fail=1
>> +  else
>> +    echo "failed to get 'trusted.' xattr of symlink" >&2
> 
> This message looks like a failure. Maybe add something like
> "skipping this part" to make it clear.
> 
>> +  fi
>> +else
>> +  echo "failed to set 'trusted.' xattr of symlink" >&2
>> +fi
>> +
>>  Exit $fail

Both adjustments make sense.
Done and pushed.

thanks,
Pádraig.



--- End Message ---

reply via email to

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