2021-07-05 06:50:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
ACLFILE=/tmp/testfile_acl
|
|
|
|
r_log "acl" "Test that the acl get and set functions work"
|
|
|
|
touch "${ACLFILE}"
|
2023-11-14 00:14:57 +00:00
|
|
|
trap '/bin/rm -f ${ACLFILE}' EXIT
|
2021-07-05 06:50:25 +00:00
|
|
|
|
|
|
|
# Use setfacl for readonly
|
|
|
|
r_log "acl" "Set readonly ACL for the user nobody"
|
|
|
|
setfacl -m user:nobody:r "${ACLFILE}"
|
|
|
|
|
|
|
|
# Use getfacl to verify readonly
|
|
|
|
r_log "acl" "Verifying that the nobody user is set to read only"
|
|
|
|
getfacl "${ACLFILE}" | grep -q 'user:nobody:r--'
|
|
|
|
|
|
|
|
r_checkExitStatus $?
|