Re: deny deleting a file for users
From: J Norfleet (jnorfleet_at_picusnet.com)
To: Brian Hatch <firstname.lastname@example.org>, Sandra Hernandez <email@example.com> Date: Mon, 2 Jun 2003 11:47:12 -0400
On Friday 30 May 2003 7:31 pm, Brian Hatch wrote:
> > I would like to know if there exist any way to deny deleting a file for a
> > user, but allow this user accessing, removing parts of this file or
> > append text?
> > We have problems in our systems because some users delete theirs own
> > nsmail file without notice what they are doing.
> The best thing I can come up with, without kernel mods or LKMs, would be
> to write a program that, as root, opens up in read mode all these files
> you don't want deleted, and then goes to sleep forever. It will have an
> open file descriptor, so when the user accidentally deletes the file,
> you can still get it back by copying it out of the /proc entry for the
> root "open all files" process, ala
> cp /proc/PID/fd/APPROPRIATE_FD /home/idiot/nsmail
> However this is a horrible kludge. I suggest that you take good backups
> and make them available to the users who delete their files by mistake.
> Or, let them feel the pain a few times until they stop doing it.
Create hard links. (Backup copy that changes when the original files do.)