From ad3f44bc779bcefb06e3c8ce977b7d242bfac6cc Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 1 Aug 2021 23:20:18 +0800 Subject: [PATCH] Change match to fnmatch follow the kernel side change Signed-off-by: Xiang Xiao --- netutils/thttpd/cgi-src/ssi.c | 7 +++---- netutils/thttpd/libhttpd.c | 12 ++++++------ system/trace/trace.c | 4 ++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/netutils/thttpd/cgi-src/ssi.c b/netutils/thttpd/cgi-src/ssi.c index bad3fb343..7104af2cc 100644 --- a/netutils/thttpd/cgi-src/ssi.c +++ b/netutils/thttpd/cgi-src/ssi.c @@ -7,7 +7,7 @@ * * Derived from the file of the same name in the original THTTPD package: * - * Copyright © 1995 by Jef Poskanzer . + * Copyright 1995 by Jef Poskanzer . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -46,8 +46,7 @@ #include #include #include - -#include +#include #include "config.h" @@ -339,7 +338,7 @@ static int check_filename(char *filename) /* Ensure that we are not reading a CGI file. */ - if (cgi_pattern != (char *)0 && match(cgi_pattern, filename)) + if (cgi_pattern != (char *)0 && !fnmatch(cgi_pattern, filename, 0)) { return 0; } diff --git a/netutils/thttpd/libhttpd.c b/netutils/thttpd/libhttpd.c index 1c72d0d48..015b4a3d8 100644 --- a/netutils/thttpd/libhttpd.c +++ b/netutils/thttpd/libhttpd.c @@ -7,7 +7,7 @@ * * Derived from the file of the same name in the original THTTPD package: * - * Copyright © 1995,1998,1999,2000,2001 by Jef Poskanzer . + * Copyright 1995,1998,1999,2000,2001 by Jef Poskanzer . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,8 +59,8 @@ #include #include #include +#include -#include #include "netutils/thttpd.h" #include "config.h" @@ -436,7 +436,7 @@ static void send_response(httpd_conn *hc, int status, const char *title, const c snprintf(buf, sizeof(buf), form, defanged); add_response(hc, buf); - if (match("**MSIE**", hc->useragent)) + if (!fnmatch("**MSIE**", hc->useragent, 0)) { int n; add_response(hc, "