From 6423328b0a50366b936fc18b48d64b0f5e12a0d5 Mon Sep 17 00:00:00 2001 From: dragon28 Date: Sun, 26 May 2002 10:21:09 +0000 Subject: [PATCH] installer now changes ownership of the koha.conf file for better security --- installer.pl | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/installer.pl b/installer.pl index 00c7ee40cb..85e3a8a88e 100644 --- a/installer.pl +++ b/installer.pl @@ -56,9 +56,9 @@ print "\nChecking perl modules ...\n"; # my @missing = (); unless (eval require DBI) { push @missing,"DBI" }; -unless (eval require Date::Manip) { push @missing,"Datr::Manip" } -unless (eval require DBD::mysql) { push @missing,"DBD::mysql" } -unless (eval require Set::Scalar) { push @missing,"Set::Scalar" } +unless (eval require Date::Manip) { push @missing,"Datr::Manip" }; +unless (eval require DBD::mysql) { push @missing,"DBD::mysql" }; +unless (eval require Set::Scalar) { push @missing,"Set::Scalar" }; # # Print out a list of any missing modules @@ -219,12 +219,30 @@ close(SITES); print "Successfully created the Koha configuration file.\n"; +print "\n"; +print "\n"; +my $apache_owner; +print qq| +The permissions on the koha.conf file should also be strict, +since they contain the database password. +Please supply the username that your apache webserver runs under. +|; +do { + print "Enter apache user:"; + chomp($apache_owner = ); +}; +# +# Set ownership of the koha.conf file for security +# FIXME - this will only work if run as work. +# + +chown((getpwnam($apache_owner)) [2,3], "$conf_path/koha.conf") or die "can't chown koha.conf: $!"; + print "\n"; print "\n"; - # #SETUP opac # @@ -243,7 +261,7 @@ usually located in \"/usr/local/apache/conf/httpd.conf\". do { print "Enter path:"; chomp($apache_conf_path = ); - print "$conf_path is a valid file.\n" if !-f $apache_conf_path; + print "$conf_path is not a valid file.\n" if !-f $apache_conf_path; } until -f $apache_conf_path; @@ -312,3 +330,7 @@ print "Successfully updated Apache Configuration file.\n"; # print "\nCongratulations ... your Koha installation is complete!\n"; print "\nYou will need to restart your webserver before using Koha!\n"; + +# +#Sub for chown of conf and cgi-bin dir +# -- 2.39.5