diff options
author | Brandon Philips <bphilips@suse.de> | 2009-02-13 17:54:43 -0800 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2009-02-23 02:37:25 +0100 |
commit | 49f3db813298a1cd95e54b87cbbd15c712a78c91 (patch) | |
tree | 883ed578fac813a07c03d1cb27a3272af8fbb8c0 /test | |
parent | da86c6dec3c7273b693864a25fa3a1af4e6ecd9b (diff) | |
download | acl-49f3db813298a1cd95e54b87cbbd15c712a78c91.tar.gz |
acl: move root tests to their own folder
Since these tests require root perms to run move them into a seperate
folder so they don't run by default.
Signed-off-by: Brandon Philips <bphilips@suse.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/root/permissions.test (renamed from test/permissions.test) | 36 | ||||
-rw-r--r-- | test/root/setfacl.test (renamed from test/setfacl.test) | 56 |
2 files changed, 46 insertions, 46 deletions
diff --git a/test/permissions.test b/test/root/permissions.test index 17f696e..afaf5f0 100644 --- a/test/permissions.test +++ b/test/root/permissions.test @@ -31,7 +31,7 @@ have access to the file owned by root. $ su daemon $ echo daemon >> f - > f: Permission denied + >~ .*f: Permission denied$ $ su @@ -55,7 +55,7 @@ Verify this. > bin $ echo daemon >> f - > f: Permission denied + >~ .*f: Permission denied$ Now, add an ACL entry for user daemon that grants him rw- access. File @@ -97,7 +97,7 @@ verify that this masks daemon's write permission. $ su daemon $ echo daemon >> f - > f: Permission denied + >~ .*f: Permission denied$ Add an entry for group daemon with rw- access, and change the @@ -110,7 +110,7 @@ access. $ su daemon $ echo daemon >> f - > f: Permission denied + >~ .*f: Permission denied$ Remove the entry for user daemon. The group daemon permissions should @@ -136,7 +136,7 @@ daemon does not have write access anymore. $ su daemon $ echo daemon3 >> f - > f: Permission denied + >~ .*f: Permission denied$ Now, remove the group daemon entry. Because user daemon is a member in @@ -147,7 +147,7 @@ the owning group, he should still have no write access. $ su daemon $ echo daemon4 >> f - > f: Permission denied + >~ .*f: Permission denied$ Change the owning group. The other permissions should now grant user @@ -173,10 +173,10 @@ accumulate. $ setfacl -m g:bin:r,g:daemon:w f $ su daemon - $ : < f # open for reading - $ : > f # open for writing - $ : <> f # open for read-write - > f: Permission denied + $ : < f + $ : > f + $ : <> f + >~ .*f: Permission denied$ Test if directories can have ACLs. We assume that only one access check @@ -192,7 +192,7 @@ only need to verify that ACL permissions make a difference. > $ echo i > e/i - > e/i: Permission denied + >~ .*e/i: Permission denied$ $ su $ setfacl -m u:bin:rx e @@ -201,7 +201,7 @@ only need to verify that ACL permissions make a difference. $ echo e/* > e/h $ echo i > e/i - > e/i: Permission denied + >~ .*e/i: Permission denied$ $ su $ setfacl -m u:bin:rwx e @@ -226,24 +226,24 @@ not need to exist: The access check is earlier in the code path than the test if the device exists. - $ mknod -m 0660 hdt b 91 64 # /dev/hdt - $ mknod -m 0660 null c 1 3 # /dev/null + $ mknod -m 0660 hdt b 91 64 + $ mknod -m 0660 null c 1 3 $ mkfifo -m 0660 fifo $ su bin $ : < hdt - > hdt: Permission denied + >~ .*hdt: Permission denied$ $ : < null - > null: Permission denied + >~ .*null: Permission denied$ $ : < fifo - > fifo: Permission denied + >~ .*fifo: Permission denied$ $ su $ setfacl -m u:bin:rw hdt null fifo $ su bin $ : < hdt - > hdt: No such device or address + >~ .*hdt: No such device or address$ $ : < null $ ( echo blah > fifo & ) ; cat fifo > blah diff --git a/test/setfacl.test b/test/root/setfacl.test index 2c10bd1..630e9fb 100644 --- a/test/setfacl.test +++ b/test/root/setfacl.test @@ -1,5 +1,5 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. - + $ mkdir d $ chown bin:bin d $ cd d @@ -10,11 +10,11 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. $ touch g $ ls -dl g | awk '{print $1}' > -rw-r----- - + $ setfacl -m m:- g $ ls -dl g | awk '{print $1}' > -rw-------+ - + $ getfacl g > # file: g > # owner: bin @@ -23,8 +23,8 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. > group::r-- #effective:--- > mask::--- > other::--- - > - + > + $ setfacl -x m g $ getfacl g > # file: g @@ -33,8 +33,8 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. > user::rw- > group::r-- > other::--- - > - + > + $ setfacl -m u:daemon:rw g $ getfacl g > # file: g @@ -45,8 +45,8 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. > group::r-- > mask::rw- > other::--- - > - + > + $ setfacl -m u::rwx,g::r-x,o:- g $ getfacl g > # file: g @@ -57,8 +57,8 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. > group::r-x > mask::rwx > other::--- - > - + > + $ setfacl -m u::rwx,g::r-x,o:-,m:- g $ getfacl g > # file: g @@ -69,8 +69,8 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. > group::r-x #effective:--- > mask::--- > other::--- - > - + > + $ setfacl -m u::rwx,g::r-x,o:-,u:root:-,m:- g $ getfacl g > # file: g @@ -82,8 +82,8 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. > group::r-x #effective:--- > mask::--- > other::--- - > - + > + $ setfacl -m u::rwx,g::r-x,o:-,u:root:-,m:- g $ getfacl g > # file: g @@ -95,8 +95,8 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. > group::r-x #effective:--- > mask::--- > other::--- - > - + > + $ setfacl -m u::rwx,g::r-x,o:-,u:root:- g $ getfacl g > # file: g @@ -108,37 +108,37 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support. > group::r-x > mask::rwx > other::--- - > - + > + $ setfacl --test -x u: g > setfacl: g: Malformed access ACL `user:root:---,user:daemon:rw-,group::r-x,mask::rwx,other::---': Missing or wrong entry at entry 1 - + $ setfacl --test -x u:x > setfacl: Option -x: Invalid argument near character 3 - + $ setfacl -m d:u:root:rwx g > setfacl: g: Only directories can have default ACLs - + $ setfacl -x m g > setfacl: g: Malformed access ACL `user::rwx,user:root:---,user:daemon:rw-,group::r-x,other::---': Missing or wrong entry at entry 5 setfacl --test -m d:u:daemon:rwx setfacl setfacl --test -n -m d:u:daemon:rwx setfacl - + Check if the mask is properly recalculated - + $ mkdir d $ setfacl --test -m u::rwx,u:bin:rwx,g::r-x,o::--- d > d: u::rwx,u:bin:rwx,g::r-x,m::rwx,o::---,* - + $ setfacl --test -m u::rwx,u:bin:rwx,g::r-x,m::---,o::--- d > d: u::rwx,u:bin:rwx,g::r-x,m::---,o::---,* - + $ setfacl --test -d -m u::rwx,u:bin:rwx,g::r-x,o::--- d > d: *,d:u::rwx,d:u:bin:rwx,d:g::r-x,d:m::rwx,d:o::--- - + $ setfacl --test -d -m u::rwx,u:bin:rwx,g::r-x,m::---,o::--- d > d: *,d:u::rwx,d:u:bin:rwx,d:g::r-x,d:m::---,d:o::--- - + $ su $ cd .. $ rm -r d |