From d22402c4048a6b5b67995fe5610e945dc2afc282 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Fri, 3 Jan 2014 13:03:55 -0500 Subject: [PATCH] Add validation for $priority Valid range changed to 401-599: vhost SSL header has priority 700. If $priority is set to 400 (which resolves to 400+300=700 for SSL locations), then it would conflict with the priority of the header. It must be 401 or higher to avoid this. Top end of range is limited to 599 to reflect documentation however it could be increased to 698 and still provide expected behavior. --- manifests/resource/location.pp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index d2751a23f..9a03b2f92 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -57,7 +57,7 @@ # [*auth_basic_user_file*] - This directive sets the htpasswd filename for # the authentication realm. # [*priority*] - Location priority. Default: 500. User priority -# 400-499, 501-599. If the priority is higher than the default priority, +# 401-499, 501-599. If the priority is higher than the default priority, # the location will be defined after root, or before root. # # @@ -131,6 +131,12 @@ } validate_array($index_files) + if !is_integer($priority) { + fail("$priority must be an integer.") + } + if ($priority < 401) or ($priority > 599) { + fail("$priority must be in the range 401-599. It was set to ${priority}.") + } # # Shared Variables $ensure_real = $ensure ? {