Jump to content

Talk:File-system permissions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia


"Write-protected" files are in fact NOT protected from writing! FALSE

[edit]

This article says that in Unix-like systems The write permission grants the ability to modify a file. In other words, a file without write permission is unmodifiable. That is not true. In GNU bash (version 4.4.7) anybody can reproduce this:

$ ls -gGid --time-style=iso . *
3965287 drwx------ 2 2048 06-09 19:02 .
3965289 -r-------- 1    6 06-09 19:02 myfil
$ cat myfil
hello
$ cp --no-preserve=mode myfil xf
$ ls -gGid --time-style=iso . *
3965287 drwx------ 2 2048 06-09 19:11 .
3965289 -r-------- 1    6 06-09 19:02 myfil
3965305 -rw-rw-r-- 1    6 06-09 19:11 xf
$ echo world >>xf
$ cat xf
hello
world
$ unlink myfil
$ ls -gGid --time-style=iso . *.      # notice at this point no file named myfil exists
3965287 drwx------ 2 2048 06-09 19:15 .
3965305 -rw-rw-r-- 1   12 06-09 19:14 xf
$ mv xf myfil
$ ls -gGid --time-style=iso . *
3965287 drwx------ 2 2048 06-09 19:18 .
3965305 -rw-rw-r-- 1   12 06-09 19:14 myfil # at this point xf has been "renamed" to myfil retaining rw
$ cat myfil
hello
world
$

The directory of myfil was writable (to allow creating new files). And this is enough to replace the old myfil with a newer myfil! The inode number changes, but the users do not even notice it, and if so, it is usual for any text editor also to change inode numbers of (writable) files.

So maybe this is a design error (or weakness) in the Unix-like file system? The files, in the common sense, are not protected. Under file it (most likely) means the inode. The inode is (until its quick deletion) protected, but this means not much value for the user. — Preceding unsigned comment added by VillamGadner (talkcontribs) 18:53, 9 June 2017 (UTC)[reply]

I must disagree. The file called "myfil" that you end up with is not the same file you started with. It is in fact a different file in the file system because it is mapped to a different inode. Replacing a file with a modified copy is not the same as having write access to the original file just because you have write access to its directory. You never wrote to the original file, nor could you. 2001:470:D:468:7455:7A:1C17:3DB4 (talk) 04:31, 10 August 2017 (UTC)[reply]

words like usually, universally , commonly just add confusion

[edit]

Several of the paragraphs redundantly say the same things more than once. I have made a few attempts to simplify the article slightly. DGerman (talk) 19:58, 11 May 2021 (UTC)[reply]

File permissions in TRON

[edit]

In TRON, as far as I can tell, it is similar to POSIX file permissions but instead of one bit per permissions, it uses a 4-bit number for each permissions; if it is equal to or greater than the access level number of the process, then it can be accessed. (Zero is the most privileged access level, and therefore can access all files.) --Zzo38 (talk) 05:23, 27 March 2023 (UTC)[reply]

Less than accurate title

[edit]

The article is about permissions maintained per file-system item -- file or directory (or other things like symlinks); not the file-system per se. A file-system could have permissions other than permissions on the items. But it's hard to think of a more accurate title that is not wordy: File-system item permission, Permission (file-system item); or inaccurate: Permission (file). Stevebroshar (talk) 13:03, 12 April 2025 (UTC)[reply]