[Dnsmasq-discuss] Update: Lowercase patch for 2.61rc2

Simon Kelley simon at thekelleys.org.uk
Fri Apr 20 16:15:01 BST 2012

On 20/04/12 08:20, Oliver Rath wrote:
> Hi Simon,
> Am 18.04.2012 17:31, schrieb Simon Kelley:
>> [.. ]Dumb question: you're recommending using lowntfs-3g, but that has
>> an "ignore-case" mount option. Doesn't that solve the problem without
>> having to make changes to dnsmasq?
> You are right, I could use this option for solving my problem if i could
> use lowntfs as destination source for tftp-client-request.
> But unfortunatly its not so easy:
> My personal main focus for the --tftp-lowercase option was using it with
> linux-ris (http://oss.netfarm.it/guides/ris-linux.php) BINL-services,
> but I thought, this would be to special for writing it in the manpage.
> I use lowntfs for _copying_ driver from a ntfs-source to my
> driver-directory (i.e. ext4). Because I have lots of different sources
> for driver files, there are different ways getting all files to lowercase.
> The main problem of this sources is, that often filenames are used with
> uppercase inside without need (probably for signing different version of
> drivers without offering a version number), so getting this files via
> tftp will fail. This i found on xp-cds, too.
> So i created a pool with lots of drivers, all lowercase, so there is no
> problem transferring it via tftp (of dnsmasq) using this option.
> Now you can say: Ok, why you dont use a partition with the
> ignore_case-Option holding all this drivers? This is right unless you
> are working on embedded environment with low space.  There it is much
> smarter using the lowercase-option than creating an additional partition.
> If you like, i can add some use cases like this to manpage, so people
> could find it useful. But if you think, this shouldnt get into dnsmasq,
> i have no problem with this because i can patch and compile dnsmasq for
> myself. That is the fine thing of Open Source. :-)

> For the tftp-code there are two open questions for me:
> 1. What happens, if there are "special" characters in the path (like
> spaces, "&" oder ";")?

anything apart from "/" "." and NULL is fair game in a POSIX filename. 
dnsmasq maps "\" to "/" as, we've discussed.

> 2. What will happen, if there are utf8 or utf16 charactars in the path
> (will happen in non-latin environments)?

I guess it depends on the filesystem. The situation is not entirely 
satisfactory: see


> it will maybe help for your decision, that the code from 2.61rc2 ->
> 2.61rc2+locase will grow about 32 bytes (in x86_64 environmennt),

I'm actually more worried that it's yet another option, but I can see 
the utility of this.

> Nevertheless, the most powerful solution would be the ability exporting
> the tftp-request-path to a script (i.e. sed) for manipulation _before_
> using it. If this would be possible, please kick out my patch :-)

It's difficult: what you really don't want is for the script to block, 
because that causes all DNS and DHCP activity to stop too. The worst 
case is that the script does something that needs to make a DNS lookup 
and deadlocks.

I'll make an rc3 release with this in later today, aiming for 2.61final 
early next week.



More information about the Dnsmasq-discuss mailing list