From: Art Cancro Date: Wed, 9 May 2007 18:59:58 +0000 (+0000) Subject: Added more URL prefixes to is_bogus() to reflect the X-Git-Tag: v7.86~3384 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=d839ad46716430aaef55d2d38c5709d1b7e72b39;p=citadel.git Added more URL prefixes to is_bogus() to reflect the latest collection of brain-dead Microsoft shitware that assumes everyone is an IIS box. --- diff --git a/webcit/context_loop.c b/webcit/context_loop.c index 7f18c0976..a4759ce99 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -232,18 +232,27 @@ int lingering_close(int fd) */ int is_bogus(char *http_cmd) { char *url; + int i, max; url = strstr(http_cmd, " "); if (url == NULL) return(1); ++url; - /** Worms and trojans and viruses, oh my! */ - if (!strncasecmp(url, "/scripts/root.exe", 17)) return(2); - if (!strncasecmp(url, "/c/winnt", 8)) return(2); - if (!strncasecmp(url, "/MSADC/", 7)) return(2); + char *bogus_prefixes[] = { + "/scripts/root.exe", /**< Worms and trojans and viruses, oh my! */ + "/c/winnt", + "/MSADC/", + "/_vti", /**< Broken Microsoft DAV implementation */ + "/MSOffice" /**< Stoopid MSOffice thinks everyone is IIS */ + }; - /** Broken Microsoft DAV implementation */ - if (!strncasecmp(url, "/_vti", 5)) return(3); + max = sizeof(bogus_prefixes) / sizeof(char *); + + for (i=0; i