__acl: always check first if path exists
This commit is contained in:
parent
ef8ff06b5f
commit
ab954ffbcf
3 changed files with 19 additions and 15 deletions
|
@ -18,15 +18,16 @@
|
|||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
acl_path="/$__object_id"
|
||||
|
||||
[ ! -e "$acl_path" ] && exit 0
|
||||
|
||||
if ! command -v getfacl 2>/dev/null
|
||||
then
|
||||
echo 'getfacl not available' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -e "/$__object_id" ]
|
||||
then
|
||||
getfacl "/$__object_id" 2>/dev/null \
|
||||
getfacl "$acl_path" 2>/dev/null \
|
||||
| grep -E '^((default:)?(user|group):[^:]|(default:)?mask::)' \
|
||||
|| true
|
||||
fi
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
if [ -e "/$__object_id" ]
|
||||
then
|
||||
if [ -d "/$__object_id" ]
|
||||
acl_path="/$__object_id"
|
||||
|
||||
[ ! -e "$acl_path" ] && exit 0
|
||||
|
||||
if [ -d "$acl_path" ]
|
||||
then echo d
|
||||
elif [ -f "/$__object_id" ]
|
||||
elif [ -f "$acl_path" ]
|
||||
then echo f
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -18,12 +18,14 @@
|
|||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
acl_path="/$__object_id"
|
||||
|
||||
[ ! -e "$acl_path" ] && exit 0
|
||||
|
||||
os="$( cat "$__global/explorer/os" )"
|
||||
|
||||
file_type="$( cat "$__object/explorer/file_type" )"
|
||||
|
||||
acl_path="/$__object_id"
|
||||
|
||||
acl_is="$( cat "$__object/explorer/acl_is" )"
|
||||
|
||||
acl_should="$( for parameter in user group
|
||||
|
|
Loading…
Reference in a new issue