From 07ebdfa2c59684e79b0a1904858c9072b47601c5 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Thu, 26 Jun 2008 12:01:24 +0200 Subject: line: do a full string match of $line instead of a regex match This allows $line to contain '/' characters and is generally the safer thing to do. Patch from Francois Deppierraz --- manifests/defines/line.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/defines/line.pp b/manifests/defines/line.pp index 2eb8f98..c055f5b 100644 --- a/manifests/defines/line.pp +++ b/manifests/defines/line.pp @@ -32,7 +32,7 @@ define line($file, $line, $ensure = 'present') { } } absent: { - exec { "perl -ni -e 'print unless /^\\Q${line}\\E\$/' '${file}'": + exec { "perl -ni -e 'print if \$_ ne \"${line}\n\";' '${file}'": onlyif => "grep -qFx '${line}' '${file}'" } } -- cgit v1.2.3