Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Permissions are like Rubik's cubes [SOLVED]



On Tue, 2 Sep 2008, Stephen J. Turnbull wrote:

Dave M G writes:

> I always thought the whole permissions deal was a matter of the
> operating system, not the disk file system.

Koan: so how are permissions preserved with removable media (across
mount points or even moving between hosts)?  There has to be data
regarding permissions associated with each file, and in fact it lives
in the file's directory.

Actually, it lives in the file's inode. The directory contains just filenames and pointers to inodes.


The permissions and ownerships are stored in the inode itself.

That's why if you change the permissions on a hard link, all other hard links also show the same permissions change:

kanemochi% touch a
kanemochi% ln a b
kanemochi% ls -li a b
49587 -rw-r--r--  2 devin  wheel  0 Sep  2 12:05 a
49587 -rw-r--r--  2 devin  wheel  0 Sep  2 12:05 b
kanemochi% chmod 400 a
kanemochi% ls -li a b
49587 -r--------  2 devin  wheel  0 Sep  2 12:05 a
49587 -r--------  2 devin  wheel  0 Sep  2 12:05 b

A minor point, but worth being aware of.
--
Tod


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links