__acl: only directories can have default ACLs

This commit is contained in:
ander 2019-04-16 14:39:45 +03:00
parent d71eb3d8bd
commit ef8ff06b5f
2 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,28 @@
#!/bin/sh -e
#
# 2018 Ander Punnar (ander-at-kvlt-dot-ee)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
if [ -e "/$__object_id" ]
then
if [ -d "/$__object_id" ]
then echo d
elif [ -f "/$__object_id" ]
then echo f
fi
fi

View File

@ -20,6 +20,8 @@
os="$( cat "$__global/explorer/os" )"
file_type="$( cat "$__object/explorer/file_type" )"
acl_path="/$__object_id"
acl_is="$( cat "$__object/explorer/acl_is" )"
@ -33,7 +35,8 @@ do
do
echo "$parameter:$l"
if [ -f "$__object/parameter/default" ]
if [ -f "$__object/parameter/default" ] \
&& [ "$file_type" = 'd' ]
then echo "default:$parameter:$l"
fi
done < "$__object/parameter/$parameter"
@ -44,7 +47,8 @@ then
echo "mask::$l"
if [ -f "$__object/parameter/default" ]
if [ -f "$__object/parameter/default" ] \
&& [ "$file_type" = 'd' ]
then echo "default:mask::$l"
fi
fi