Hi list,
I currently have a slight problem and need advice on how to solve it. We read and write our config (for example /var/ipfire/ethernet/settings) in programms in different languages. In the C code, we allow all characters: https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=src/libsmooth/varval.c;h=a...
In Bash Code, we only allow some characters: https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=src/scripts/readhash;h=bff...
So the new function https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=src/initscripts/system/fun... warns about values which are invalid and ignores those. The old readhash script has not done this. But now we are in the unfortunate situation that:
RED_DESCRIPTION='"pci: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 09)"'
is a valid config line in C code but an invalid line in Bash code. The question is: How can we solve this? Should I add code to the C library to remove all invalid characters from the values and write the value then? This might lead to problems, as we do not write the value the program has provided. So happy to receive your input on this matter.
Jonatan