Package: coreutils
Version: 5.93-5
Followup-For: Bug #340236

I hit this problem as well today.  Poking around with strace, I noticed
several things:

1. cp executes utimes before closing the file.  This might be a problem,
although it seems to work on local destinations.

open("baz", O_WRONLY|O_TRUNC|O_LARGEFILE) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(4, "foo\n", 4)                    = 4
utimes("/proc/self/fd/4", {1134767841, 0}) = 0
chmod("baz", 0100644)                   = 0
close(4)                                = 0

2. Timestamps of empty files are preserved, which reinforces the above
suspicion (no writes for empty file)

3. touch -r works correctly, and it also uses /proc/self/fd to refer to
the file, so that should be okay.

[EMAIL PROTECTED]:20 23:17:56 ~/roinaa/test$ echo "foo" >foo
[EMAIL PROTECTED]:20 23:18:29 ~/roinaa/test$ strace -e utimes touch -r foo bar
utimes("/proc/self/fd/0", {1134767841, 0}) = 0
[EMAIL PROTECTED]:20 23:18:34 ~/roinaa/test$ strace -e utimes cp -p foo baz
utimes("/proc/self/fd/4", {1134767841, 0}) = 0
[EMAIL PROTECTED]:20 23:18:37 ~/roinaa/test$ ls -l --full-time
total 8
-rw-r--r-- 1 tdb tdb 0 2005-12-16 23:18:29.000000000 +0200 bar
-rw-r--r-- 1 tdb tdb 4 2005-12-16 23:18:37.000000000 +0200 baz
-rw-r--r-- 1 tdb tdb 4 2005-12-16 23:18:29.000000000 +0200 foo


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14.3
Locale: LANG=C, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)

Versions of packages coreutils depends on:
ii  libacl1                       2.2.34-1   Access control list shared library
ii  libc6                         2.3.5-8.1  GNU C Library: Shared libraries an
ii  libselinux1                   1.26-1     SELinux shared libraries

coreutils recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to