__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/>.
|
# 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
|
if ! command -v getfacl 2>/dev/null
|
||||||
then
|
then
|
||||||
echo 'getfacl not available' >&2
|
echo 'getfacl not available' >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e "/$__object_id" ]
|
getfacl "$acl_path" 2>/dev/null \
|
||||||
then
|
|
||||||
getfacl "/$__object_id" 2>/dev/null \
|
|
||||||
| grep -E '^((default:)?(user|group):[^:]|(default:)?mask::)' \
|
| grep -E '^((default:)?(user|group):[^:]|(default:)?mask::)' \
|
||||||
|| true
|
|| true
|
||||||
fi
|
|
||||||
|
|
|
@ -18,11 +18,12 @@
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ -e "/$__object_id" ]
|
acl_path="/$__object_id"
|
||||||
then
|
|
||||||
if [ -d "/$__object_id" ]
|
[ ! -e "$acl_path" ] && exit 0
|
||||||
then echo d
|
|
||||||
elif [ -f "/$__object_id" ]
|
if [ -d "$acl_path" ]
|
||||||
then echo f
|
then echo d
|
||||||
fi
|
elif [ -f "$acl_path" ]
|
||||||
|
then echo f
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -18,12 +18,14 @@
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
# 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" )"
|
os="$( cat "$__global/explorer/os" )"
|
||||||
|
|
||||||
file_type="$( cat "$__object/explorer/file_type" )"
|
file_type="$( cat "$__object/explorer/file_type" )"
|
||||||
|
|
||||||
acl_path="/$__object_id"
|
|
||||||
|
|
||||||
acl_is="$( cat "$__object/explorer/acl_is" )"
|
acl_is="$( cat "$__object/explorer/acl_is" )"
|
||||||
|
|
||||||
acl_should="$( for parameter in user group
|
acl_should="$( for parameter in user group
|
||||||
|
|
Loading…
Reference in a new issue