setfacl -d -m user::r-- "${TESTDIR}"
setfacl -d -m group::r-- "${TESTDIR}"
setfacl -d -m other::r-- "${TESTDIR}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
touch "${TARGET}"
chmod 777 "${TARGET}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::r--
-user:mail:rwx
+user:bin:rwx
group::r--
mask::rwx
other::r--
TESTNUM=3
touch "${TARGET}"
chmod 644 "${TARGET}"
-setfacl -d -m group:mail:rwx "${TESTDIR}"
+setfacl -d -m group:bin:rwx "${TESTDIR}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rw-
group::r--
-group:mail:rwx #effective:rw-
+group:bin:rwx #effective:rw-
mask::rw-
other::r--
# Same test as before except with a directory.
TESTNUM=4
-setfacl -d -m group:mail:rwx "${TESTDIR}"
+setfacl -d -m group:bin:rwx "${TESTDIR}"
mkdir "${TARGET}"
chmod 755 "${TARGET}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
group::r-x
-group:mail:rwx
+group:bin:rwx
mask::rwx
other::r-x
default:user::rwx
default:group::r-x
-default:group:mail:rwx
+default:group:bin:rwx
default:mask::rwx
default:other::r-x
TESTNUM=6
touch "${TARGET}"
chmod 744 "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx
+user:bin:rwx
group::r-x
mask::rwx
other::r-x
TESTNUM=7
touch "${TARGET}"
chmod 744 "${TARGET}"
-setfacl -m user:news:rw "${TARGET}"
+setfacl -m user:daemon:rw "${TARGET}"
# If we don't add 'x' to the mask here, nobody can execute the file.
# setfacl will update the mask for us under most circumstances, but
# note that we didn't create an entry with an 'x' bit using setfacl --
# therefore, setfacl won't unmask 'x' for us.
setfacl -m mask::rwx "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
-setfacl -d -m user:news:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
+setfacl -d -m user:daemon:rwx "${TESTDIR}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx
-user:news:rwx
+user:bin:rwx
+user:daemon:rwx
group::r-x
mask::rwx
other::r-x
TESTNUM=8
touch "${TARGET}"
chmod 644 "${TARGET}"
-setfacl -m user:news:rw "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -m user:daemon:rw "${TARGET}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rw-
-user:mail:rwx #effective:rw-
+user:bin:rwx #effective:rw-
group::r--
mask::rw-
other::r--
TARGET="${TESTDIR}"/foo
touch "${TARGET}"
chmod 777 "${TARGET}"
-setfacl -m user:mail:rwx "${TESTDIR}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -m user:bin:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
setfacl -d -m mask::rw- "${TESTDIR}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx #effective:rw-
+user:bin:rwx #effective:rw-
group::r-x #effective:r--
mask::rw-
other::r-x
TARGET="${TESTDIR}"/baz
mkdir "${TARGET}"
chmod 644 "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN "${TARGET}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx
+user:bin:rwx
group::r-x
mask::rwx
other::r-x
default:user::rwx
-default:user:mail:rwx
+default:user:bin:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
TARGET="${TESTDIR}"/baz
mkdir "${TARGET}"
chmod 755 "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN "${TARGET}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx
+user:bin:rwx
group::r-x
mask::rwx
other::r-x
default:user::rwx
-default:user:mail:rwx
+default:user:bin:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
TARGET="${TESTDIR}"/foo
touch "${TARGET}"
chmod 644 "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN "${TARGET}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rw-
-user:mail:rwx #effective:rw-
+user:bin:rwx #effective:rw-
group::r--
mask::rw-
other::r--
TARGET="${TESTDIR}"/foo
touch "${TARGET}"
chmod 700 "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx
+user:bin:rwx
group::r-x
mask::rwx
other::r-x
TARGET="${TESTDIR}"/foo
touch "${TARGET}"
chmod 670 "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx
+user:bin:rwx
group::r-x
mask::rwx
other::r-x
TARGET="${TESTDIR}"/foo
touch "${TARGET}"
chmod 607 "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx
+user:bin:rwx
group::r-x
mask::rwx
other::r-x
# The directory allows execute for user, group, and other, so the file
# should actually inherit them regardless of its initial mode when the
# --no-exec-mask flag is passed.
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN --no-exec-mask "${TARGET}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx
+user:bin:rwx
group::r-x
mask::rwx
other::r-x
mkdir "${PARENT_DIR}"
touch "${TARGET}"
chmod 644 "${TARGET}"
-setfacl -d -m user:mail:rwx "${TESTDIR}"
+setfacl -d -m user:bin:rwx "${TESTDIR}"
$BIN --recursive --no-exec-mask "${PARENT_DIR}"
EXPECTED=$(cat <<EOF
user::rwx
-user:mail:rwx
+user:bin:rwx
group::r-x
mask::rwx
other::r-x