diff options
Diffstat (limited to 'Bugzilla/Install/Localconfig.pm')
-rw-r--r-- | Bugzilla/Install/Localconfig.pm | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index 7c01be37d..263d63ced 100644 --- a/Bugzilla/Install/Localconfig.pm +++ b/Bugzilla/Install/Localconfig.pm @@ -1,22 +1,9 @@ -# -*- Mode: perl; indent-tabs-mode: nil -*- +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. # -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Initial Developer of the Original Code is Everything Solved. -# Portions created by Everything Solved are Copyright (C) 2006 -# Everything Solved. All Rights Reserved. -# -# The Original Code is the Bugzilla Bug Tracking System. -# -# Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org> +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. package Bugzilla::Install::Localconfig; @@ -28,7 +15,9 @@ package Bugzilla::Install::Localconfig; # * Files do not have the correct permissions # * The database is not up to date +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; use Bugzilla::Install::Util qw(bin_loc install_string); @@ -36,17 +25,27 @@ use Bugzilla::Util qw(generate_random_password wrap_hard); use Data::Dumper; use File::Basename qw(dirname); -use IO::File; +use English qw($EGID); +use List::Util qw(first); +use Tie::Hash::NamedCapture; use Safe; use Term::ANSIColor; -use base qw(Exporter); +use parent qw(Exporter); our @EXPORT_OK = qw( read_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 => ( { name => 'create_htaccess', |