• Shi Weihua's avatar
    Btrfs: should add a permission check for setfacl · 2f26afba
    Shi Weihua authored
    On btrfs, do the following
    ------------------
    # su user1
    # cd btrfs-part/
    # touch aaa
    # getfacl aaa
      # file: aaa
      # owner: user1
      # group: user1
      user::rw-
      group::rw-
      other::r--
    # su user2
    # cd btrfs-part/
    # setfacl -m u::rwx aaa
    # getfacl aaa
      # file: aaa
      # owner: user1
      # group: user1
      user::rwx           <- successed to setfacl
      group::rw-
      other::r--
    ------------------
    but we should prohibit it that user2 changing user1's acl.
    In fact, on ext3 and other fs, a message occurs:
      setfacl: aaa: Operation not permitted
    
    This patch fixed it.
    Signed-off-by: default avatarShi Weihua <shiwh@cn.fujitsu.com>
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    2f26afba
acl.c 6.41 KB