From 07fd359435d2639a0ed4e85268a0de309d50035b Mon Sep 17 00:00:00 2001 From: Matthew Burket Date: Tue, 23 Jul 2024 14:44:10 -0500 Subject: [PATCH] Adjust bash template groupfile_owner to follow symlinks --- shared/templates/file_groupowner/bash.template | 8 ++++---- shared/templates/file_owner/bash.template | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/shared/templates/file_groupowner/bash.template b/shared/templates/file_groupowner/bash.template index cd7cc8d72f1..7b53efeda4c 100644 --- a/shared/templates/file_groupowner/bash.template +++ b/shared/templates/file_groupowner/bash.template @@ -7,18 +7,18 @@ {{%- if RECURSIVE %}} {{%- set FIND_RECURSE_ARGS="" %}} {{%- else %}} -{{%- set FIND_RECURSE_ARGS="-maxdepth 1" %}} +{{%- set FIND_RECURSE_ARGS="-maxdepth 1 -L" %}} {{%- endif %}} {{%- for path in FILEPATH %}} {{%- if IS_DIRECTORY %}} {{%- if FILE_REGEX %}} -find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -group {{{ GID_OR_NAME }}} -regextype posix-extended -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chgrp {{{ GID_OR_NAME }}} {} \; +find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -group {{{ GID_OR_NAME }}} -regextype posix-extended -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chgrp -L {{{ GID_OR_NAME }}} {} \; {{%- else %}} -find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type d -exec chgrp {{{ GID_OR_NAME }}} {} \; +find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type d -exec chgrp -L {{{ GID_OR_NAME }}} {} \; {{%- endif %}} {{%- else %}} -chgrp {{{ GID_OR_NAME }}} {{{ path }}} +chgrp -L {{{ GID_OR_NAME }}} {{{ path }}} {{%- endif %}} {{%- endfor %}} diff --git a/shared/templates/file_owner/bash.template b/shared/templates/file_owner/bash.template index c10a7f58997..4ac398af5e2 100644 --- a/shared/templates/file_owner/bash.template +++ b/shared/templates/file_owner/bash.template @@ -7,18 +7,18 @@ {{%- if RECURSIVE %}} {{%- set FIND_RECURSE_ARGS="" %}} {{%- else %}} -{{%- set FIND_RECURSE_ARGS="-maxdepth 1" %}} +{{%- set FIND_RECURSE_ARGS="-maxdepth 1 -L" %}} {{%- endif %}} {{%- for path in FILEPATH %}} {{%- if IS_DIRECTORY %}} {{%- if FILE_REGEX %}} -find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -uid {{{ FILEUID }}} -regextype posix-extended -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chown {{{ FILEUID }}} {} \; +find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -uid {{{ FILEUID }}} -regextype posix-extended -regex '{{{ FILE_REGEX[loop.index0] }}}' -exec chown -L {{{ FILEUID }}} {} \; {{%- else %}} -find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type d -exec chown {{{ FILEUID }}} {} \; +find -H {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type d -exec chown -L {{{ FILEUID }}} {} \; {{%- endif %}} {{%- else %}} -chown {{{ FILEUID }}} {{{ path }}} +chown -L {{{ FILEUID }}} {{{ path }}} {{%- endif %}} {{%- endfor %}}