From 4501e3e3fef565338843741396d1634cf76ce160 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 24 Jan 2017 18:05:52 -0700 Subject: [PATCH 1/2] Do not sanitize 'location' if it's regex --- manifests/resource/location.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index 4af9fd3cb..c57de66e7 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -407,8 +407,12 @@ $config_file = "${server_dir}/${server_sanitized}.conf" - $location_sanitized_tmp = regsubst($location, '\/', '_', 'G') - $location_sanitized = regsubst($location_sanitized_tmp, '\\\\', '_', 'G') + if !($location =~ /^~/) { + $location_sanitized_tmp = regsubst($location, '\/', '_', 'G') + $location_sanitized = regsubst($location_sanitized_tmp, '\\\\', '_', 'G') + } else { + $location_sanitized = $location_sanitized_tmp + } if $ensure == present and $fastcgi != undef and !defined(File[$fastcgi_params]) { file { $fastcgi_params: From 35fd42c3026ee031a9cd6c8f591a56c1a63879a9 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 25 Jan 2017 00:06:45 -0700 Subject: [PATCH 2/2] Remove dead code --- manifests/resource/location.pp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index c57de66e7..e8c27fee1 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -407,13 +407,6 @@ $config_file = "${server_dir}/${server_sanitized}.conf" - if !($location =~ /^~/) { - $location_sanitized_tmp = regsubst($location, '\/', '_', 'G') - $location_sanitized = regsubst($location_sanitized_tmp, '\\\\', '_', 'G') - } else { - $location_sanitized = $location_sanitized_tmp - } - if $ensure == present and $fastcgi != undef and !defined(File[$fastcgi_params]) { file { $fastcgi_params: ensure => present,