HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   unlink from apache2.inc.php (http://www.howtoforge.com/forums/showthread.php?t=60157)

tom123 7th January 2013 14:38

unlink from apache2.inc.php
 
This:

Code:

$app->system->unlink
doesn't work properly.
No file/symlinks are deleted.

Changing that to a plain "unlink" will delete properly.

The issue is present in the whole file. I had to change that call everywhere in the plugin.

till 7th January 2013 14:47

The function works fine, there is a problem in your setup if the function does not remove files. There shall be no symlinks in the real path of a website, so the path /var/www/clients/client1/web1/ may not contain a symlink. If a symlink is detected somewhere in the path, the unlink function has to refuse the removal.

If you moved e.g. /var/www to another disk on your server, then use mount bind instaed of a symlink to point the directory tree to the new location.

tom123 7th January 2013 15:37

It's not only a symlink removal issue.
Even the PHP-FPM pools are not removed and also apache virtualhosts.

The same script but with the plain "unlink" instead the origianl function works perfectly

tom123 7th January 2013 17:58

I don't think that your code works:

Code:

        function unlink($file) {
                if(file_exists($filename)) {
                        return unlink($filename);
                }
        }


till 7th January 2013 18:41

Thats not code form 3.0.5 RC1. Download the 3.0.5 RC1 tar.gz, unpack it and take a look into the system.inc.php file in server/lib/classes/. The code of this function is:

Code:

function unlink($filename) {
                if(file_exists($filename) || is_link($filename)) {
                        return unlink($filename);
                }
        }


tom123 7th January 2013 22:58

It's the same variation that i've made manually.
Probably i'm using a little bit outdated version


All times are GMT +2. The time now is 20:02.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.