Added optional dirmode parameter to set the mode of (optional) the directory.

This commit is contained in:
Mark Verboom 2020-12-18 11:16:28 +01:00
parent 71f2283117
commit 8dc2c4207c
4 changed files with 7 additions and 0 deletions

View file

@ -25,6 +25,9 @@ user
OPTIONAL PARAMETERS OPTIONAL PARAMETERS
------------------- -------------------
dirmode
forwarded to :strong:`__directory` type as mode
mode mode
forwarded to :strong:`__file` type forwarded to :strong:`__file` type

View file

@ -19,6 +19,7 @@ set -eu
user="$(cat "${__object}/parameter/user")" user="$(cat "${__object}/parameter/user")"
home="$(cat "${__object}/explorer/home")" home="$(cat "${__object}/explorer/home")"
primary_group="$(cat "${__object}/explorer/primary_group")" primary_group="$(cat "${__object}/explorer/primary_group")"
dirmode="$(cat "${__object}/parameter/dirmode")"
# Create parent directory. Type __directory has flag 'parents', but it # Create parent directory. Type __directory has flag 'parents', but it
# will leave us with root-owned directory in user home, which is not # will leave us with root-owned directory in user home, which is not
@ -36,6 +37,7 @@ export CDIST_ORDER_DEPENDENCY
for dir ; do for dir ; do
__directory "${home}/${dir}" \ __directory "${home}/${dir}" \
--group "${primary_group}" \ --group "${primary_group}" \
--mode "${dirmode}" \
--owner "${user}" --owner "${user}"
done done

View file

@ -0,0 +1 @@
0700

View file

@ -1,3 +1,4 @@
state state
mode mode
source source
dirmode