[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feature request for "find": -newer X Y file
From: |
Thomas Guettler |
Subject: |
Re: feature request for "find": -newer X Y file |
Date: |
Thu, 13 Jul 2006 22:28:05 +0200 |
User-agent: |
Mutt/1.5.9i |
On Tue, Jul 11, 2006 at 11:32:44AM +0200, Andreas Schwab wrote:
> Thomas Guettler writes:
>
> > Hi,
> >
> > The BSD find command has this feature:
> >
> > -newer X Y file
> > True if the current file has a more recent last access time ( X = a),
> > change time ( X = c), or modification time ( X = m) than the last
> > access time ( Y = a), change time ( Y = c), or modification time ( Y
> > = m) of file. In addition, if Y = t, then file is instead interpreted
> > as a direct date specification of the form understood by cvs(1). Note
> > that -newermm is equivalent to -newer.
>
> GNU find has all this functionality already, except you can't mix
> different types of times when using files as reference.
The manual[1] has this example:
touch -t 02010000 /tmp/stamp$$
find /usr -newer /tmp/stamp$$
rm -f /tmp/stamp$$
The above example is vulnurable to denial of service attacks. The PID of
the shell script can be guessed. If someone else creates the file
/tmp/stampGUESSEDPID before the code get executed, the timestamp of the
file can be faked, if the above code is run be a non-root user.
I think it is very sad, that you need the "touch". It would be better
if you can give the date as option.
[1]:
http://www.gnu.org/software/findutils/manual/html_node/find_html/Comparing-Timestamps.html
--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: address@hidden