From 0c1b4f45eb4a8116536aa5b44b3891b024f73e47 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 23 Mar 2006 10:15:01 +0000 Subject: [PATCH] Allowed '-b' with UNIX sockets: -b : -b -b --- sapi/cgi/cgi_main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 193506a346..c9e3317ee6 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -921,6 +921,17 @@ void fastcgi_cleanup(int signal) } #endif +static int is_port_number(const char *bindpath) +{ + while (*bindpath) { + if (*bindpath < '0' || *bindpath > '9') { + return 0; + } + bindpath++; + } + return 1; +} + /* {{{ main */ int main(int argc, char *argv[]) @@ -1147,7 +1158,7 @@ consult the installation file that came with this distribution, or visit \n\ * path (it's what the fastcgi library expects) */ - if (strchr(bindpath, ':') == NULL) { + if (strchr(bindpath, ':') == NULL && is_port_number(bindpath)) { char *tmp; tmp = malloc(strlen(bindpath) + 2); -- 2.50.1