Browse Source

MTH: Allowed '-b' with UNIX sockets

migration/RELEASE_1_0_0
Dmitry Stogov 21 years ago
parent
commit
4b09d37f66
  1. 15
      sapi/cgi/cgi_main.c

15
sapi/cgi/cgi_main.c

@ -869,6 +869,19 @@ void fastcgi_cleanup(int signal)
exit(0);
}
#ifndef PHP_WIN32
static int is_port_number(const char *bindpath)
{
while (*bindpath) {
if (*bindpath < '0' || *bindpath > '9') {
return 0;
}
bindpath++;
}
return 1;
}
#endif
/* {{{ main
*/
int main(int argc, char *argv[])
@ -1104,7 +1117,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);

Loading…
Cancel
Save