1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:setup: Fix shellcheck errors in provision_fileperms.sh

source4/setup/tests/provision_fileperms.sh:27:14: error: Iterating over
ls output is fragile. Use globs. [SC2045]

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
This commit is contained in:
Andreas Schneider 2022-06-10 13:29:19 +02:00 committed by Pavel Filipensky
parent 6c2871429f
commit b1e80d02c7

View File

@ -24,16 +24,14 @@ check_private_file_perms()
target_dir="$1/private"
result=0
for file in $(ls $target_dir/); do
filepath="$target_dir/$file"
for file in "${target_dir}"/*; do
# skip directories/sockets for now
if [ ! -f $filepath ]; then
if [ ! -f $file ]; then
continue
fi
# use stat to get the file permissions, i.e. -rw-------
file_perm=$(stat -c "%A" $filepath)
file_perm=$(stat -c "%A" $file)
# then use cut to drop the first 4 chars containing the file type
# and owner permissions. What's left is the group and other users