From 2990e9ce97e278b2b5a4573f76180ddcaaeb432d Mon Sep 17 00:00:00 2001 From: le photograveur Date: Wed, 19 Jan 2022 16:13:42 +0000 Subject: [PATCH] (docs) lib/puppet/type/exec.rb `unless` `grep(1)` anchors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shown `grep(1)` example is missing begin‑of‑line/end‑of‑line anchors. --- lib/puppet/type/exec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb index f78c997864f..301f7a566bb 100644 --- a/lib/puppet/type/exec.rb +++ b/lib/puppet/type/exec.rb @@ -457,7 +457,7 @@ def check(value) exec { '/bin/echo root >> /usr/lib/cron/cron.allow': path => '/usr/bin:/usr/sbin:/bin', - unless => 'grep root /usr/lib/cron/cron.allow 2>/dev/null', + unless => 'grep ^root$ /usr/lib/cron/cron.allow 2>/dev/null', } This would add `root` to the cron.allow file (on Solaris) unless