• Andrew Morton's avatar
    [PATCH] disallow utime{s}() on immutable or append-only files · 905f90fe
    Andrew Morton authored
    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.
    905f90fe
open.c 22.3 KB