From 0c60c687569d68bcb5336c955cc402d385080e12 Mon Sep 17 00:00:00 2001 From: mxwasilewski Date: Fri, 24 Mar 2023 16:16:53 +0100 Subject: [PATCH] strickter loglevel syntax verification --- spec/type_aliases/loglevel_spec.rb | 2 ++ types/loglevel.pp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/type_aliases/loglevel_spec.rb b/spec/type_aliases/loglevel_spec.rb index 265ecc8e61..4307ad8ce2 100644 --- a/spec/type_aliases/loglevel_spec.rb +++ b/spec/type_aliases/loglevel_spec.rb @@ -10,6 +10,7 @@ 'warn mod_ssl.c:info', 'warn ssl_module:info', 'trace4', + 'ssl:info', ].each do |allowed_value| it { is_expected.to allow_value(allowed_value) } end @@ -19,6 +20,7 @@ '', [], ['info'], + 'thisiswarning', ].each do |invalid_value| it { is_expected.not_to allow_value(invalid_value) } end diff --git a/types/loglevel.pp b/types/loglevel.pp index 3d45adab39..dedfeee7f6 100644 --- a/types/loglevel.pp +++ b/types/loglevel.pp @@ -24,4 +24,4 @@ # * `trace8` # # @see https://httpd.apache.org/docs/current/mod/core.html#loglevel -type Apache::LogLevel = Pattern[/(emerg|alert|crit|error|warn|notice|info|debug|trace[1-8])/] +type Apache::LogLevel = Pattern[/\A(([a-z_\.]+:)?(emerg|alert|crit|error|warn|notice|info|debug|trace[1-8])\W*)+\Z/]