Re: EXT2_UNRM_FL

Tuomas Heino (iheino@cc.hut.fi)
Thu, 4 Mar 1999 19:47:56 +0200 (EET)


On Wed, 3 Mar 1999, Theodore Y. Ts'o wrote:

> Date: Wed, 3 Mar 1999 18:21:48 -0500 (EST)
> From: Alexander Viro <viro@math.psu.edu>
>
> Sorry, I've misparsed it ;-< What I was thinking of is
> NO_UNLINK stuff - behaves as APPEND_ONLY and IMMUTABLE wrt link
> creation/removing and gives no protection to the contents of file.
> It is useful in many situations and it *is* easy to implement.
> But yes, UNRM is different... Actually I'ld propose to take one more bit
> of attributes for that. UFS has such thing (ignored in Linux) and VFS
> support for that would be very easy to add (I already did VFS part and
> changes to UFS driver). Could you comment on that? All I need on ext2 side
> is a spare bit in ext2_i.i_flags (user-visible).
>
> I guess I'm little confused about how NO_UNLINK would be useful. Does
> it protect against file renames as well as unlinks? What about
> truncates? If it doesn't protect the data, what are the applications
> where it's useful?

Very useful for all kinds of "must-exist" files... IAW lock files etc
(especially when you're using a stupid Linux distribution which keeps
messing with your files and you're too lazy to check out what it's doing;)

... now this raises another question to my mind:
Would it be possible to create immutable symlinks in a clean way w/ ext2?

# pwd
/var/run
# ls -ld . mysql* mysql/*
drwxr-xr-x 4 root root 1024 Mar 4 19:44 .
drwxr-xr-x 2 mysql mysql 1024 Feb 23 15:56 mysql
lrwxrwxrwx 1 root root 16 Mar 4 19:44 mysql.sock -> mysql/mysql.sock
srwxrwxrwx 1 mysql root 0 Feb 23 15:56 mysql/mysql.sock
-rw-r--r-- 1 mysql root 3 Feb 23 15:56 mysql/mysqld.pid
lrwxrwxrwx 1 root root 16 Mar 4 19:44 mysqld.pid -> mysql/mysqld.pid

... get my point on why immutable symlinks would be very useful? ;)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/