[syslinux] PATCH: tftp-hpa: bug in remap code

David Frederick Coulthart davec at columbia.edu
Wed Sep 15 14:47:26 PDT 2004


I was just trying to upgrade to tftp-hpa-0.39 & my remap file contained 
the following line:

re      .*      \i/\0


This worked with both versions 0.36 & 0.38, but caused the following 
error message with 0.39:

in.tftpd[20958]: [ID 622042 daemon.error] r rules cannot be inverted, 
line 1:    .*      \i/\0


Looking at tftpd/remap.c, it appears that the check that was supposed to 
return true if both RULE_REWRITE & RULE_INVERSE were true actually 
returned true if either were true.  The attached patch fixes that.

HTH,
David Coulthart
-------------- next part --------------
--- tftpd/remap.c.old	2004-09-15 17:15:17.414542000 -0400
+++ tftpd/remap.c	2004-09-15 17:16:52.331163000 -0400
@@ -234,7 +234,7 @@
   if ( !(r->rule_flags & RULE_REWRITE) )
     r->rule_flags &= ~RULE_GLOBAL;
 
-  if ( r->rule_flags & (RULE_INVERSE|RULE_REWRITE) ) {
+  if ( (r->rule_flags & RULE_INVERSE) && (r->rule_flags & RULE_REWRITE) ) {
     syslog(LOG_ERR, "r rules cannot be inverted, line %d: %s\n", lineno, line);
     return -1;			/* Error */
   }


More information about the Syslinux mailing list