Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Oct 2008 16:51:17 +0100
From:      Jilles Tjoelker <jilles@stack.nl>
To:        freebsd-hackers@freebsd.org
Subject:   Re: open(2) and O_NOATIME
Message-ID:  <20081031155117.GA55445@stack.nl>
In-Reply-To: <20081031134842.GA15218@psconsult.nl>
References:  <20081030154711.GA8416@icarus.home.lan> <490A6A8A.7080504@delphij.net> <20081031024748.GA20319@icarus.home.lan> <a2b6592c0810310104s706e77b4m7534eccf7b846a81@mail.gmail.com> <20081031134842.GA15218@psconsult.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 31, 2008 at 02:48:42PM +0100, Paul Schenkeveld wrote:
> utimes(2) allows non-root users to (re)set atime provided they own the
> file or have write permission.  Having O_NOATIME follow the same rules
> would not break any assumed security any further than utimes(2) already
> does but greatfully benefit all kind of backup programs.

This is not entirely correct. utimes(2) with NULL timestamps (reset
atime and mtime to current time) is allowed to root, owner or with write
permission, but utimes(2) with given timestamps is only allowed to root
and owner. O_NOATIME seems equivalent to the latter, and in fact this is
the case in Linux (if someone else than root or the owner tries to open
a file with O_NOATIME, they get EPERM).

There's only a small detail missing: any utimes(2) call updates the
ctime, so you can see "something" happened to the file. Linux's
O_NOATIME does not update any times at all (this speeds up things).

Anyway, O_NOATIME (only for root/owner) seems a useful feature.

-- 
Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081031155117.GA55445>