Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 127269 - user can delete files owned by root
user can delete files owned by root
Product: Fedora
Classification: Fedora
Component: zsh (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Mike McLean
: Security
Depends On:
  Show dependency treegraph
Reported: 2004-07-05 12:27 EDT by Thilo Pfennig
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-07-06 11:32:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Thilo Pfennig 2004-07-05 12:27:23 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Gecko/20040625 Epiphany/1.2.6

Description of problem:
If I create a file that is owned by root, I can delete it as an
ordinary user!

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. touch p
2. chmod 644 p
2. sudo chown root.root p
3. rm p

Actual Results:  file "p" is deleted

Expected Results:  should not be able to delete

Additional info:

grep \^root /etc/group                                                ~

I am user vinci.
grep \^vinci /etc/group                                               

My dir looks like this:
drwx------  79 vinci vinci 4096  5. Jul 18:17 /home/vinci/
Comment 1 Jens Petersen 2004-07-05 23:32:48 EDT
I have seen this before: not really sure if this is not a feature.
I think you'll find it only works in directories that you own.

[Btw "sudo touch p ; rm p" is a quickly way to reproduce this.]
Comment 2 Jens Petersen 2004-07-06 01:01:42 EDT
The same thing in bash.
Comment 3 Paul W. Frields 2004-07-06 08:32:56 EDT
This is not unexpected behavior. User "vinci" owns the directory, and
is allowed to write new contents to that directory. Removing a file is
not an action on the file, it is an action on the directory that
contains that file. User "vinci" will not be able to change the file
itself. If you try doing "cd ; sudo touch p ; echo 'foobar' >> p"
you'll see what I mean. Trying to remove any root-owned files in a
directory owned by root will fail.

You're simply seeing normal behavior; this should be changed to NOTABUG.
Comment 4 Josh Bressers 2004-07-06 11:32:54 EDT
According to the POSIX standard, this behavior is acceptable.  I'm
closing this as NOTABUG.

Note You need to log in before you can comment on or make changes to this bug.