From a8512cea01b427d2af0a980b856e06e307c4c185 Mon Sep 17 00:00:00 2001 From: Dylan Hardison Date: Wed, 27 Jan 2016 17:44:02 -0500 Subject: Bug 1241026 - checksetup.pl requires editing localconfig to remove apache group r=dkl,a=dylan --- Bugzilla/Install/Localconfig.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Install') 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'}; -- cgit v1.2.3-24-g4f1b