bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: moving timestamp preservation to the last step in copy_internal() /


From: Paul Eggert
Subject: Re: moving timestamp preservation to the last step in copy_internal() / copy_reg()
Date: Tue, 09 May 2006 00:45:45 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Mike Frysinger <address@hidden> writes:

> a user pointed out that `cp -p` failed to preserve times on a nfs mount:
> http://bugs.gentoo.org/132673

That bug report talks about mtime, but then you write:

> this is because changing ownership on a nfs mount updates the ctimes:
> touch foo
> # stat foo
>   File: `foo'
>   Size: 0               Blocks: 0          IO Block: 16384  regular empty file
> Device: eh/14d  Inode: 584188      Links: 1
> Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (  250/ portage)
> Access: 2006-05-08 22:34:13.621879904 -0400
> Modify: 2006-05-08 22:34:13.621879904 -0400
> Change: 2006-05-08 22:34:13.621879904 -0400
> # chown 1 foo
> # stat foo
>   File: `foo'
>   Size: 0               Blocks: 0          IO Block: 16384  regular empty file
> Device: eh/14d  Inode: 584188      Links: 1
> Access: (0644/-rw-r--r--)  Uid: (    1/     bin)   Gid: (  250/ portage)
> Access: 2006-05-08 22:34:13.621879904 -0400
> Modify: 2006-05-08 22:34:13.621879904 -0400
> Change: 2006-05-08 22:34:21.628662688 -0400

Here, your text, and the example, show that only the ctime changed.
But the ctime is supposed to change when you change the ownership.

So I don't see the bug here.

I can't reproduce the problem with mtime, on my host, on an NFS mount:

  1016-kiwi $ df -k .
  Filesystem           1K-blocks      Used Available Use% Mounted on
  ostrich:/export/ostrich/f2
                        15490539  12555430   2780204  82% /u/f2
  1017-kiwi $ uname -a
  SunOS kiwi 5.8 Generic_117350-33 sun4u sparc SUNW,Sun-Fire-280R Solaris
  1018-kiwi $ cp --version | sed 1q
  cp (GNU coreutils) 5.94
  1019-kiwi $ cp -p /etc/motd motd
  1020-kiwi $ ls -l --full-time /etc/motd motd
  -rw-r--r-- 1 root   sys     59 2001-10-18 04:51:05.000000000 -0700 /etc/motd
  -rw-r--r-- 1 eggert faculty 59 2001-10-18 04:51:05.000000000 -0700 motd


> so would there be any real detrimental effects with the attached patch ? 

Yes, that patch won't work on systems that let ordinary users give
away files via chown.  After the chown succeeds, you can't then set
the time stamps, since you no longer own the file.

But I'm still puzzled by the overall bug report, since it seems to
have mtime and ctime muddled.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]