diff --git a/cdist/conf/type/__acl/explorer/file_type b/cdist/conf/type/__acl/explorer/file_type new file mode 100755 index 00000000..0d1edb7d --- /dev/null +++ b/cdist/conf/type/__acl/explorer/file_type @@ -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 . +# + +if [ -e "/$__object_id" ] +then + if [ -d "/$__object_id" ] + then echo d + elif [ -f "/$__object_id" ] + then echo f + fi +fi diff --git a/cdist/conf/type/__acl/gencode-remote b/cdist/conf/type/__acl/gencode-remote index 2ea01524..355cc88e 100755 --- a/cdist/conf/type/__acl/gencode-remote +++ b/cdist/conf/type/__acl/gencode-remote @@ -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