From 2af4ed088125a0733bab5a655ff4925d409f4bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Wed, 8 May 2013 14:34:13 +0300 Subject: [PATCH] sudo: Added sudo::disable class which disables sudo. --- sudo/manifests/init.pp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sudo/manifests/init.pp b/sudo/manifests/init.pp index 8ff64f5..0118199 100644 --- a/sudo/manifests/init.pp +++ b/sudo/manifests/init.pp @@ -65,3 +65,19 @@ define sudo::sudoer($where="ALL", $as_whom="ALL", $what="ALL") { } } + + +# Disable sudo +# +# Cannot remove sudo package itself due to depencies +# +class sudo::disable { + + exec { "chmod 0000 /usr/bin/sudo": + user => "root", + path => "/bin:/usr/bin:/sbin:/usr/sbin", + onlyif => "test -u /usr/bin/sudo", + } + +} +