forked from ungleich-public/cdist
__acl: only directories can have default ACLs
This commit is contained in:
parent
d71eb3d8bd
commit
ef8ff06b5f
2 changed files with 34 additions and 2 deletions
28
cdist/conf/type/__acl/explorer/file_type
Executable file
28
cdist/conf/type/__acl/explorer/file_type
Executable 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
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
os="$( cat "$__global/explorer/os" )"
|
os="$( cat "$__global/explorer/os" )"
|
||||||
|
|
||||||
|
file_type="$( cat "$__object/explorer/file_type" )"
|
||||||
|
|
||||||
acl_path="/$__object_id"
|
acl_path="/$__object_id"
|
||||||
|
|
||||||
acl_is="$( cat "$__object/explorer/acl_is" )"
|
acl_is="$( cat "$__object/explorer/acl_is" )"
|
||||||
|
@ -33,7 +35,8 @@ do
|
||||||
do
|
do
|
||||||
echo "$parameter:$l"
|
echo "$parameter:$l"
|
||||||
|
|
||||||
if [ -f "$__object/parameter/default" ]
|
if [ -f "$__object/parameter/default" ] \
|
||||||
|
&& [ "$file_type" = 'd' ]
|
||||||
then echo "default:$parameter:$l"
|
then echo "default:$parameter:$l"
|
||||||
fi
|
fi
|
||||||
done < "$__object/parameter/$parameter"
|
done < "$__object/parameter/$parameter"
|
||||||
|
@ -44,7 +47,8 @@ then
|
||||||
|
|
||||||
echo "mask::$l"
|
echo "mask::$l"
|
||||||
|
|
||||||
if [ -f "$__object/parameter/default" ]
|
if [ -f "$__object/parameter/default" ] \
|
||||||
|
&& [ "$file_type" = 'd' ]
|
||||||
then echo "default:mask::$l"
|
then echo "default:mask::$l"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue