ID:               21958
 Comment by:       ohp at pyrenet dot fr
 Reported By:      ct at swin dot edu dot au
 Status:           Assigned
 Bug Type:         Filesystem function related
 Operating System: Tru64 UNIX 5.1A
 PHP Version:      4.3.3-dev
 Assigned To:      wez
 New Comment:

Hi, Glad to see my patch works on AIX, not so glad it fails with TRU64
UNIX

Did you test with the same script/environment you wrote on Jan 30?

Did you try to log the value of path after each VCWD_REALPATH.

AFAICS, the whole bug comes from realpath doing nasty things when path
is NULL hence the strcopy I added.

Feel free to email directly. I'm not a PHP developper (I'd love the
help of one on this one) but I want to get rid of this bug.

Regards
Olivier


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

[2003-06-01 23:54:24] ct at swin dot edu dot au

Patch makes no difference with Tru64 UNIX 5.1A and PHP 4.3.2.

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

[2003-05-30 11:12:50] juha dot moisio at tietonauha dot fi

I tested that patch.
Works just fine in AIX 4.3.1 php 4.3.2

-Juha-

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

[2003-05-28 10:47:42] ohp at pyrenet dot fr

after 2 strggling, I came with the following path on 
safe_mode.c against 4.3.2RC4.
Not sure it's the right thing to do.
could someone have a look?
Regards

*** main/safe_mode.c.orig       lun mrs 17 14:50:23 2003
--- main/safe_mode.c    mar mai 27 15:06:30 2003
***************
*** 66,71 ****
--- 66,72 ----
                        mode = CHECKUID_DISALLOW_FILE_NOT_EXISTS;
                } else {
                        mode = CHECKUID_CHECK_FILE_AND_DIR;
+                       flags=1;
                }
        }
  
***************
*** 81,86 ****
--- 82,88 ----
         * If that fails, passthrough and check 
directory...
         */
        if (mode != CHECKUID_ALLOW_ONLY_DIR) {
+               strcpy(path,filename);
                VCWD_REALPATH(filename, path);
                ret = VCWD_STAT(path, &sb);
                if (ret < 0) {

this works on Unixware 713

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

[2003-05-27 06:29:50] ohp at pyrenet dot fr

I have made tons of research on this since yesterday.
It appears that realpath (at least on UW 713) set path to NULLL,
returns NULL with errno=2 in case of a non existing file on line 86 in
safe_mode.c then function proceeds to line  116 with a NULL path, all
functions fail and the file cannot be created.

Hope this help to create a patch (I'm trying to but don't know the code
enough too) Please someone help.

[EMAIL PROTECTED]

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

[2003-05-26 09:34:28] ohp at pyrenet dot fr

The bug is still there with php-4.3.2RC4 as an apache 1.3.27 module.
This is on Unixware 7.

with safe_mode=Off, file creation succeeds,
with safe_mode=On, file creattion fails with "failed to open stream: no
such file or directory ..."

I've tried setting the dir 777, make it owned by apache UID.. Nothing
worked.

A truss of the apache server showed that the last syscall before failed
was a pathconf(filename,...) returning ENOENT
File didn't exist so it's normal.

Please help

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

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/21958

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

Reply via email to