dmitry          Thu Mar 23 10:15:01 2006 UTC

  Modified files:              (Branch: PHP_5_1)
    /php-src/sapi/cgi   cgi_main.c 
  Log:
  Allowed '-b' with UNIX sockets:
    -b <hostname>:<port_number>
    -b <port_number>
    -b <unix_socket_path>
  
  
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.9&r2=1.267.2.10&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.9 
php-src/sapi/cgi/cgi_main.c:1.267.2.10
--- php-src/sapi/cgi/cgi_main.c:1.267.2.9       Fri Mar 17 09:32:30 2006
+++ php-src/sapi/cgi/cgi_main.c Thu Mar 23 10:15:01 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: cgi_main.c,v 1.267.2.9 2006/03/17 09:32:30 dmitry Exp $ */
+/* $Id: cgi_main.c,v 1.267.2.10 2006/03/23 10:15:01 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -921,6 +921,17 @@
 }
 #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 @@
                 * 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);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to