Bug 190601 - cp -p fails if /proc is not mounted
Summary: cp -p fails if /proc is not mounted
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Pete Graner
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-03 20:16 UTC by Kirill Kolyshkin
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-21 19:16:55 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Kirill Kolyshkin 2006-05-03 20:16:19 UTC
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 13:26:17 UTC
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 Kirill Kolyshkin 2006-05-16 15:09:23 UTC
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 Kirill Kolyshkin 2006-05-16 15:23:48 UTC
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 16:18:06 UTC
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.