Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 7th January 2013, 14:38
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
Reply With Quote
Sponsored Links
  #2  
Old 7th January 2013, 14:47
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,406
Thanks: 834
Thanked 5,496 Times in 4,326 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 7th January 2013, 15:37
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #4  
Old 7th January 2013, 17:58
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't think that your code works:

Code:
	function unlink($file) {
		if(file_exists($filename)) {
			return unlink($filename);
		}
	}
Reply With Quote
  #5  
Old 7th January 2013, 18:41
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,406
Thanks: 834
Thanked 5,496 Times in 4,326 Posts
Default

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);
		}
	}
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 7th January 2013, 22:58
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig 3.0.3.3 Autoresponder, adding subdomain problem BlackHat Installation/Configuration 4 18th October 2011 14:24
unlink email and ftp accounts daimmo Feature Requests 1 3rd August 2007 12:45


All times are GMT +2. The time now is 09:03.


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