[Dnsmasq-discuss] dnsmasq 2.21 breaks file names containing commas

Eric P. Scott eps+dnsmasq@ana.com
Fri, 25 Mar 2005 17:09:19 -0800 (PST)


I'm using a command line like:

dnsmasq -h -u bind -g dialer -i lo0 -b -r /etc/resolv.conf,isp1 -n -D -d -q

to provide local DNS caching on a mobile FreeBSD 4.x system.
This worked rather well up through 2.20, but now fails due to an
ill-conceived addition to dnsmasq-2.21/src/option.c [lines 232-235]:

	  if (optarg)
	    for (p = optarg; *p; p++)
	      if (*p == ',')
		*p = '\001';

This causes dnsmasq to die when it fails to open /etc/resolv.conf^Aisp1.

1) Treat argv[] as read-only.  The only legitimate reason to
scribble over it is to subvert ps(1), and then only if something
like setproctitle(3) isn't available on the target platform.

2) All characters (other than NUL, obviously) should be
acceptable in file names.  The only printable character
traditionally eschewed is the colon(:).

I suggest reverting to the way things were in 2.20, and
considering other approaches to achieve the desired results.

					-=EPS=-