David Frederick Coulthart
2004-Sep-15 21:47 UTC
[syslinux] PATCH: tftp-hpa: bug in remap code
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 */ }
David Frederick Coulthart wrote:> 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. >Right you are. I will fix this and release a 0.40 asap. -hpa