]>
gitweb.michael.orlitzky.com - apply-default-acl.git/blob - run-tests.sh
4 BIN
=.
/reapply_default_acl
6 # The directory where we'll do all the ACL manipulation.
10 # Remove any ACLs on our test directory and remove its contents.
11 setfacl
--remove-all --recursive "$TESTDIR"
16 if [[ "${ACTUAL}" == "${EXPECTED}" ]]; then
17 echo "Success (#${TESTNUM})"
20 echo "Failure (#${TESTNUM})"
21 echo "Expected result:"
29 # Start by removing and recreating the 'acl' directory.
34 # When using a minimal ACL, the default user, group, and other
35 # permissions should all be propagated to the mode bits.
37 TARGET
="${TESTDIR}"/foo
38 setfacl
-d -m user
::r
-- "${TESTDIR}"
39 setfacl
-d -m group
::r
-- "${TESTDIR}"
40 setfacl
-d -m other
::r
-- "${TESTDIR}"
53 ACTUAL
=`getfacl --omit-header "${TARGET}"`
56 # Do the same thing as the last test, except with an extended ACL.
58 setfacl
-d -m user
::r
-- "${TESTDIR}"
59 setfacl
-d -m group
::r
-- "${TESTDIR}"
60 setfacl
-d -m other
::r
-- "${TESTDIR}"
61 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
76 ACTUAL
=`getfacl --omit-header "${TARGET}"`
79 # A file shared by a group, should still be group-writable
84 setfacl
-d -m group
:mail:rwx
"${TESTDIR}"
90 group:mail:rwx #effective:rw-
96 ACTUAL
=`getfacl --omit-header "${TARGET}"`
99 # Same test as before except with a directory.
101 setfacl
-d -m group
:mail:rwx
"${TESTDIR}"
103 chmod 755 "${TARGET}"
114 default:group:mail:rwx
121 ACTUAL
=`getfacl --omit-header "${TARGET}"`
125 # With no default, things are left alone.
128 chmod 744 "${TARGET}"
140 ACTUAL
=`getfacl --omit-header "${TARGET}"`
145 # Since the default ACL will grant r-x to group/other, they will wind
149 chmod 744 "${TARGET}"
150 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
164 ACTUAL
=`getfacl --omit-header "${TARGET}"`
168 # Some named entries can be granted execute permissions as the result
172 chmod 744 "${TARGET}"
173 setfacl
-m user
:news
:rw
"${TARGET}"
174 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
175 setfacl
-d -m user
:news
:rwx
"${TESTDIR}"
190 ACTUAL
=`getfacl --omit-header "${TARGET}"`
194 # We should not retain any entries that aren't in the default.
197 chmod 644 "${TARGET}"
198 setfacl
-m user
:news
:rw
"${TARGET}"
199 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
205 user:mail:rwx #effective:rw-
213 ACTUAL
=`getfacl --omit-header "${TARGET}"`
217 # A slightly modified test #1 to make sure it works right.
219 TARGET
="${TESTDIR}"/foo
221 chmod 777 "${TARGET}"
222 setfacl
-d -m user
::r
-- "${TESTDIR}"
233 ACTUAL
=`getfacl --omit-header "${TARGET}"`
237 # If the default ACL mask denies execute, we should respect that
238 # regardless of the existing execute permissions.
240 TARGET
="${TESTDIR}"/foo
242 chmod 777 "${TARGET}"
243 setfacl
-m user
:mail:rwx
"${TESTDIR}"
244 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
245 setfacl
-d -m mask
::rw
- "${TESTDIR}"
250 user:mail:rwx #effective:rw-
251 group::r-x #effective:r--
258 ACTUAL
=`getfacl --omit-header "${TARGET}"`