tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ Help! - Starting tcsh as default shell

mounted file systems and permissions ▻

How to avoid changes the file date when using cp

In article <7jk07n$ee$1@nnrp1.deja.com>,  <dharzhak@my-deja.com> wrote:
>For security reasons, it's a good thing that there is no way around it.

Sorry, but as other posters have pointed out, this is simply untrue.
The utimes(2) system call permits the owner of a file (or the superuser,
of course) to set the atime and mtime to anything they wish.  Commands
like `cp -p' and the GNU version of `touch' use this.

The only timestamp that cannot be set arbitrarily is the ctime; using
utimes(2) will always update the ctime to the current time.

Tim.
--
Tim Goodwin   | `I can't believe that someone is releasing
University of | something called "Unix" without something
Leicester, UK | called "/bin/sh".' -- Randal L. Schwartz

Original headers:

From: tjg@ltpcg.star.le.ac.uk (Tim J Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: How to avoid changes the file date when using cp (edi)
Date: 9 Jun 1999 11:43:12 +0100
Organization: University of Leicester, UK
Message-ID: <7jlgg0$hvb$1@ltpcg.star.le.ac.uk>
References: <xtd73.3$vZ1.379@dummy.bahnhof.se> <7jk07n$ee$1@nnrp1.deja.com>

△ comp.unix.shell △

◅ Help! - Starting tcsh as default shell

mounted file systems and permissions ▻