Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# platform = multi_platform_sle,multi_platform_rhel,multi_platform_fedora,multi_platform_ubuntu

useradd user_test

TESTDIR="/usr/lib/"

# The check ignores this symlink and results in pass
ln -s $TESTDIR/mising_test_file $TESTDIR/faulty_symlink
chown -h user_test $TESTDIR/faulty_symlink
6 changes: 3 additions & 3 deletions shared/templates/file_groupowner/bash.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
{{% for path in FILEPATH %}}
{{%- if IS_DIRECTORY %}}
{{%- if FILE_REGEX %}}
readarray -t files < <(find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} ! -gid {{{ FILEGID }}})
readarray -t files < <(find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -gid {{{ FILEGID }}})
for file in "${files[@]}"; do
if basename $file | grep -qE '{{{ FILE_REGEX[loop.index0] }}}'; then
chgrp -h {{{ FILEGID }}} "$file"
if basename "$file" | grep -qE '{{{ FILE_REGEX[loop.index0] }}}'; then
chgrp {{{ FILEGID }}} "$file"
fi
done
{{% else %}}
Expand Down
6 changes: 3 additions & 3 deletions shared/templates/file_owner/bash.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
{{% for path in FILEPATH %}}
{{%- if IS_DIRECTORY %}}
{{%- if FILE_REGEX %}}
readarray -t files < <(find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} ! -uid {{{ FILEUID }}})
readarray -t files < <(find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f ! -uid {{{ FILEUID }}})
for file in "${files[@]}"; do
if basename $file | grep -qE '{{{ FILE_REGEX[loop.index0] }}}'; then
chown -h {{{ FILEUID }}} "$file"
if basename "$file" | grep -qE '{{{ FILE_REGEX[loop.index0] }}}'; then
chown {{{ FILEUID }}} "$file"
fi
done
{{%- else %}}
Expand Down
4 changes: 2 additions & 2 deletions shared/templates/file_permissions/bash.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
{{% for path in FILEPATH %}}
{{%- if IS_DIRECTORY %}}
{{%- if FILE_REGEX %}}
readarray -t files < <(find {{{ path }}} {{{ FIND_RECURSE_ARGS }}})
readarray -t files < <(find {{{ path }}} {{{ FIND_RECURSE_ARGS }}} -type f)
for file in "${files[@]}"; do
if basename $file | grep -qE '{{{ FILE_REGEX[loop.index0] }}}'; then
if basename "$file" | grep -qE '{{{ FILE_REGEX[loop.index0] }}}'; then
chmod {{{ FILEMODE }}} "$file"
fi
done
Expand Down