unlink permissions unclear - SCO

This is a discussion on unlink permissions unclear - SCO ; I cannot understand the following situation: I am trying to understand permisions. File AAA created in /usr/tmp by user test: drwxrwxrwt 2 sys sys 10240 Jan 10 15:59 /usr/tmp -rw-rw-r-- 1 test group 6 Jan 10 16:14 /usr/tmp/AAA User test2 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: unlink permissions unclear

  1. unlink permissions unclear

    I cannot understand the following situation:
    I am trying to understand permisions.

    File AAA created in /usr/tmp by user test:

    drwxrwxrwt 2 sys sys 10240 Jan 10 15:59 /usr/tmp
    -rw-rw-r-- 1 test group 6 Jan 10 16:14 /usr/tmp/AAA

    User test2 can not delete it, see below :
    /u/test2$ rm /usr/tmp/AAA
    rm: /usr/tmp/AAA not removed: Permission denied (error 13)

    User test2 belong to the same group as test, see lines from passwd file
    below :

    test:x:262:50::/u/test:/bin/ksh
    test2:x:264:50::/u/test2:/bin/ksh

    test2 can write to the file, I thought test2 should be able to delete
    it. Why is that?
    the man chmod clearly says regarding directories with sticky bit set:

    who can delete :
    anyone with write permissions to both file and directory

    Your clarifications are very welcome.


  2. Re: unlink permissions unclear

    migurus@yahoo.com typed (on Tue, Jan 10, 2006 at 04:50:57PM -0800):
    | I cannot understand the following situation:
    | I am trying to understand permisions.
    |
    | File AAA created in /usr/tmp by user test:
    |
    | drwxrwxrwt 2 sys sys 10240 Jan 10 15:59 /usr/tmp
    | -rw-rw-r-- 1 test group 6 Jan 10 16:14 /usr/tmp/AAA
    |
    | User test2 can not delete it, see below :
    | /u/test2$ rm /usr/tmp/AAA
    | rm: /usr/tmp/AAA not removed: Permission denied (error 13)
    |
    | User test2 belong to the same group as test, see lines from passwd file
    | below :
    |
    | test:x:262:50::/u/test:/bin/ksh
    | test2:x:264:50::/u/test2:/bin/ksh
    |
    | test2 can write to the file, I thought test2 should be able to delete
    | it. Why is that?
    | the man chmod clearly says regarding directories with sticky bit set:
    |
    | who can delete :
    | anyone with write permissions to both file and directory

    The chmod man page would appear to be wrong.

    A directory with the sticky bit set means that only the file owner and
    the superuser may remove files from that directory. Other users are
    denied the right to remove files regardless of the directory permissions.

    --
    JP
    ==> http://www.frappr.com/cusm <==

  3. Re: unlink permissions unclear

    On Tue, Jan 10, 2006, migurus@yahoo.com wrote:
    >I cannot understand the following situation:
    >I am trying to understand permisions.
    >
    >File AAA created in /usr/tmp by user test:
    >
    >drwxrwxrwt 2 sys sys 10240 Jan 10 15:59 /usr/tmp
    >-rw-rw-r-- 1 test group 6 Jan 10 16:14 /usr/tmp/AAA
    >
    >User test2 can not delete it, see below :
    >/u/test2$ rm /usr/tmp/AAA
    >rm: /usr/tmp/AAA not removed: Permission denied (error 13)
    >
    >User test2 belong to the same group as test, see lines from passwd file
    >below :


    The key is that the /usr/tmp directory has the ``sticky'' bit set (the
    ``t'' at the end of drwxrwxrwxt in the long listing). When set on a
    directory, it prohibits any user but the owner (and root) to delete the
    file or directory.

    Bill
    --
    INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC
    URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
    FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676

    ``Democracy Is Mob Rule with Income Taxes''

  4. Re: unlink permissions unclear

    Jean-Pierre Radley wrote:

    > migurus@yahoo.com typed (on Tue, Jan 10, 2006 at 04:50:57PM -0800):
    > | I cannot understand the following situation:
    > | I am trying to understand permisions.
    > |
    > | File AAA created in /usr/tmp by user test:
    > |
    > | drwxrwxrwt 2 sys sys 10240 Jan 10 15:59 /usr/tmp
    > | -rw-rw-r-- 1 test group 6 Jan 10 16:14 /usr/tmp/AAA
    > |
    > | User test2 can not delete it, see below :
    > | /u/test2$ rm /usr/tmp/AAA
    > | rm: /usr/tmp/AAA not removed: Permission denied (error 13)
    > |
    > | User test2 belong to the same group as test, see lines from passwd file
    > | below :
    > |
    > | test:x:262:50::/u/test:/bin/ksh
    > | test2:x:264:50::/u/test2:/bin/ksh
    > |
    > | test2 can write to the file, I thought test2 should be able to delete
    > | it. Why is that?
    > | the man chmod clearly says regarding directories with sticky bit set:
    > |
    > | who can delete :
    > | anyone with write permissions to both file and directory
    >
    > The chmod man page would appear to be wrong.
    >
    > A directory with the sticky bit set means that only the file owner and
    > the superuser may remove files from that directory. Other users are
    > denied the right to remove files regardless of the directory permissions.


    Starting with OSR506 (or maybe 505?), this is actually under control of
    a kernel parameter. The default setting is the same as the only
    possible behavior in earlier releases: files in sticky directories can
    only be deleted (or renamed) by their owner. If you set
    `sec_sticky_group' to 1 in /etc/conf/pack.d/kernel/space.c,
    group-writable files can then be deleted or renamed by members of that
    group.

    I'm pretty sure that turning this on puts the system in violation of the
    XPG4.2 standards it's supposed to comply with. But that's up to the
    administrator, and I don't think it causes any practical problems with
    the OS utilities.

    >Bela<


+ Reply to Thread