Bug #55804 [Fbk->Asn]: tempnam(): wrong fallback to /tmp
| From: | spam2 at rhsoft dot net | Date: | Mon, 20 Apr 2015 14:53:13 +0000 |
| Subject: | Bug #55804 [Fbk->Asn]: tempnam(): wrong fallback to /tmp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-192245@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55804&edit=1
ID: 55804
User updated by: spam2 at rhsoft dot net
Reported by: spam2 at rhsoft dot net
Summary: tempnam(): wrong fallback to /tmp
-Status: Feedback
+Status: Assigned
Type: Bug
Package: Filesystem function related
Operating System: Linux
PHP Version: 5.3.8
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
maybe this was fixed in the meantime
the whole bugreport was about 1) where php created files below /tmp returned that path and fopen()
later failed because open_basedir and so that useless files where lying around
but anyways 2) is a bug and not a feature request because $dir is not just a wish to santa claus -
falling back to somewhere else is hardly the desired result and unexpected behavior never becomes
correct because someone adds it to the docs
Previous Comments:
------------------------------------------------------------------------
[2015-04-20 14:45:12] cmb@php.net
Actually, during the discussion of this ticket there have been
raised three distinct issues:
1) tempnam() doesn't heed open_basedir, when falling back to the
temp dir
2) when tempnam() falls back to the temp dir, no notice is thrown
3) it is not well documented under which circumstances tempnam()
falls back to the temp dir
That is always a bit unfortunate, but even more so in this case,
because 1) could be considered a bug, 2) would be a feature/change
request, and 3) is a documentation problem. Therefore I have split
2) to bug #69489 and 3) to bug #69488.
With regard to 1): I can't reproduce the behavior of the given test
script on somewhat recent versions of PHP. I get:
Warning: tempnam(): open_basedir restriction in effect.
File(/tmp) is not within the allowed path(s): (...) in ... on
line 5
Is this issue still reproducable elsewhere?
------------------------------------------------------------------------
[2015-04-18 08:25:51] spam2 at rhsoft dot net
boah falling back to /tmp when it is not inide open_basedir() is *plain wrong* because you can not
access the created file - it's hard to understand how idiotic the discussions in context of
clear bugs are all the time
THIS IS NOT A DOCUMENTATION PROBLEM
YOU MUST NOT CREATE A FILE UNTOLD OUTSIDE OPEN_BASEDIR
THE ONLY EXCEPTION IS SESSION-FILES AND UPLOADTEMP
------------------------------------------------------------------------
[2015-04-18 05:37:35] php at geheimeinformatie dot nl
> Even a notice might be considered a BC break.
This is arguable at best, but I'm sure the PHP team have thought this through more often than I
have.
So we can either wait for 7.1 or just roll our eyes, sigh deeply, and deal with it? Righty-oh.
------------------------------------------------------------------------
[2015-04-18 00:35:07] cmb@php.net
> I *get* falling back to sensible defaults, but is a simple
> warning too much to ask?
Even a notice might be considered a BC break.
> And the fallback behavios should vanish in PHP7
I'm afraid this ship has sailed[1].
I'm switching the issue to "Documentation Problem".
[1] <https://wiki.php.net/rfc/php7timeline>
------------------------------------------------------------------------
[2015-04-18 00:33:21] cmb@php.net
The following patch has been added/updated:
Patch Name: doc-55804
Revision: 1429317201
URL: https://bugs.php.net/patch-display.php?bug=55804&patch=doc-55804&revision=1429317201
------------------------------------------------------------------------
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
https://bugs.php.net/bug.php?id=55804
--
Edit this bug report at https://bugs.php.net/bug.php?id=55804&edit=1