| View previous topic :: View next topic |
| Author |
Message |
Taladar Guru

Joined: 09 Oct 2004 Posts: 458 Location: Bielefeld, Germany
|
Posted: Thu Sep 15, 2005 9:32 pm Post subject: cp: failed to get attributes[solved] |
|
|
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*  |
|
| Back to top |
|
 |
Taladar Guru

Joined: 09 Oct 2004 Posts: 458 Location: Bielefeld, Germany
|
|
| Back to top |
|
 |
|