forked from ungleich-public/cdist
__acl: add --source
This commit is contained in:
parent
45890cc7e4
commit
e1ac97b6a5
3 changed files with 24 additions and 1 deletions
|
@ -28,7 +28,17 @@ acl_path="/$__object_id"
|
||||||
|
|
||||||
acl_is="$( cat "$__object/explorer/acl_is" )"
|
acl_is="$( cat "$__object/explorer/acl_is" )"
|
||||||
|
|
||||||
if [ -f "$__object/parameter/entry" ]
|
if [ -f "$__object/parameter/source" ]
|
||||||
|
then
|
||||||
|
acl_source="$( cat "$__object/parameter/source" )"
|
||||||
|
|
||||||
|
if [ "$acl_source" = '-' ]
|
||||||
|
then
|
||||||
|
acl_should="$( cat "$__object/stdin" )"
|
||||||
|
else
|
||||||
|
acl_should="$( grep -Ev '^#|^$' "$acl_source" )"
|
||||||
|
fi
|
||||||
|
elif [ -f "$__object/parameter/entry" ]
|
||||||
then
|
then
|
||||||
acl_should="$( cat "$__object/parameter/entry" )"
|
acl_should="$( cat "$__object/parameter/entry" )"
|
||||||
elif [ -f "$__object/parameter/acl" ]
|
elif [ -f "$__object/parameter/acl" ]
|
||||||
|
|
|
@ -19,6 +19,14 @@ entry
|
||||||
Set ACL entry following ``getfacl`` output syntax.
|
Set ACL entry following ``getfacl`` output syntax.
|
||||||
|
|
||||||
|
|
||||||
|
OPTIONAL PARAMETERS
|
||||||
|
-------------------
|
||||||
|
source
|
||||||
|
Read ACL entries from stdin or file.
|
||||||
|
Ordering of entries is not important.
|
||||||
|
When reading from file, comments and empty lines are ignored.
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN PARAMETERS
|
BOOLEAN PARAMETERS
|
||||||
------------------
|
------------------
|
||||||
default
|
default
|
||||||
|
@ -71,6 +79,10 @@ EXAMPLES
|
||||||
--entry group:secret-project:rwx \
|
--entry group:secret-project:rwx \
|
||||||
--entry user:alice:r-x
|
--entry user:alice:r-x
|
||||||
|
|
||||||
|
# read acl from stdin
|
||||||
|
echo 'user:alice:rwx' \
|
||||||
|
| __acl /path/to/directory --source -
|
||||||
|
|
||||||
|
|
||||||
AUTHORS
|
AUTHORS
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
mask
|
mask
|
||||||
other
|
other
|
||||||
|
source
|
||||||
|
|
Loading…
Reference in a new issue