-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 06/05/2014 11:37 PM, Bob Proulx wrote:

> jimmy wrote:

>>    // --- remove (delete) a file owned by root, should not be
>> allowed, but is allowed.  Here, it says the file is 'read-only'
>> so it warns about it, but of course "rm -f " would work, too:
> 
> Why do you think it should not be allowed?  It is allowed.
> 
> If you don't want a user to modify the directory then change the
> permissions of the directory.

In this case, however, the user isn't just modifying the directory; the
user is modifying a file in the directory, by deleting that file.

>>    $ rm -v /tmp/testing/newjunk1.txt
>> rm: remove write-protected regular file ‘/tmp/testing/newjunk1.txt’? y
>> removed ‘/tmp/testing/newjunk1.txt’
> 
> Sure.  Because tst1 owns /tmp/testing.

I'm confused as to why that's enough.

Yes, moving a file affects only data stored in the directory node which
contains the file (and the directory node where the file is being moved
to, which may be the same one).

But deleting a file does not affect only data stored in the directory
node which contains the file; it affects data stored in the file itself.
(Assuming that there is only one hardlink to the file and the file is
not presently open in any currently running process, which is often a
reasonable assumption - and even when it is not, I don't think the
permissions behavior of 'rm' should be different depending on the number
of hardlinks to the file.)

As such, it seems as if deleting a file *should* require write
permission to that file.

Is there something I'm missing here?

- --
   The Wanderer

Secrecy is the beginning of tyranny.

A government exists to serve its citizens, not to control them.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCgAGBQJTkcU7AAoJEASpNY00KDJrASoQAJvzGvZm06gvesZxnnG+mZBp
5zzzzIcU4rgQP2JYXdNP+Q69aq/tCgAo695NIrwXFyzOeIrhvsnxOs65dc0ofe8W
Vz8Voyx7d40Xtz5p80ngdCbqI353fCBkt3dzFwjIBaNJjj/ltn5V5orR6cEvcI53
0hwa7CZ9deKim0yon/PpKBY3bFYF55BT9czszBGC9UjMoi8gaSfGz27hbEKe6dOi
mRdz3CQcdKZgKQClJBVkvCx+DrTSSy6K82LvtyuH1NyEf+Cn1SL215RsWEZkrXD9
W2qqDGj6GjuaTIc8EqI4CcNS+RaSH6K6gtXKdcmFkfIZadNL+CrTvT5G9upcm9fa
bcSCOnLYke0ieI1e4aZHLruY8IjRvVzsWs3a86AUt3+OvNRneiiqHMFycTm6OUsn
K4VP+Mn95Kc3DLhaTozM4a5ATxVwPsidAR4M01c9wMQ4mCy+ReCY88MPyJD6C6pT
CIA2Zv+kC7zb3Bwvfgu2LqylIE8EzoFrUMtyc1Nq7PSaRRdmrlfFEILGmttocUcZ
ns894dQK4mSMPFnhKsOjNaXtNQBtmoGPsiXiDSR+2DhAPv9upyHpYAv4BHZ77WFk
59Z8wkKLLJLNLk/7DrZYG+eWzpbvebwhxfTVZuv5OUJmaGPFoz0LL/i340pYnCBj
CGixggwiQE/Clc4fBzk9
=GjkX
-----END PGP SIGNATURE-----


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/5391c53b.4080...@fastmail.fm

Reply via email to