From: Andreas Dilger <adilger@turbolinux.com>
To: Xavier Ordoquy <xordoquy@aurora-linux.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Bug in the file attributes ?
Date: Thu, 29 Mar 2001 11:44:27 -0700 (MST) [thread overview]
Message-ID: <200103291844.f2TIiSK09176@webber.adilger.int> (raw)
In-Reply-To: <Pine.LNX.4.21.0103292011480.20805-100000@ilaws.aurora-linux.net> from Xavier Ordoquy at "Mar 29, 2001 08:20:32 pm"
Xavier Ordoquy writes:
> I just made a manipulation that disturbs me. So I'm asking whether it's a
> bug or a features.
>
> user> su
> root> echo "test" > test
> root> ls -l
> -rw-r--r-- 1 root root 5 Mar 29 19:14 test
> root> exit
> user> rm test
> rm: remove write-protected file `test'? y
> user> ls test
> ls: test: No such file or directory
>
> This is in the user home directory.
> Since the file is read only for the user, it should not be able to remove
> it. Moreover, the user can't write to test.
This is definitely not a bug. Deleting a file (under *nix) does not
"modify" the file at all, it is modifying the directory where the file
resides. In this case, a user _will_ have permission to write into
their home directory, so they can delete the file, but not modify it.
Why do such a thing? If you have group/world write permission on a
directory, then people who have write permission to the _directory_
should be able to delete files even if they don't own them. However,
if you set the "sticky" bit on the directory (chmod +t /dir), then only
the owner of the file can delete it, like in /tmp.
Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
next prev parent reply other threads:[~2001-03-29 18:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-29 20:20 Xavier Ordoquy
2001-03-29 18:44 ` Andreas Dilger [this message]
2001-03-29 20:56 ` Xavier Ordoquy
2001-03-29 19:04 ` John Jasen
2001-03-29 22:57 ` Brian Beattie
2001-03-29 18:45 ` Stephen Clouse
2001-03-29 18:51 ` Justin Carlson
2001-03-30 2:34 ` Tim Wright
-- strict thread matches above, loose matches on Subject: below --
2001-03-29 19:25 Jesse Pollard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200103291844.f2TIiSK09176@webber.adilger.int \
--to=adilger@turbolinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xordoquy@aurora-linux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®