php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16058 ftp_get() try to create temp file in the c:\
Submitted: 2002-03-14 03:18 UTC Modified: 2002-07-10 23:08 UTC
From: alexf at spiralsolutions dot com Assigned:
Status: Closed Package: FTP related
PHP Version: 4.1.2 OS: Win2K
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alexf at spiralsolutions dot com
New email:
PHP Version: OS:

 

 [2002-03-14 03:18 UTC] alexf at spiralsolutions dot com
OS - Win2K, IIS, PHP.
If i use NTFS on my C drive under Win2K, and try to get file over ftp using ftp_get(), ftp_get() fails.
The problem is in C code in php_ftp.c:
C function tmpfile(), that used for creation of temporary files, try to create this file on C:\ (in the root directory, according to C docs):
================ Source code from php_ftp.c ===============
/* get to temporary file, so if there is an error, no  
   existing file gets clobbered
*/                 
   if ((tmpfp = tmpfile()) == NULL) {
           php_error(E_WARNING, "error opening tmpfile");
           RETURN_FALSE;
   }
===========================================================
But, for security reasons, root directory can't be writable by Anonymous user, so ftp_get() fails.
ftp_get() work only if we have c:\ world writable.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-10 23:08 UTC] sniper@php.net
Just use ftp_fget() as you can give it a filepointer you have opened wherever you wish:

http://www.php.net/manual/en/function.ftp-fget.php


(and regarding tmpfile(), it should store the temporary file in whatever your TEMP is set to?)

Not really any bug.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 02:01:31 2024 UTC