[4/5] initscripts: functions: Permit ! in the value of key/value files

Message ID 20260119162140.3373757-4-michael.tremer@ipfire.org
State New
Headers
Series [1/5] hostapd: Bring back support for 802.11g/a |

Commit Message

Michael Tremer 19 Jan 2026, 4:21 p.m. UTC
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 src/initscripts/system/functions | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/src/initscripts/system/functions b/src/initscripts/system/functions
index 757912eab..c0c40e986 100644
--- a/src/initscripts/system/functions
+++ b/src/initscripts/system/functions
@@ -923,7 +923,7 @@  readhash() {
 		local val="${line#*=}"
 
 		# Skip lines with invalid values
-		if ! [[ ${val} =~ ^[\'][\ A-Za-z0-9=/,.:%_@#+-]*[\']$ ]] && ! [[ ${val} =~ ^[A-Za-z0-9=/,.:%_@#+-]*$ ]]; then
+		if ! [[ ${val} =~ ^[\'][\ A-Za-z0-9=/,.:%_@#+-\\!]*[\']$ ]] && ! [[ ${val} =~ ^[A-Za-z0-9=/,.:%_@#+-\\!]*$ ]]; then
 			echo "Invalid value '${val}' for key '${key}'" >&2
 			continue
 		fi