]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1437646 - Add confdir to bz_locations
authorDylan William Hardison <dylan@hardison.net>
Wed, 28 Feb 2018 03:00:58 +0000 (22:00 -0500)
committerGitHub <noreply@github.com>
Wed, 28 Feb 2018 03:00:58 +0000 (22:00 -0500)
Bugzilla/Constants.pm
Bugzilla/Install/Filesystem.pm

index 695f2feded890a0f4fa2a2517a26d42471bf5339..00f0f81042ee4b9846a88135d24fec41f25503e1 100644 (file)
@@ -659,18 +659,21 @@ sub _bz_locations {
     $libpath =~ /(.*)/;
     $libpath = $1;
 
-    my ($localconfig, $datadir);
+    my ($localconfig, $datadir, $confdir);
     if ($project && $project =~ /^(\w+)$/) {
         $project = $1;
         $localconfig = "localconfig.$project";
         $datadir = "data/$project";
+        $confdir = "conf/$project";
     } else {
         $project = undef;
         $localconfig = "localconfig";
         $datadir = "data";
+        $confdir = "conf";
     }
 
     $datadir = "$libpath/$datadir";
+    $confdir = "$libpath/$confdir";
     # We have to return absolute paths for mod_perl.
     # That means that if you modify these paths, they must be absolute paths.
     return {
@@ -698,6 +701,7 @@ sub _bz_locations {
         'assetsdir'      => "$datadir/assets",
         # error_reports store error/warnings destined for sentry
         'error_reports'  => "$libpath/error_reports",
+        'confdir'        => $confdir,
     };
 }
 
index e1e9a47d7d5c7518fc601040dae4b7198ea3bfdf..cbec34bdc605b1e612b8d9c44ad2ddbb1f9f9ac4 100644 (file)
@@ -173,6 +173,7 @@ sub DIR_ALSO_WS_SERVE { _suexec() ? 0001 : 0 };
 # when exploiting some security flaw somewhere (not necessarily in Bugzilla!)
 sub FILESYSTEM {
     my $datadir        = bz_locations()->{'datadir'};
+    my $confdir        = bz_locations()->{'confdir'};
     my $attachdir      = bz_locations()->{'attachdir'};
     my $extensionsdir  = bz_locations()->{'extensionsdir'};
     my $webdotdir      = bz_locations()->{'webdotdir'};
@@ -320,6 +321,8 @@ sub FILESYSTEM {
                                      dirs => DIR_WS_SERVE },
          "$extensionsdir/*/web" => { files => WS_SERVE,
                                      dirs => DIR_WS_SERVE },
+         $confdir               => { files => WS_SERVE,
+                                     dirs => DIR_WS_SERVE, },
 
          # Purpose: allow webserver to read .bzr so we execute bzr commands
          # in backticks and look at the result over the web. Used to show
@@ -364,6 +367,7 @@ sub FILESYSTEM {
         # Directories that contain content served directly by the web server.
         "$skinsdir/custom"      => DIR_WS_SERVE,
         "$skinsdir/contrib"     => DIR_WS_SERVE,
+        $confdir                => DIR_CGI_READ,
     );
 
     my $yui_all_css = sub {
@@ -458,6 +462,8 @@ sub FILESYSTEM {
                                           contents => HT_DEFAULT_DENY },
         'httpd/.htaccess'            => { perms    => WS_SERVE,
                                           contents => HT_DEFAULT_DENY },
+        "$confdir/.htaccess"         => { perms    => WS_SERVE,
+                                          contents => HT_DEFAULT_DENY },
         "$datadir/.htaccess"         => { perms    => WS_SERVE,
                                           contents => HT_DEFAULT_DENY },
         "$error_reports/.htaccess"   => { perms    => WS_SERVE,