This is what I think is happening.
In Unix the ability to delete a file is governed by the writeability of the directory that it is in. This ultimatly affects the writeability of the file. As a file can be deleted and replaced.
I can set the stick bit. This helps a bit, but is ignored for the owner of the file.
I realise that ultimately any permission can be changed by the owner. But is there a way to stop a file being deleted, in the absence of changing permission (by accident)?
I am interested for solutions, for Gnu/Linux. However if there is no solution for this one, then I would be interested in solutions for any Unix, including fringe variants (plan 9, mac-os, bsb, solaris, athena, etc. etc. ….).
Immutable bit chattr +i file
, can only be set by user with CAP_LINUX_IMMUTABLE
e.g. root
(So is not very useful).