cp --preserve doesn't work as expected under ubuntu 11.10
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have been struggling with a very strong issue after upgraded to Ubuntu 11.10 (Oneiric Ocelot), and finally found out this is from a low level error from ubuntu - the root cause is because cp command with the switch of -a when copy a folder doesn't work as expected of "-dR --preserve=all" from cp --help.
#cp --help
...
Mandatory arguments to long options are mandatory for short options too.
-a, --archive same as -dR --preserve=all
...
Under Ubuntu 11.04, when copy folders, all the attributes will be preserved with the --preserve option, but with Ubuntu 11.10, some attributes will be lost.
Here is a simple test procedure.
Note: exiaoy is below to administrator group.
1. Create a folder say test
#mkdir test
#ls -all
drwxr-xr-x 2 exiaoy exiaoy 4096 2011-12-08 23:14 test
2. Trying to cp it with -a.
#cp -a test test1
Under Ubuntu 11.10,
#ls -all
drwx------ 2 exiaoy exiaoy 4096 2011-12-08 23:14 test1
Yes, with the --preserve=all option, you are still losing all attributes not owned by owner.
Not sure if this is from any policy changes from ubuntu due to security concern, please let me know if this is work as designed.
[Workaround]
1. Use "--backup -R" options
2. Use "-dR" only without "--preserve" option
bash is used for the case.
description: | updated |
description: | updated |
affects: | bash (Ubuntu) → coreutils (Ubuntu) |