Re: why can I write to a file I don't have perms to??

David.Knight_at_clubcorp.com
Date: 04/14/05

  • Next message: Tobias Speckbacher: "RE: Blackhole"
    To: General Red Hat Linux discussion list <redhat-list@redhat.com>
    Date: Thu, 14 Apr 2005 16:58:37 -0500
    
    

    David.Knight@clubcorp.com
    Sent by: redhat-list-bounces@redhat.com
    04/14/2005 04:56 PM
    Please respond to General Red Hat Linux discussion list

     
            To: redhat-list@redhat.com
            cc:
            Subject: why can I write to a file I don't own??

    RedHat List,
            I was working on a script the other day and ran into an anomaly
    with the file permission's on files. I have checked this on several ES
    servers and all produce the same results. Say a file has the following
    perms: 644 and it is owner and group are root:root. as long as a user has

    write permission's to the directory it is in they can write to it. not
    only that the UID:GID change to that user. I am running ext3 file systems
    with kernel 2.4.21-20.ELsmp. So my question is

    1) why is this allowed?
    2) can I change this?

    # pwd
    /home/test_dir
    # rm test.fil
    # pwd
    /home/test_dir
    # ls -ld .
    drwxr-xr-x 2 user7 root 4096 Apr 14 16:56 .
    # id
    uid=0(root) gid=0(root)
    groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
    # echo "test from root" > test.fil
    # ls -l test.fil
    -rw-r--r-- 1 root root 15 Apr 14 16:57 test.fil
    # su - user7
    $vi test.fil
    $ ls -l test.fil
    -rw-r--r-- 1 user7 user7 31 Apr 14 16:57 test.fil
    $ cat test.fil
    test from root
    test from uset7

    However it doesn't let you echo "test from user7" > ./test.fil. it
    responds correctly......
    Any thoughts on this would be great.
    -David Knight

    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Tobias Speckbacher: "RE: Blackhole"

    Relevant Pages