Expires: Fri, 05 Aug 2005 03:10:16 GMT Date: Fri, 05 Aug 2005 03:10:06 GMT Pragma: no-cache Last-modified: Fri Aug 5 03:10:06 2005 Cache-control: no-cache Content-Type: text/html; charset=gb2312
user::rw- user:lisa:rw- #effective:r-- group::r-- group:toolies:rw- #effective:r-- mask::r-- other::r-- 缺省权限: default:group:toolies:rw-
u::rw-,u:lisa:rw-,g::r--,g:toolies:rw-,m::r--,o::r-- g:toolies:rw,u:lisa:rw,u::wr,g::r,o::r,m::r 缺省权限: d:g:toolies:rw
# Copying the ACL of one file to another getfacl file1 | setfacl --set-file=- file2 # Copying the access ACL into the Default ACL getfacl -a dir | setfacl -d -M- dir
$ cd linux-2.4.19 $ zcat ../linux-2.4.19-xttr-0.8.50.diff.gz | patch -p1 $ zcat ../linux-2.4.19-acl-0.8.50.diff.gz | patch -p1 配置内核...
# rpm --rebuild attr-2.0.10-0.src.rpm # rpm -ihv /usr/src/redhat/RPMS/i386/attr-2.0.10-0.i386.rpm # rpm -ihv /usr/src/redhat/RPMS/i386/attr-devel-2.0.10-0.i386.rpm # rpm -ihv /usr/src/redhat/RPMS/i386/libattr-2.0.10-0.i386.rpm
# rpm --rebuild acl-2.0.18-0.src.rpm # rpm -ihv /usr/src/redhat/RPMS/i386/acl-2.0.18-0.i386.rpm # rpm -ihv /usr/src/redhat/RPMS/i386/acl-devel-2.0.18-0.i386.rpm # rpm -ihv /usr/src/redhat/RPMS/i386/libacl-2.0.18-0.i386.rpm
# rpm --rebuild fileutils-4.1.18acl65.5.src.rpm # rpm -Uhv /usr/src/redhat/RPMS/i386/fileutils-4.1.8acl-65.5.i386.rpm
# rpm --rebuild e2fsprogs-1.27ea-26.4.src.rpm # rpm -Uhv /usr/src/redhat/RPMS/i386/e2fsprogs-1.27ea-26.4.i386.rpm
# rpm --rebuild star-1.5a03-2.src.rpm # rpm -Uhv /usr/src/redhat/RPMS/i386/
LABEL=/ / ext2 defaults,acl 1 1 LABEL=/boot /boot ext2 defaults,acl 1 2 LABEL=/home /home ext3 defaults,acl 1 2 LABEL=/usr /usr ext3 defaults,acl 1 2
mount -o remount / mount -o remount /boot mount -o remount /home mount -o remount /usr
bash# dd if=/dev/zero of=/opt/testptn count=512
bash# losetup /dev/loop0 /opt/testptn
bash# mke2fs /dev/loop0
bash# mount -o rw,acl /dev/loop0 /mnt
bash# cd /mnt
bash# ls
lost+found
bash# touch file1
bash# getfacl file1
# file: file1
# owner: root
# group: root
user::rw-
group::r--
other::r--
bash# setfacl -m u:testu1:rw file1
bash$ getfacl file1
# file: file1
# owner: root
# group: root
user::rw-
user:testu1:rw-
group::r--
mask::rw-
other::r--
<agruen@suse.de> [PATCH] Long-standing xattr sharing bug When looking for identical xattr blocks to share, we were not comparing the name_index fields. This could lead to false sharing when two xattr blocks ended up with identical attribute names and values, and the only default acls. Because acls are cached, the bug was hidden until the next reload of the affected inode. $ mkdir -m 700 a b $ setfacl -m u:bin:rwx a < acl of a goes in the mbcache $ setfacl -dm u:bin:rwx b < acl of b differs only in name_index, so a's acl is reused $ getfacl b < shows the result from the inode cache < empty inode cache (remount, etc.) $ getfacl b < shows an access acl instead of a default acl. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
#!/bin/sh #Test acl bug may exist in kernel <= 2.6.10 set -e mkdir testacl cd testacl mkdir mnt dd if=/dev/zero of=filesystem count=512 >/dev/null 2>&1 losetup /dev/loop0 filesystem >/dev/null mke2fs /dev/loop0 >/dev/null 2>&1 mount -o rw,acl /dev/loop0 mnt cd mnt mkdir -m 700 a b setfacl -m u:bin:rwx a setfacl -dm u:bin:rwx b echo "ACL after cmd line 'setfacl -dm u:bin:rwx b'" echo "-------------------------" getfacl b echo "-------------------------" cd .. umount mnt mount -o rw,acl /dev/loop0 mnt cd mnt echo "ACL after remount" echo "-------------------------" getfacl b echo "-------------------------" if getfacl b | grep -q "^default:user:bin:rwx"; then echo -e "\nTest acl: success!\n" else echo -e "\nTest acl: failed!\n" fi cd .. umount mnt losetup -d /dev/loop0 cd .. rmdir testacl/mnt rm testacl/filesystem rmdir testacl