mirror of
https://github.com/Kicksecure/security-misc.git
synced 2025-12-16 07:53:50 -05:00
improve character whitelisting
This commit is contained in:
parent
8f14e808a9
commit
66bcba8313
1 changed files with 9 additions and 3 deletions
|
|
@ -36,12 +36,18 @@ add_statoverride_entry() {
|
|||
|
||||
set_file_perms() {
|
||||
while read -r line; do
|
||||
if [[ "$line" =~ ^#.*$ ]]; then
|
||||
echo "ERROR: cannot parse line with invalid character: ${line}" >&2
|
||||
if [ "$line" = "" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "${line}" = "" ]; then
|
||||
if [[ "$line" =~ ^# ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ "$line" =~ [0-9a-zA-Z/] ]]; then
|
||||
true OK
|
||||
else
|
||||
echo "ERROR: cannot parse line with invalid character: ${line}" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue