OSDN Git Service
(root)
/
pukiwiki
/
pukiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8ca9fa9
)
BugTrack2/122: tempnam() fails when open_basedir is specified in php.ini
author
teanan
<teanan>
Thu, 12 Jan 2006 01:01:35 +0000
(10:01 +0900)
committer
teanan
<teanan>
Thu, 12 Jan 2006 01:01:35 +0000
(10:01 +0900)
lib/file.php
patch
|
blob
|
history
plugin/dump.inc.php
patch
|
blob
|
history
diff --git
a/lib/file.php
b/lib/file.php
index
1b54abf
..
557cc08
100644
(file)
--- a/
lib/file.php
+++ b/
lib/file.php
@@
-1,6
+1,6
@@
<?php
// PukiWiki - Yet another WikiWikiWeb clone.
<?php
// PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: file.php,v 1.4
5 2006/01/09 10:32:35 henoheno
Exp $
+// $Id: file.php,v 1.4
6 2006/01/12 01:00:51 teanan
Exp $
// Copyright (C)
// 2002-2005 PukiWiki Developers Team
// 2001-2002 Originally written by yu-ji
// Copyright (C)
// 2002-2005 PukiWiki Developers Team
// 2001-2002 Originally written by yu-ji
@@
-422,7
+422,7
@@
function get_readings()
if(! file_exists($pagereading_chasen_path))
die_message('ChaSen not found: ' . $pagereading_chasen_path);
if(! file_exists($pagereading_chasen_path))
die_message('ChaSen not found: ' . $pagereading_chasen_path);
- $tmpfname = tempnam(
CACHE_DIR
, 'PageReading');
+ $tmpfname = tempnam(
realpath(CACHE_DIR)
, 'PageReading');
$fp = fopen($tmpfname, 'w') or
die_message('Cannot write temporary file "' . $tmpfname . '".' . "\n");
foreach ($readings as $page => $reading) {
$fp = fopen($tmpfname, 'w') or
die_message('Cannot write temporary file "' . $tmpfname . '".' . "\n");
foreach ($readings as $page => $reading) {
@@
-458,7
+458,7
@@
function get_readings()
if(! file_exists($pagereading_kakasi_path))
die_message('KAKASI not found: ' . $pagereading_kakasi_path);
if(! file_exists($pagereading_kakasi_path))
die_message('KAKASI not found: ' . $pagereading_kakasi_path);
- $tmpfname = tempnam(
CACHE_DIR
, 'PageReading');
+ $tmpfname = tempnam(
realpath(CACHE_DIR)
, 'PageReading');
$fp = fopen($tmpfname, 'w') or
die_message('Cannot write temporary file "' . $tmpfname . '".' . "\n");
foreach ($readings as $page => $reading) {
$fp = fopen($tmpfname, 'w') or
die_message('Cannot write temporary file "' . $tmpfname . '".' . "\n");
foreach ($readings as $page => $reading) {
diff --git
a/plugin/dump.inc.php
b/plugin/dump.inc.php
index
4a9e719
..
c5c683a
100644
(file)
--- a/
plugin/dump.inc.php
+++ b/
plugin/dump.inc.php
@@
-1,5
+1,5
@@
<?php
<?php
-// $Id: dump.inc.php,v 1.3
6 2005/03/27 12:16:50 henoheno
Exp $
+// $Id: dump.inc.php,v 1.3
7 2006/01/12 01:01:35 teanan
Exp $
//
// Remote dump / restore plugin
// Originated as tarfile.inc.php by teanan / Interfair Laboratory 2004.
//
// Remote dump / restore plugin
// Originated as tarfile.inc.php by teanan / Interfair Laboratory 2004.
@@
-152,7
+152,7
@@
function plugin_dump_upload()
die_message('Max file size exceeded: ' . PLUGIN_DUMP_MAX_FILESIZE . 'KB');
// Create a temporary tar file
die_message('Max file size exceeded: ' . PLUGIN_DUMP_MAX_FILESIZE . 'KB');
// Create a temporary tar file
- $uploadfile = tempnam(
CACHE_DIR
, 'tarlib_uploaded_');
+ $uploadfile = tempnam(
realpath(CACHE_DIR)
, 'tarlib_uploaded_');
$tar = new tarlib();
if(! move_uploaded_file($_FILES['upload_file']['tmp_name'], $uploadfile) ||
! $tar->open($uploadfile, $arc_kind)) {
$tar = new tarlib();
if(! move_uploaded_file($_FILES['upload_file']['tmp_name'], $uploadfile) ||
! $tar->open($uploadfile, $arc_kind)) {
@@
-341,7
+341,7
@@
class tarlib
////////////////////////////////////////////////////////////
function create($tempdir, $kind = 'tgz')
{
////////////////////////////////////////////////////////////
function create($tempdir, $kind = 'tgz')
{
- $tempnam = tempnam(
$tempdir
, 'tarlib_create_');
+ $tempnam = tempnam(
realpath($tempdir)
, 'tarlib_create_');
if ($tempnam === FALSE) return FALSE;
if ($kind == 'tgz') {
if ($tempnam === FALSE) return FALSE;
if ($kind == 'tgz') {