#29574 [Opn->Csd]: [PATCH] FastCgi server can't be used with unix domain sockets

From: Date: Mon, 03 Apr 2006 12:03:37 +0000
Subject: #29574 [Opn->Csd]: [PATCH] FastCgi server can't be used with unix domain sockets
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95280@lists.php.net to get a copy of this message
ID: 29574 Updated by: tony2001@php.net Reported By: skettler@php.net -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: *nix PHP Version: 5CVS, 4CVS (2005-07-12) New Comment: Dmitry has implemented this in 5.1 in different way. Previous Comments: ------------------------------------------------------------------------ [2005-07-12 18:05:02] sniper@php.net See also bug #33663 with another patch. ------------------------------------------------------------------------ [2004-08-08 19:56:03] skettler@php.net Description: ------------ The cgi module does not accept unix domain sockets as parameters to option "-b", as it will be prefixed by ":". This is needed so I don't have to revert to using iptables with owner matching to set access restrictions for local users; but use directory/file permissions. Here's a patch against the latest CVS version to not prepend bindpath with ":" when it looks like a file: Index: sapi/cgi/cgi_main.c =================================================================== RCS file: /repository/php-src/sapi/cgi/cgi_main.c,v retrieving revision 1.256 diff -u -r1.256 cgi_main.c --- sapi/cgi/cgi_main.c 14 Jul 2004 22:30:27 -0000 1.256 +++ sapi/cgi/cgi_main.c 8 Aug 2004 14:53:57 -0000 @@ -1130,7 +1130,7 @@ * path (it's what the fastcgi library expects) */ - if (strchr(bindpath, ':') == NULL) { + if ((strchr(bindpath, ':') == NULL) && (strchr(bindpath, '/') == NULL)) { char *tmp; tmp = malloc(strlen(bindpath) + 2); Reproduce code: --------------- php -b /var/run/fastcgi/php4-someuser Expected result: ---------------- Start a FastCgi server listening on "/var/run/fastcgi/php4-someuser". Actual result: -------------- No server starting as ":/var/run/fastcgi/php4-someuser" is passed to libfcgi. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29574&edit=1

« previous php.bugs (#95280) next »