ID: 29574
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Verified
Bug Type: CGI related
Operating System: *nix
PHP Version: 5CVS, 4CVS (2005-03-07)
New Comment:
See also bug #33663 with another patch.
Previous Comments:
------------------------------------------------------------------------
[2004-08-08 19:56:03] [EMAIL PROTECTED]
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