Server doesn't run anymore on 13, probably because of regexp changes. It fails with message : "Error in regexp '\s*(;\s*)?--(\s|') Error initializing SQL injection detection." I'm on freshly installed 13.0-RELEASE so I assume everyone is affected? Problem is at the beginning of session.c I think. Since I needed to run it I replaced every occurence of \\s with [[:space:]] Not sure if that's right though, I don't use sqli detection, just needed it to not die on this initialization.
Small repro: #include <regex.h> #include <stdio.h> int main() { regex_t regexp; int ret = regcomp(®exp, "\\s*", REG_EXTENDED | REG_ICASE | REG_NOSUB); if ( ret != 0) { printf("regexp compilation failed: %d\n", ret); } return 0; } This one works in 12.2 but fails to compile the regexp in FreeBSD 14.0-CURRENT #11 main-n245984-15221c552b3c with error 5 REG_EESCAPE `\' applied to unescapable character.
(In reply to Fernando Apesteguía from comment #1) Two paths forward, either is fine: 1.) As recommended by the reporter, \\s -> [[:space:]] to make these POSIX compliant expressions, OR 2.) Link against libregex, using devel/libgnuregex for FreeBSD < 13.0 and base libregex for >= 13.0 I'd tend to advise #1 because this is a GNUism.
Created attachment 224467 [details] Patch to fix regexp
Thanks Kyle! Ascilia, would you mind trying the attached patch? It seems to work for me, but I don't use this port and would appreciate if you could do some testing :-) Thanks!
It is identical to what i've done, so yea it works fine for me, then again I won't guarantee sql injection detection still works. Thanks
Committed, Thanks!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=f9372d01e096cb391b3ebc5cd69d7bebd640b5e9 commit f9372d01e096cb391b3ebc5cd69d7bebd640b5e9 Author: Fernando ApesteguÃa <fernape@FreeBSD.org> AuthorDate: 2021-04-27 07:17:30 +0000 Commit: Fernando ApesteguÃa <fernape@FreeBSD.org> CommitDate: 2021-04-27 13:45:53 +0000 www/hiawatha : Fix run errors on 13 Change regular expressions to POSIX-style. References: https://lists.freebsd.org/pipermail/freebsd-hackers/2021-April/057275.html PR: 255182 Reported by: ascilia@free.fr www/hiawatha/files/patch-src_session.c (new) | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
(In reply to Ascilia from comment #5) FWIW, having hit this means that sql injection detection was almost certainly not working before, it just silently failed trying to match the literal s rather than a space.