mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-10-01 08:25:45 -04:00
use read (built-in) rather than awk (external)
This commit is contained in:
parent
02165201ab
commit
c258376b7e
9
usr/lib/security-misc/permission-hardening
Normal file → Executable file
9
usr/lib/security-misc/permission-hardening
Normal file → Executable file
@ -6,11 +6,10 @@ set_file_perms() {
|
||||
while read -r line; do
|
||||
[[ "$line" =~ ^#.*$ ]] && continue
|
||||
|
||||
file="$(awk '{print $1}' <<< ${line})"
|
||||
mode="$(awk '{print $2}' <<< ${line})"
|
||||
owner="$(awk '{print $3}' <<< ${line})"
|
||||
group="$(awk '{print $4}' <<< ${line})"
|
||||
capability="$(awk '{print $5}' <<< ${line})"
|
||||
if ! read -r file mode owner group capability <<< "${line}" ; then
|
||||
echo "ERROR: cannot parse line: ${line}"
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! [ -e "${file}" ]; then
|
||||
echo "ERROR: File '${file}' does not exist!"
|
||||
|
Loading…
Reference in New Issue
Block a user