From:             Bjorn dot Wiberg at its dot uu dot se
Operating system: IBM AIX 5.3 5300-05-06
PHP version:      5.2.4
PHP Bug Type:     Directory function related
Bug description:  Empty directory argument to tempnam yields open_basedir 
problems

Description:
------------
If open_basedir is used -- even if it includes /tmp among its directories
-- calling tempnam() with an empty string as the first (directory) argument
does not make PHP fall back to "the system default" as
http://se.php.net/manual/en/function.tempnam.php specifies.

Reproduce code:
---------------
// open_basedir:
.:/apache/php/lib:/tmp:/usr/local/bin:/usr/local/etc/Counter/data:/apache/htdocs/webdev-its

tempnam('', 'test');


Expected result:
----------------
No errors, temporary file gets created in /tmp or whatever the fallback
is.

Actual result:
--------------
>From the Apache error log:

Warning: tempnam(): open_basedir restriction in effect. File() is not
within the allowed path(s):
(.:/apache/php/lib:/tmp:/usr/local/bin:/usr/local/etc/Counter/data:/apache/htdocs/webdev-its)
in /apache/htdocs/webdev-its/limesurvey/admin/classes/pear/OLE/PPS/File.php
on line 87


-- 
Edit bug report at http://bugs.php.net/?id=42560&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42560&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42560&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42560&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42560&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42560&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42560&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42560&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42560&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42560&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42560&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42560&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42560&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42560&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42560&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42560&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42560&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42560&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42560&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42560&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42560&r=mysqlcfg

Reply via email to