- Don't iterate over each string three times; once is enough.
- Reject control characters (anything below space) in addition to the double quote and backslash.
- If an unsafe character is encountered, discard the string instead of rejecting the entire lease.
- If backslashes are encountered in the file name option, convert them to forward slashes instead of rejecting the option.
- Tweak the warning messages a bit. Looking through the rest of the code, it seems to me that notes generally end with a period while warnings generally don't.
Fixes: 8008e4b88daf ("dhclient: Check for unexpected characters in some
DHCP server options")
PR: 294886
MFC after: 1 week