#42049 [NEW]: tempnam() creates a file with incorrect default permissions on Windows.
| From: | mahesh dot vemula at in dot ibm dot com | Date: | Thu, 19 Jul 2007 14:43:46 +0000 |
| Subject: | #42049 [NEW]: tempnam() creates a file with incorrect default permissions on Windows. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-115238@lists.php.net to get a copy of this message | ||
From: mahesh dot vemula at in dot ibm dot com
Operating system: Windows XP
PHP version: 5CVS-2007-07-19 (snap)
PHP Bug Type: *General Issues
Bug description: tempnam() creates a file with incorrect default permissions on Windows.
Description:
------------
The unique file created by tempnam() has the default permissions of 0666
on Windows. But according to documentation
http://in.php.net/manual/en/function.tempnam.php,
the default permissions
are 0600. On Linux tempnam() creates a file with permissions of 0600 as
expected i.e according to documentation.
If this is the expected behavior on Windows, please fix the
documentation.
Reproduce code:
---------------
<?php
$file_name = tempnam(".", "temp");
printf("%o", fileperms($file_name) );
unlink($file_name);
?>
Expected result:
----------------
100600
Actual result:
--------------
100666
--
Edit bug report at http://bugs.php.net/?id=42049&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42049&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42049&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42049&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42049&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=42049&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42049&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42049&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42049&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42049&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42049&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=42049&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=42049&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42049&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42049&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42049&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42049&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42049&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42049&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42049&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42049&r=mysqlcfg