Bug #16058: ftp_get() try to create temp file in the c:\

From: Date: Thu, 14 Mar 2002 08:18:58 +0000
Subject: Bug #16058: ftp_get() try to create temp file in the c:\
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-2453@lists.php.net to get a copy of this message
From: alexf@spiralsolutions.com Operating system: Win2K PHP version: 4.1.2 PHP Bug Type: FTP related Bug description: ftp_get() try to create temp file in the c:\ 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. -- Edit bug report at http://bugs.php.net/?id=16058&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16058&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16058&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16058&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16058&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16058&r=support Expected behavior: http://bugs.php.net/fix.php?id=16058&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16058&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16058&r=submittedtwice

« previous php.bugs (#2453) next »