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

Re: File permission confusion [Debian 9.1 with MATE]



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

<tomas@tuxteam.de> wrote:
>
> On Mon, Jan 01, 2018 at 06:11:59PM -0000, Dan Purgert wrote:
>
> [...]
>
>> Note that "write" permissions on a file only really comes into play when
>> you're messing with a file in an editor (e.g. vim, emacs, nano,
>> whatever).  It does not necessarily prevent one from doing something
>> like:
>> 
>>    -rw-r----- [...] somefile.txt
>>    $ mv anotherfile.txt somefile.txt
>> 
>> Because you're not modifying "the file", but rather its parent
>> directory.  It's a very, very fine distinction, to be sure.
>
> And that's the point... a program "messing" with the file might
> well choose to copy the file to some other name, modify that copy,
> and then, at the end, remove the original and rename the new
> version to the original name: this is actually a common pattern
> to achieve some form of "atomicity": when you want either all
> the changes "committed to disk" or none (in case of failure).

Exactly.  Though reading it again, it was a poor turn of phrase to have
said "messing" with the file. 

>
> As long as the basic difference between a file and its "name"
> (i.e. the directory entry "pointing" to the file) is not understood,
> this fine difference between writing to the file and modifying
> (e.g. deleting) the directory entry will seem mysterious.
>
> Otherwise... nice tutorial.

Thanks.  chmod and chattr actually have really nice manpages :)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJaS2X/AAoJEI4R3fMSeaKBeVMH/3iBKuZxMvXqrRuLPJOQuYzc
O3cGFeooD7UOcucbzCVbRCtE5hYxzYKa3+35V+DrjJ58GbZArTU7+Bp+kGoVn9+A
D+3LQl/SmjSW0mh3whciw+75mioaErVPkJlC2JNpqaQWPkTk9IDyGleodof+jEz3
dGZm/Kkxd1f6XEMkBtz1QuqXocBISJrXyKlmBLC+vJwBnQHxPMTpCiF+zNGbK1xw
6RtSqlwH0lbnCMQQU1Lp2A1KU0ku30O90lG6gmgYRZHoSGg0yBSltqSuV/VsHGQT
UNwPXwX2UdOsN/quYtwaaqhwITw5LhYj8ONumlbPvYuaO1cj7xBpu8lPDqgftK4=
=NxQ1
-----END PGP SIGNATURE-----

-- 
|_|O|_| Registered Linux user #585947
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5  4AEE 8E11 DDF3 1279 A281


Reply to: