Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cp: failed to get attributes[solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Taladar
Guru
Guru


Joined: 09 Oct 2004
Posts: 458
Location: Bielefeld, Germany

PostPosted: Thu Sep 15, 2005 9:32 pm    Post subject: cp: failed to get attributes[solved] Reply with quote

Either I made an error I just don't see or "cp" has a bug.
I reduced it to the following test case:

Preparations (in /home/taladar):
Code:

mkdir testdir
cd testdir
mkdir source target source/dirlevel1 source/dirlevel1/dirlevel2
touch source/dirlevel1/dirlevel2/file
chmod 777 source/dirlevel1/dirlevel2 source/dirlevel1/dirlevel2/file


which yields the following directory structure (output of "ls -lR"):

Code:

.:
total 0
drwxr-xr-x  3 taladar users 22 Sep 15 23:01 source
drwxr-xr-x  2 taladar users  6 Sep 15 23:21 target

./source:
total 0
drwxr-xr-x  3 taladar users 22 Sep 15 23:02 dirlevel1

./source/dirlevel1:
total 0
drwxrwxrwx  2 taladar users 17 Sep 15 23:02 dirlevel2

./source/dirlevel1/dirlevel2:
total 0
-rwxrwxrwx  1 taladar users 0 Sep 15 23:02 file

./target:
total 0


When I then call cp with the following parameters:
Code:

cp -p --parent /home/taladar/testdir/source/dirlevel1/dirlevel2/file /home/taladar/testdir/target


I get the following error message (and cp returns a non-zero exit code):

Code:

cp: failed to get attributes of `home/taladar/testdir/source/dirlevel1/dirlevel2': No such file or directory


The directory and file structure is duplicated as expected (no error here) but the permissions are different:

Code:

.:
total 0
drwxr-xr-x  3 taladar users 22 Sep 15 23:01 source
drwxr-xr-x  3 taladar users 17 Sep 15 23:22 target

./source:
total 0
drwxr-xr-x  3 taladar users 22 Sep 15 23:02 dirlevel1

./source/dirlevel1:
total 0
drwxrwxrwx  2 taladar users 17 Sep 15 23:02 dirlevel2

./source/dirlevel1/dirlevel2:
total 0
-rwxrwxrwx  1 taladar users 0 Sep 15 23:02 file

./target:
total 0
drwx------  3 taladar users 20 Sep 15 23:22 home

./target/home:
total 0
drwx------  3 taladar users 20 Sep 15 23:22 taladar

./target/home/taladar:
total 0
drwx------  3 taladar users 19 Sep 15 23:22 testdir

./target/home/taladar/testdir:
total 0
drwx------  3 taladar users 22 Sep 15 23:22 source

./target/home/taladar/testdir/source:
total 0
drwx------  3 taladar users 22 Sep 15 23:22 dirlevel1

./target/home/taladar/testdir/source/dirlevel1:
total 0
drwx------  2 taladar users 17 Sep 15 23:22 dirlevel2

./target/home/taladar/testdir/source/dirlevel1/dirlevel2:
total 0
-rwxrwxrwx  1 taladar users 0 Sep 15 23:02 file


Especially noticable is the fact that the permissions are neither the default ones nor the changed permissions of the original files.

I use neither extended attributes nor acls. My coreutil USE-flags and version follow (part of the "emerge -pv coreutils" output):
Code:

sys-apps/coreutils-5.3.0-r1  -acl -build +nls (-selinux) -static


Can anyone confirm wether this is a bug or an error on my part?

Edit:
Solved, according to the coreutils bug mailing list it is a bug that is fixed in the latest cvs version
*wonders if writing a coreutils-cvs ebuild is a good idea* :D
Back to top
View user's profile Send private message
Taladar
Guru
Guru


Joined: 09 Oct 2004
Posts: 458
Location: Bielefeld, Germany

PostPosted: Fri Sep 16, 2005 1:19 am    Post subject: Reply with quote

I created a bug to ask for adding a fix from the cvs version to the ebuild: https://bugs.gentoo.org/show_bug.cgi?id=106133
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum