[Dnsmasq-discuss] Extension to hosts-dir and dhcohosts-dir

Andy Hawkins andy at gently.org.uk
Sun Feb 11 11:30:38 GMT 2018


Hi,

In article <20180211083655.GY21645 at gpm.stappers.nl>,
           Geert Stappers<stappers at stappers.nl> wrote:
> I do read that statement as 80% of needed source code already present.
> Craft the missing source code into a patch, posted to here
> and see what happens.

I decided to do exactly that, and started looking at the code. It looks like
it should already be ignoring files that end in a ~. However, on my version
it's not.

In inotify.c, around line 236 is the following code block:

	  /* ignore emacs backups and dotfiles */
	  if (in->len == 0 || 
	      in->name[in->len - 1] == '~' ||
	      (in->name[0] == '#' && in->name[in->len - 1] == '#') ||
	      in->name[0] == '.')
	    continue;
	  
However, if I create a file called 'fred~' in the directory I've specified
using dhcp-hostsdir I still get an event in syslog that shows this file is
being processed:

Feb 11 11:14:34 xcp-gateway dnsmasq[1039]: inotify, new or changed file 
	/etc/dnsmasq/dhcp-hosts.d/fred~

This suggest that either I'm reading the code incorrectly (perfectly
possible!) or that the code isn't doing what it is supposed to do?

Which is it? Anyone?

Thanks

Andy




More information about the Dnsmasq-discuss mailing list