php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #28279 function symlink() crash under windows
Submitted: 2004-05-05 05:30 UTC Modified: 2018-03-11 17:02 UTC
From: motion4u at hotmail dot com Assigned: cmb (profile)
Status: Closed Package: *General Issues
PHP Version: 4.3.6 OS: Windows 2000 Advanced
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: motion4u at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-05-05 05:30 UTC] motion4u at hotmail dot com
Description:
------------
Create and Manipulate NTFS Junction Points doesn't work in PHP but it was solved by www.sysinternals.com. They also offer the c-code free for download.

I have tested it and it works very well.

You can download the free source code there:

http://www.sysinternals.com/files/jnctnsrc.zip



Reproduce code:
---------------
$letters = 'abcdefghijklmnopqrstuvwxyz'; 
srand((double) microtime() * 1000000); 
$string = ''; 
for ($i = 1; $i <= rand(4,12); $i++) { 
   $q = rand(1,24); 
   $string = $string . $letters[$q]; 
} 
//----- this part can't work under windows
$handle = opendir($downloaddir); 
while ($dir = readdir($handle)) { 
   if (is_dir($downloaddir . $dir)){ 
     if ($dir != "." && $dir != ".."){ 
         @unlink($downloaddir . $dir . "/" . $filename); 
         @rmdir($downloaddir . $dir); 
     } } } 
closedir($handle); //------
mkdir($downloaddir . $string, 0777); 
// here symlink produce browser crash under windows
symlink($safedir . $filename, $downloaddir . $string . "/" . $filename); 
Header("Location: ".$downloadURL.$string. "/" . $filename);

Expected result:
----------------
start downloading but produce browser crash


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-05 11:17 UTC] wez@php.net
Windows versions of PHP don't even have symlink(), readlink(), linkinfo() or link(), so it can't possibly be crashing.

I'll accept your feature request for NTFS junctions, but can't do anything about it until we are developing PHP 5.1.
 [2018-03-11 17:02 UTC] cmb@php.net
-Status: Suspended +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2018-03-11 17:02 UTC] cmb@php.net
symlink(), readlink(), linkinfo() and link() are available on
Windows as of PHP 5.3.0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC