Skip to content

Commit

Permalink
Add validation for $priority
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
3flex committed Jan 3, 2014
1 parent 5655a2b commit f2f4c81
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion manifests/resource/location.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
#
Expand Down Expand Up @@ -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 ? {
Expand Down

0 comments on commit f2f4c81

Please sign in to comment.