diff options
author | Dylan Hardison <dylan@mozilla.com> | 2016-01-27 23:44:02 +0100 |
---|---|---|
committer | Dylan Hardison <dylan@mozilla.com> | 2016-01-27 23:44:02 +0100 |
commit | a8512cea01b427d2af0a980b856e06e307c4c185 (patch) | |
tree | c4ccdf9011f51fde59cd17b7bda2f5cd44af918a | |
parent | a0f345b36eda134a8483be13fe75307f20809c54 (diff) | |
download | bugzilla-a8512cea01b427d2af0a980b856e06e307c4c185.tar.gz bugzilla-a8512cea01b427d2af0a980b856e06e307c4c185.tar.xz |
Bug 1241026 - checksetup.pl requires editing localconfig to remove apache group
r=dkl,a=dylan
-rw-r--r-- | Bugzilla/Install/Localconfig.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index 4ccd107ae..9d385fc14 100644 --- a/Bugzilla/Install/Localconfig.pm +++ b/Bugzilla/Install/Localconfig.pm @@ -25,6 +25,8 @@ use Bugzilla::Util qw(generate_random_password wrap_hard); use Data::Dumper; use File::Basename qw(dirname); +use English qw($EGID); +use List::Util qw(first); use Safe; use Term::ANSIColor; @@ -35,6 +37,14 @@ our @EXPORT_OK = qw( update_localconfig ); +sub _sensible_group { + return '' if ON_WINDOWS; + my @groups = qw( apache www-data _www ); + my $sensible_group = first { return getgrnam($_) } @groups; + + return $sensible_group // getgrgid($EGID) // ''; +} + use constant LOCALCONFIG_VARS => ( { name => 'create_htaccess', @@ -42,7 +52,7 @@ use constant LOCALCONFIG_VARS => ( }, { name => 'webservergroup', - default => ON_WINDOWS ? '' : 'apache', + default => _sensible_group(), }, { name => 'use_suexec', @@ -124,6 +134,7 @@ use constant LOCALCONFIG_VARS => ( }, ); + sub read_localconfig { my ($include_deprecated) = @_; my $filename = bz_locations()->{'localconfig'}; |