[Dnsmasq-discuss] tftp fix for windows pe

Ralf ralf at vierhalbe.de
Sun Jun 28 13:09:07 BST 2009


Hi,

I tried dnsmasq as tftp/pxe server for a vista pe boot.
The requests failed cause of the backslashes
    TFTP file /var/tftpd/\Boot\BCD not found

This little fix helped, just in case someone else needs it.
Btw, very nice to have all 3 services in programm.
Greets ralf

--- tftp.c.org  2009-06-08 23:12:44.000000000 +0200
+++ tftp.c      2009-06-28 13:54:41.000000000 +0200
@@ -233,7 +233,12 @@
              if (stat(daemon->namebuff, &statbuf) == -1 ||
!S_ISDIR(statbuf.st_mode))
                daemon->namebuff[oldlen] = 0;
            }
-
+
+               /* Windows OS may request filenames containing
backslashes instead of slashes */
+               char *searchptr;
+               while (searchptr = strstr (filename,"\\"))
+                       searchptr[0]='/';
+
          /* Absolute pathnames OK if they match prefix */
          if (filename[0] == '/')
            {






More information about the Dnsmasq-discuss mailing list