improve character whitelisting

This commit is contained in:
Patrick Schleizer 2019-12-20 01:58:35 -05:00
parent 8f14e808a9
commit 66bcba8313
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -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