Commit a8512cea authored by Dylan Hardison's avatar Dylan Hardison

Bug 1241026 - checksetup.pl requires editing localconfig to remove apache group

r=dkl,a=dylan
parent a0f345b3
...@@ -25,6 +25,8 @@ use Bugzilla::Util qw(generate_random_password wrap_hard); ...@@ -25,6 +25,8 @@ use Bugzilla::Util qw(generate_random_password wrap_hard);
use Data::Dumper; use Data::Dumper;
use File::Basename qw(dirname); use File::Basename qw(dirname);
use English qw($EGID);
use List::Util qw(first);
use Safe; use Safe;
use Term::ANSIColor; use Term::ANSIColor;
...@@ -35,6 +37,14 @@ our @EXPORT_OK = qw( ...@@ -35,6 +37,14 @@ our @EXPORT_OK = qw(
update_localconfig 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 => ( use constant LOCALCONFIG_VARS => (
{ {
name => 'create_htaccess', name => 'create_htaccess',
...@@ -42,7 +52,7 @@ use constant LOCALCONFIG_VARS => ( ...@@ -42,7 +52,7 @@ use constant LOCALCONFIG_VARS => (
}, },
{ {
name => 'webservergroup', name => 'webservergroup',
default => ON_WINDOWS ? '' : 'apache', default => _sensible_group(),
}, },
{ {
name => 'use_suexec', name => 'use_suexec',
...@@ -124,6 +134,7 @@ use constant LOCALCONFIG_VARS => ( ...@@ -124,6 +134,7 @@ use constant LOCALCONFIG_VARS => (
}, },
); );
sub read_localconfig { sub read_localconfig {
my ($include_deprecated) = @_; my ($include_deprecated) = @_;
my $filename = bz_locations()->{'localconfig'}; my $filename = bz_locations()->{'localconfig'};
......
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