Update of /cvsroot/ispman/ispman/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6654/lib
Modified Files:
create_domain_directories.lib create_home_directory.lib
create_vhost_directories.lib delete_domain_directories.lib
delete_home_directory.lib delete_vhost_directories.lib
Log Message:
protecting paths to prevent fatal errors from strange dirs
Index: create_domain_directories.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/create_domain_directories.lib,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- create_domain_directories.lib 8 Oct 2003 01:10:12 -0000 1.4
+++ create_domain_directories.lib 18 Feb 2004 21:10:15 -0000 1.5
@@ -5,9 +5,9 @@
my @commands=();
for (@directories){
- push @commands, "mkdir -p $home_directory/$_";
- push @commands, "chown $owner $home_directory/$_";
- push @commands, "chgrp $group $home_directory/$_";
+ push @commands, "mkdir -p \"$home_directory/$_\"";
+ push @commands, "chown $owner \"$home_directory/$_\"";
+ push @commands, "chgrp $group \"$home_directory/$_\"";
}
for (@commands){
Index: create_home_directory.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/create_home_directory.lib,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- create_home_directory.lib 8 Oct 2003 01:10:12 -0000 1.6
+++ create_home_directory.lib 18 Feb 2004 21:10:15 -0000 1.7
@@ -3,17 +3,14 @@
sub create_home_directory_handler {
my ($home_directory, $owner, $group)=@_;
- my @directories=("public_html");
+ my @directories=("$home_directory", "$home_directory/public_html");
my @commands=();
- push @commands, "mkdir -p $home_directory";
- push @commands, "chown $owner $home_directory";
- push @commands, "chgrp $group $home_directory";
-
+
for (@directories){
- push @commands, "mkdir -p $home_directory/$_";
- push @commands, "chown $owner $home_directory/$_";
- push @commands, "chgrp $group $home_directory/$_";
+ push @commands, "mkdir -p \"$_\"";
+ push @commands, "chown $owner \"$_\"";
+ push @commands, "chgrp $group \"$_\"";
}
for (@commands){
Index: create_vhost_directories.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/create_vhost_directories.lib,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- create_vhost_directories.lib 14 Feb 2004 19:39:06 -0000 1.11
+++ create_vhost_directories.lib 18 Feb 2004 21:10:15 -0000 1.12
@@ -17,9 +17,9 @@
my @commands=();
for (@directories){
- push @commands, "mkdir -p $_";
- push @commands, "chown $owner $_";
- push @commands, "chgrp $group $_";
+ push @commands, "mkdir -p \"$_\"";
+ push @commands, "chown $owner \"$_\"";
+ push @commands, "chgrp $group \"$_\"";
}
for (@commands){
Index: delete_domain_directories.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/delete_domain_directories.lib,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- delete_domain_directories.lib 18 Sep 2003 15:22:50 -0000 1.4
+++ delete_domain_directories.lib 18 Feb 2004 21:10:15 -0000 1.5
@@ -14,7 +14,7 @@
# comment 2. Not all find has the uid and gid switches
- my $command="find $home_directory -depth -user $owner -group $group -type d -exec rm -rf {} \\;";
+ my $command="find \"$home_directory\" -depth -user $owner -group $group -type d -exec rm -rf {} \\;";
#print STDERR "$command\n";
system($command);
};
Index: delete_home_directory.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/delete_home_directory.lib,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- delete_home_directory.lib 18 Sep 2003 15:22:50 -0000 1.4
+++ delete_home_directory.lib 18 Feb 2004 21:10:15 -0000 1.5
@@ -4,7 +4,7 @@
my ($home_directory, $owner, $group)=@_;
#backup the homedirectory before delete if you want or do something your site specif here
- #system("cp -a $home_directory /tmp/backups$home_directory");
+ #system("cp -a \"$home_directory\" \"/tmp/backups$home_directory\"");
#delete the directory
# do as many checks as possible here
@@ -15,7 +15,7 @@
# Please find something else
# comment 2. Not all find has the uid and gid switches
- my $command="find $home_directory -depth -user $owner -group $group -type d -exec rm -rf {} \\;";
+ my $command="find \"$home_directory\" -depth -user $owner -group $group -type d -exec rm -rf {} \\;";
system($command);
};
Index: delete_vhost_directories.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/delete_vhost_directories.lib,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- delete_vhost_directories.lib 14 Feb 2004 19:39:06 -0000 1.4
+++ delete_vhost_directories.lib 18 Feb 2004 21:10:15 -0000 1.5
@@ -4,7 +4,7 @@
# Please provide your own actions for removing any created dir
# only vhost homedir (and therefor everything under it) is deleted by default
- my $command="rm -rf $home_directory";
+ my $command="rm -rf \"$home_directory\"";
print "Running $command\n";
system ($command);
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.