Bug 190601 - cp -p fails if /proc is not mounted
cp -p fails if /proc is not mounted
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Pete Graner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-03 16:16 EDT by Kir Kolyshkin
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-21 15:16:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Kir Kolyshkin 2006-05-03 16:16:19 EDT
There is a bug in coreutils cp: if /proc is not mounted, cp -p can not set file
times and exits with 1 exit code. The bug was found while creating FC5 OS image
for OpenVZ virtual environment.

It is a mainstream coreutils bug, full description from me is here:
http://lists.gnu.org/archive/html/bug-coreutils/2006-04/msg00091.html

The bug is confirmed by coreutils maintainer and the patch was made:
http://lists.gnu.org/archive/html/bug-coreutils/2006-04/msg00095.html

The fix has made it into the coreutils CVS (lib/utimens.c rev. 1.12):
http://cvs.savannah.gnu.org/viewcvs/coreutils/lib/utimens.c?rev=1.12&root=coreutils&view=log

I suggest to fix it in FC5 as well before newer coreutils comes out. It is a
major fault to depend on /proc for file copying.
Comment 1 Tim Waugh 2006-05-16 09:26:17 EDT
Please try this test update:

https://www.redhat.com/archives/fedora-test-list/2006-May/msg00175.html

Does that fix the problem for you?
Comment 2 Kir Kolyshkin 2006-05-16 11:09:23 EDT
Unfortunately not :( Below is the testing log.

If you will look at the CVS page again, you'll notice that this change has been
made after tagging 5.95:
http://cvs.savannah.gnu.org/viewcvs/coreutils/lib/utimens.c?rev=1.12&root=coreutils&view=log

Looks like you have to maintain it as a patch for now.


kir@dionysos ~ $ sudo vzctl enter 555
entered into VPS 555
-bash-3.1# wget
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/testing/5/i386/coreutils-5.95-1.1.i386.rpm
--19:11:46-- 
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/testing/5/i386/coreutils-5.95-1.1.i386.rpm
           => `coreutils-5.95-1.1.i386.rpm'
Resolving download.fedora.redhat.com... 209.132.176.20, 209.132.176.220,
209.132.176.221, ...
Connecting to download.fedora.redhat.com|209.132.176.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3,679,906 (3.5M) [application/x-rpm]

100%[====================================>] 3,679,906    287.52K/s    ETA 00:00

19:12:01 (252.43 KB/s) - `coreutils-5.95-1.1.i386.rpm' saved [3679906/3679906]

-bash-3.1# rpm -Uhv coreutils-5.95-1.1.i386.rpm
warning: coreutils-5.95-1.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID
30c9ecf8
Preparing...                ########################################### [100%]
   1:coreutils              ########################################### [100%]
-bash-3.1# umount /proc
-bash-3.1# ls -l /proc/
total 0

[*** BUG ***]
-bash-3.1# touch /tmp/file
touch: setting times of `/tmp/file': Function not implemented
-bash-3.1# rpm -qf /bin/touch
coreutils-5.95-1.1
-bash-3.1# ls -l /tmp/file
-rw-r--r-- 1 root root 0 May 16 19:12 /tmp/file
[*** BUG ***]
-bash-3.1# cp -p /tmp/file  /tmp/file2
cp: preserving times for `/tmp/file2': Function not implemented
-bash-3.1# echo $?
1
-bash-3.1# rpm -q coreutils
coreutils-5.95-1.1
Comment 3 Kir Kolyshkin 2006-05-16 11:23:48 EDT
Hmm looks like coreutils-5.95 release was done on May 12th, but still the fix,
which was commited into the CVS a month before that, on Apr 15th, is not
included into this release.

Here is the diff itself:
http://cvs.savannah.gnu.org/viewcvs/coreutils/lib/utimens.c?root=coreutils&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/coreutils/lib/utimens.c?root=coreutils&r1=1.11&r2=1.12&makepatch=1&diff_format=u
Comment 4 Tim Waugh 2006-05-16 12:18:06 EDT
Please try coreutils-5.95-1.2 when it appears in updates-testing.

Note You need to log in before you can comment on or make changes to this bug.