Commit 1b04ef88 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 511337: Make checksetup.pl properly throw a warning when it can't chmod/chown a file

Patch by Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=mkanat
parent c9806c35
...@@ -30,6 +30,7 @@ use strict; ...@@ -30,6 +30,7 @@ use strict;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Error; use Bugzilla::Error;
use Bugzilla::Install::Localconfig; use Bugzilla::Install::Localconfig;
use Bugzilla::Install::Util qw(install_string);
use Bugzilla::Util; use Bugzilla::Util;
use File::Find; use File::Find;
...@@ -601,9 +602,11 @@ sub _fix_perms { ...@@ -601,9 +602,11 @@ sub _fix_perms {
my ($name, $owner, $group, $perms) = @_; my ($name, $owner, $group, $perms) = @_;
#printf ("Changing $name to %o\n", $perms); #printf ("Changing $name to %o\n", $perms);
chown $owner, $group, $name chown $owner, $group, $name
|| warn "Failed to change ownership of $name: $!"; or warn install_string('chown_failed', { path => $name,
error => $! }) . "\n";
chmod $perms, $name chmod $perms, $name
|| warn "Failed to change permissions of $name: $!"; or warn install_string('chmod_failed', { path => $name,
error => $! }) . "\n";
} }
sub _check_web_server_group { sub _check_web_server_group {
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
checking_dbd => 'Checking available perl DBD modules...', checking_dbd => 'Checking available perl DBD modules...',
checking_optional => 'The following Perl modules are optional:', checking_optional => 'The following Perl modules are optional:',
checking_modules => 'Checking perl modules...', checking_modules => 'Checking perl modules...',
chmod_failed => '##path##: Failed to change permissions: ##error##',
chown_failed => '##path##: Failed to change ownership: ##error##',
commands_dbd => <<EOT, commands_dbd => <<EOT,
YOU MUST RUN ONE OF THE FOLLOWING COMMANDS (depending on which database YOU MUST RUN ONE OF THE FOLLOWING COMMANDS (depending on which database
you use): you use):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment