#46013 [Opn]: problem with zip php functions and symbolic links

From: Date: Sat, 06 Sep 2008 20:56:30 +0000
Subject: #46013 [Opn]: problem with zip php functions and symbolic links
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-128738@lists.php.net to get a copy of this message
ID: 46013 User updated by: black-cod3 at live dot com Reported By: black-cod3 at live dot com Status: Open Bug Type: Output Control Operating System: linux PHP Version: 5.2.6 New Comment: Also note that when zipping the symbolic link using php code as: <?php $zip = new ZipArchive; $res = $zip->open('indx.zip', ZipArchive::CREATE); if ($res === TRUE) { $zip->addFile('indx'); $zip->close(); echo 'ok'; } else { echo 'failed'; } ?> also the result after extracting indx.zip with the above php extracting code: indx Previous Comments: ------------------------------------------------------------------------ [2008-09-06 20:43:13] black-cod3 at live dot com Description: ------------ When using the zip php functions to extract or read a zip file containing a symbolic link (ex: indx -> /home/myuser/public_html/index.html) it fails to extract the original symbolic link it only returned the link name and it's contents is the symbolic link path. ln -s /home/myuser/public_html/index.html indx;ls -la 28672300 lrwxrwxrwx 1 myuser mygroup 35 Sep 6 13:41 indx -> /home/myuser/public_html/index.html zip -y indx.zip indx;ls -la 28672300 lrwxrwxrwx 1 myuser mygroup 35 Sep 6 13:41 indx -> /home/myuser/public_html/index.html 28672304 -rw-r--r-- 1 myuser mygroup 175 Sep 6 14:50 indx.zip extracting php code to the indx.zip as following: Reproduce code: --------------- <?php $zip = new ZipArchive; if ($zip->open('indx.zip') === TRUE) { $zip->extractTo('/home/myuser/public_html/'); $zip->close(); echo 'done'; } else { echo 'failed'; } ?> Expected result: ---------------- expected to be extracted as : indx -> /home/myuser/public_html/index.html Actual result: -------------- but actual reslult is : indx and the contents of indx is : /home/myuser/public_html/index.html Thx for your attention and hope to know if there is a different coding method to zip a symbolic link by php zip functions or the above code was expected to works well? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46013&edit=1

« previous php.bugs (#128738) next »