Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration file: quotes #23

Open
reynir opened this issue Dec 4, 2024 · 1 comment
Open

configuration file: quotes #23

reynir opened this issue Dec 4, 2024 · 1 comment

Comments

@reynir
Copy link
Contributor

reynir commented Dec 4, 2024

dnsmasq allows in configuration files only to quote strings using a pair of double qutoes ("). Inside the quotes some escape sequences using back slash are allowed.

The implementation (dnsmasq:src/option.c function read_file()) is super hairy and hard to understand. The quote handling is done by replacing the backslash with the escaped value and calling memmove(p, p+1, strlen(p+1)+1) so it is potentially quadratic (why?!)

Since I think this would not be straight forward to implement (particularly with angstrom) and none of the example configs have quoted strings I suggest we investigate if it makes sense to not implement this feature. Particularly, it would be interesting to look for configurations that use quotes to determine the value of this feature. In the meantime I suggest we don't implement this feature.

@reynir
Copy link
Contributor Author

reynir commented Dec 12, 2024

Grepping the Dnsmasq man page for quote I found they suggest using quotes for --txt-record if the TXT record data contains commas. Another place is in --dhcp-option for e.g. vendor extensions. The example uses a string that looks like an ip address (1.2.3.4) but is to be interpreted literally. Dnsmasq will parse things that look like ip addresses as ip addresses if unquoted.

Now, in command line arguments it seems quotes are not allowed (or interpreted). It's unclear to me what you're supposed to do then in the above examples.

So far I think we can continue not implementing quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant