Results 1 to 5 of 5

Thread: 'Normal' user able to delete www-data's file

  1. #1
    Join Date
    Aug 2006
    Beans
    69

    [Solved]'Normal' user able to delete www-data's file

    Hi,

    I am not sure if this is a nomal behaviour and that is the reason I am posting it here and not as bug in launchpad.

    Code:
    htdocs$ ls -l testFile.txt 
    -rw-r--r-- 1 www-data www-data 78 2010-06-24 01:48 testFile.txt
    htdocs$ rm testFile.txt 
    rm: remove write-protected regular file `testFile.txt'? y
    htdocs$ ls
    css  favicon.ico  images  index.php  js  sign.png
    Last edited by den_; June 26th, 2010 at 11:29 PM. Reason: Solved

  2. #2
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: 'Normal' user able to delete www-data's file

    Without the sticky bit set, any user with write and execute permissions for the directory can rename or delete contained files, regardless of owner.

    http://www.zzee.com/solutions/linux-permissions.shtml
    Last edited by sisco311; June 26th, 2010 at 11:06 PM.

  3. #3
    Join Date
    Aug 2006
    Beans
    69

    Re: 'Normal' user able to delete www-data's file

    Thank you sisco311.

  4. #4
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: 'Normal' user able to delete www-data's file

    Quote Originally Posted by sisco311 View Post
    Without the sticky bit set, any user with write and execute permissions for the directory can rename or delete contained files, regardless of owner.

    http://www.zzee.com/solutions/linux-permissions.shtml
    "Any user with write access", the execute bit is irrelevant here.
    「明後日の夕方には帰ってるからね。」


  5. #5
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: 'Normal' user able to delete www-data's file

    Quote Originally Posted by Bachstelze View Post
    "Any user with write access", the execute bit is irrelevant here.
    Nope. To create new files or delete files, you need write access to the directory. You also need execute access to all parent directories back to the root.

    Code:
    mkdir -p dir/foo/bar
    > dir/foo/bar/file
    chmod 0220 dir/
    rm dir/foo/bar/file
    rm: cannot remove `dir/foo/bar/file': Permission denied

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •