[vhffs-dev] [683] Add an option to vhffs. conf to tell robots to not create symlinks if vhffsfs is used

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 683
Author:   gradator
Date:     2007-07-07 16:49:53 +0000 (Sat, 07 Jul 2007)

Log Message:
-----------
Add an option to vhffs.conf to tell robots to not create symlinks if vhffsfs is used

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Conf.pm
    trunk/vhffs-api/src/Vhffs/Robots/Group.pm
    trunk/vhffs-api/src/Vhffs/Robots.pm
    trunk/vhffs-backend/conf/vhffs.conf.dist.in
    trunk/vhffs-backend/conf/vhffs.conf.in


Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm	2007-07-07 16:08:12 UTC (rev 682)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm	2007-07-07 16:49:53 UTC (rev 683)
@@ -927,9 +927,18 @@
 	return $Config{"services"}{"web"};
 }
 
+
 sub get_repository_config
 {
 	return $Config{"services"}{"repository"};
 }
 
+
+sub use_vhffsfs
+{
+	return 1 if( ( defined $Config{'global'}{'use_vhffsfs'} ) && ( $Config{'global'}{'use_vhffsfs'} eq 'yes' ) );
+	return 0;
+}
+
+
 1;

Modified: trunk/vhffs-api/src/Vhffs/Robots/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Group.pm	2007-07-07 16:08:12 UTC (rev 682)
+++ trunk/vhffs-api/src/Vhffs/Robots/Group.pm	2007-07-07 16:49:53 UTC (rev 683)
@@ -148,8 +148,10 @@
 	return -1 if( ! defined $user );
 	return -2 if( ! defined $group );
 
-	my $path = $user->get_home . "/" . $group->get_groupname;
-	unlink( $path );
+	if( $main->get_config->use_vhffsfs )  {
+		my $path = $user->get_home . "/" . $group->get_groupname;
+		unlink( $path ) if( $main->get_config->use_vhffsfs );
+	}
 	$group->add_history("The user ".$user->get_username." leave the group");
 	$user->add_history("The user ".$user->get_username." leave the group");
 
@@ -169,9 +171,10 @@
 	return -1 if( ! defined $user );
 	return -1 if( ! defined $group );
 
-	my $path = $user->get_home . "/" . $group->get_groupname;
-
-	symlink( Vhffs::Functions::hash_groupname( $group->get_groupname , $main ) , $path );
+	if( $main->get_config->use_vhffsfs )  {
+		my $path = $user->get_home . "/" . $group->get_groupname;
+		symlink( Vhffs::Functions::hash_groupname( $group->get_groupname , $main ) , $path );
+	}
 	$group->add_history("The user ".$user->get_username." join the group");
 	$user->add_history("The user ".$user->get_username." join the group");
 

Modified: trunk/vhffs-api/src/Vhffs/Robots.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots.pm	2007-07-07 16:08:12 UTC (rev 682)
+++ trunk/vhffs-api/src/Vhffs/Robots.pm	2007-07-07 16:49:53 UTC (rev 683)
@@ -121,6 +121,8 @@
 
 	return -1 unless( defined $group );
 
+	return 1 if( $main->get_config->use_vhffsfs );
+
 	my $path = Vhffs::Functions::hash_groupname( $group->get_groupname , $main )."/".$linkname;
 
 	return -1 if ( symlink( $dir , $path ) == 0 );
@@ -137,6 +139,8 @@
 
 	return -1 unless( defined $group );
 
+	return 1 if( $main->get_config->use_vhffsfs );
+
 	my $path = Vhffs::Functions::hash_groupname( $group->get_groupname , $main )."/".$linkname;
 
 	return -1 if ( unlink(  $path ) == 0 );

Modified: trunk/vhffs-backend/conf/vhffs.conf.dist.in
===================================================================
--- trunk/vhffs-backend/conf/vhffs.conf.dist.in	2007-07-07 16:08:12 UTC (rev 682)
+++ trunk/vhffs-backend/conf/vhffs.conf.dist.in	2007-07-07 16:49:53 UTC (rev 683)
@@ -42,6 +42,11 @@
 
 	moderation		= yes
 
+	#Whether to use vhffsfs or not. vhffsfs allows you to provide a
+	#virtual home directory depending on the uid of the running process
+	#in order to avoid using of a virtual chroot to provide ftp, sftp, or a shell
+	use_vhffsfs		= no
+
 	########
 	#Modules
 	#For each modules, you can use it if you declare "yes"
@@ -201,33 +206,31 @@
 
 	#DNS configuration
 	<dns>
-		#Default configuration for each domain-name
+		# default configuration for new domains and new entries
 		default_ns1 = ns1.hoster.org
 		default_ns2 = ns2.hoster.org
 		default_mx1 = mx1.hoster.org
 		default_mx2 = mx2.hoster.org
-
 		default_a	= 1.2.3.4
-        default_aaaa = FEDC::1
-
+		default_aaaa = FEDC::1
 		default_ttl = 86400
 		default_aux = 0
-
 		default_refresh = 28800
 		default_retry = 7200
 		default_expire = 604800
 		default_minimum = 86400
-
 		default_serial = 1
 		default_mbox = adm.your.hoster.ext.
+
+		# initial configuration of each domain name
 		<init>
 			<a>
 				www = 80.0.0.1
 				default = 10.0.0.1
 			</a>
 			<mx>
-				10	=	mx1.hoster.org
-				20	=	mx2.hoster.org
+				10 = mx1.hoster.org
+				20 = mx2.hoster.org
 			</mx>
 			<ns>
 				ns1.hoster.org
@@ -251,7 +254,7 @@
 		host		= localhost
 		username	= root
 		password	= vhffs
-        mysqldump_path = /usr/bin/mysqldump
+		mysqldump_path	= /usr/bin/mysqldump
 	</mysql>
 	<postgresql>
 		host		= localhost
@@ -288,26 +291,26 @@
 	<listengine>
 		#The domain is used when listengine bounces mails to SMTP server
 		#Listengine will send HELO domain to the SMTP sever
-		domain		=	"myhost.tld"
+		domain		= "myhost.tld"
 		#Where we store listengine data
-		datadir		=	"/data/listengine"
+		datadir		= "/data/listengine"
 		#Email of listmaster
-		listmaster		= "listmaster@xxxxxxxxxx"
+		listmaster	= "listmaster@xxxxxxxxxx"
 		#SMTP Server to bounce listengine mails
 		smtp_server	= "localhost"
 		#Directory which contains template for the archives
-		templatesdir	=	@LEWEB@/templates/
+		templatesdir	= @LEWEB@/templates/
 		#Directory which contains misc files
-		miscdir		=	@LEDIR@/misc/
+		miscdir		= @LEDIR@/misc/
 		#Url of archives
-		www-archives	=	http://localhost/listengine
+		www-archives	= http://localhost/listengine
 	</listengine>
 
 
 	#Configuration of download repository
 	<repository>
-		repository_url	=	"http://download.vhffs.org/";
-		default_quota	=	1024
+		repository_url	= "http://download.vhffs.org/";
+		default_quota	= 1024
 	</repository>
 </services>
 

Modified: trunk/vhffs-backend/conf/vhffs.conf.in
===================================================================
--- trunk/vhffs-backend/conf/vhffs.conf.in	2007-07-07 16:08:12 UTC (rev 682)
+++ trunk/vhffs-backend/conf/vhffs.conf.in	2007-07-07 16:49:53 UTC (rev 683)
@@ -42,6 +42,11 @@
 
 	moderation		= yes
 
+	#Whether to use vhffsfs or not. vhffsfs allows you to provide a
+	#virtual home directory depending on the uid of the running process
+	#in order to avoid using of a virtual chroot to provide ftp, sftp, or a shell
+	use_vhffsfs		= no
+
 	########
 	#Modules
 	#For each modules, you can use it if you declare "yes"
@@ -201,33 +206,31 @@
 
 	#DNS configuration
 	<dns>
-		#Default configuration for each domain-name
+		# default configuration for new domains and new entries
 		default_ns1 = ns1.hoster.org
 		default_ns2 = ns2.hoster.org
 		default_mx1 = mx1.hoster.org
 		default_mx2 = mx2.hoster.org
-
 		default_a	= 1.2.3.4
-        default_aaaa = FEDC::1
-
+		default_aaaa = FEDC::1
 		default_ttl = 86400
 		default_aux = 0
-
 		default_refresh = 28800
 		default_retry = 7200
 		default_expire = 604800
 		default_minimum = 86400
-
 		default_serial = 1
 		default_mbox = adm.your.hoster.ext.
+
+		# initial configuration of each domain name
 		<init>
 			<a>
 				www = 80.0.0.1
 				default = 10.0.0.1
 			</a>
 			<mx>
-				10	=	mx1.hoster.org
-				20	=	mx2.hoster.org
+				10 = mx1.hoster.org
+				20 = mx2.hoster.org
 			</mx>
 			<ns>
 				ns1.hoster.org
@@ -251,7 +254,7 @@
 		host		= localhost
 		username	= root
 		password	= vhffs
-        mysqldump_path = /usr/bin/mysqldump
+		mysqldump_path	= /usr/bin/mysqldump
 	</mysql>
 	<postgresql>
 		host		= localhost
@@ -288,26 +291,26 @@
 	<listengine>
 		#The domain is used when listengine bounces mails to SMTP server
 		#Listengine will send HELO domain to the SMTP sever
-		domain		=	"myhost.tld"
+		domain		= "myhost.tld"
 		#Where we store listengine data
-		datadir		=	"/data/listengine"
+		datadir		= "/data/listengine"
 		#Email of listmaster
-		listmaster		= "listmaster@xxxxxxxxxx"
+		listmaster	= "listmaster@xxxxxxxxxx"
 		#SMTP Server to bounce listengine mails
 		smtp_server	= "localhost"
 		#Directory which contains template for the archives
-		templatesdir	=	@LEWEB@/templates/
+		templatesdir	= @LEWEB@/templates/
 		#Directory which contains misc files
-		miscdir		=	@LEDIR@/misc/
+		miscdir		= @LEDIR@/misc/
 		#Url of archives
-		www-archives	=	http://localhost/listengine
+		www-archives	= http://localhost/listengine
 	</listengine>
 
 
 	#Configuration of download repository
 	<repository>
-		repository_url	=	"http://download.vhffs.org/";
-		default_quota	=	1024
+		repository_url	= "http://download.vhffs.org/";
+		default_quota	= 1024
 	</repository>
 </services>
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/