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:
parent
6c2871429f
commit
b1e80d02c7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user