ID:               40419
 Comment by:       bugs at spuetz dot ath dot cx
 Reported By:      samuele dot diella at gmail dot com
 Status:           Feedback
 Bug Type:         CGI related
 Operating System: Slackware 10.2
 PHP Version:      5.2.1
 Assigned To:      dmitry
 New Comment:

Your patch works.


Previous Comments:
------------------------------------------------------------------------

[2007-06-22 12:00:05] [EMAIL PROTECTED]

Could you test the following patch.

http://phpfi.com/243843

------------------------------------------------------------------------

[2007-06-21 10:21:40] bugs at spuetz dot ath dot cx

I tried 5.2.3 and it doesn't work without patch. 

I just created a vhost with unpatched 5.2.3:
http://bug40419.screenwork-dev.de/info.php => works
http://bug40419.screenwork-dev.de/info.php/ => no input...

With patch:
http://www1.screenwork.de/mas/phpinfo.php
http://www1.screenwork.de/mas/phpinfo.php/

Patched with: http://www1.screenwork.de/mas/40419.patch

Do you need anything else?

------------------------------------------------------------------------

[2007-05-21 11:51:49] jankorichter at yahoo dot de

Yes, cgi.fix_pathinfo is set to 1. I have checked it with phpinfo().
But it doesn't work without patch.

------------------------------------------------------------------------

[2007-05-21 11:31:04] [EMAIL PROTECTED]

Check that cgi.fix_pathinfo in php.ini is set to 1.

I cannot reproduce the behavior and cannot understand how patch can fix
it.

------------------------------------------------------------------------

[2007-05-21 10:45:08] jankorichter at yahoo dot de

SCRIPT_FILENAME fixed.


--- php-5.2.2/sapi/cgi/cgi_main.c       2007-04-17 22:00:53.000000000
+0200
+++ php-5.2.2.new/sapi/cgi/cgi_main.c   2007-05-21 12:24:31.000000000
+0200
@@ -961,7 +961,15 @@
                /* some server configurations allow '..' to slip
through in the
                   translated path.   We'll just refuse to handle such
a path. */
                if (script_path_translated &&
!strstr(script_path_translated, "..")) {
-                       SG(request_info).path_translated =
estrdup(script_path_translated);
+                       char * real_path =
tsrm_realpath(script_path_translated, NULL TSRMLS_CC);
+                       if ( real_path )
+                       {
+                         SG(request_info).path_translated =
estrdup(real_path);
+                         script_path_translated =
_sapi_cgibin_putenv("SCRIPT_FILENAME", real_path TSRMLS_CC);
+                         free(real_path);
+                       } else {
+                         SG(request_info).path_translated =
estrdup(script_path_translated);
+                        }
                }
                SG(request_info).content_type = (content_type ?
content_type : "" );
                SG(request_info).content_length = (content_length ?
atoi(content_length) : 0);

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/40419

-- 
Edit this bug report at http://bugs.php.net/?id=40419&edit=1

Reply via email to