summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-04-01 16:52:36 +0200
committerDylan William Hardison <dylan@hardison.net>2018-04-01 16:52:36 +0200
commitab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5 (patch)
tree483da9c8b66f4444bb8a410e3d599c7484ad721e /checksetup.pl
parentdaa2d6b1c40354ecce0e48e6c5ee686efe642c4b (diff)
parent2f8b999750cc700faf03c6aee1c53d1fc4df767f (diff)
downloadbugzilla-ab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5.tar.gz
bugzilla-ab229b9a828b77f8a3b9ce215f0dfed4c84d4ae5.tar.xz
Merge branch 'master' into unstable
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 6cea8549d..d3f08e024 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -30,6 +30,7 @@ use Pod::Usage;
# Bug 1270550 - Tie::Hash::NamedCapture must be loaded before Safe.
use Tie::Hash::NamedCapture;
use Safe;
+use English qw(-no_match_vars $EUID $EGID);
use Bugzilla::Constants;
use Bugzilla::Install::Requirements;
@@ -155,6 +156,16 @@ unless ($ENV{LOCALCONFIG_ENV}) {
}
my $lc_hash = Bugzilla->localconfig;
+if ( $EUID == 0 && $lc_hash->{webservergroup} && !ON_WINDOWS ) {
+ # So checksetup was run as root, and we have a webserver group set.
+ # Let's assume the user wants us to make files that are writable
+ # by the webserver group.
+
+ $EGID = getgrnam $lc_hash->{webservergroup}; ## no critic (Variables::RequireLocalizedPunctuationVars)
+ umask 002
+ or die "failed to set umask 002: $!";
+}
+
unless ($switch{'no-database'}) {
die "urlbase is not set\n" unless $lc_hash->{urlbase};
die "urlbase must end with slash\n" unless $lc_hash->{urlbase} =~ m{/$}ms;