]> git.hungrycats.org Git - linux/commit
[PATCH] disallow utime{s}() on immutable or append-only files
authorAndrew Morton <akpm@osdl.org>
Tue, 23 Sep 2003 16:43:18 +0000 (09:43 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 23 Sep 2003 16:43:18 +0000 (09:43 -0700)
commit905f90fe27a234815bb29fa850af396c537c5960
tree78bf0b026d0465e4ddb04368322003ed85e6ffa9
parent535231e8252eea14abf4f14d28f6c1c03f5e0f02
[PATCH] disallow utime{s}() on immutable or append-only files

From: Ethan Benson <erbenson@alaska.net>

Currently Linux allows the use of the utime() and utimes() syscalls on
immutable or append-only files, this is incorrect.

utime{s}() is not supposed to work if you lack write access to a file,
in the case of an immutable file NOBODY has write access.

for an append-only file it only makes sense to be able to update its
time to present, not the past.

I have checked BSD, and they implement the behavior I propose, for
immutable files utime() and utimes() fail.  for append-only files they
fail if the time argument is not NULL.
fs/open.c