From: Todd C. Miller Date: Wed, 14 Jul 2010 14:56:52 +0000 (-0400) Subject: Create sudo group on debian X-Git-Tag: SUDO_1_7_4~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=456479483ba9d01de0497acce91d51f1475c2f17;p=sudo Create sudo group on debian --HG-- branch : 1.7 --- diff --git a/sudo.pp b/sudo.pp index f42f6d929..71a7ed737 100644 --- a/sudo.pp +++ b/sudo.pp @@ -149,4 +149,26 @@ still allow people to get their work done." # installs it 0640 when sudo requires 0440 chmod %{sudoers_mode} %{sudoersdir}/sudoers + # Debian uses a sudo group in its default sudoers file + perl -e ' + exit 0 if getgrnam("sudo"); + $gid = 27; # default debian sudo gid + setgrent(); + while (getgrgid($gid)) { $gid++; } + if ($gid != 27) { + print "On Debian we normally use gid 27 for \"sudo\".\n"; + $gname = getgrgid(27); + print "However, on your system gid 27 is group \"$gname\".\n\n"; + print "Would you like me to stop configuring sudo so that you can change this? [n] "; + $ans = ; + if ($ans =~ /^[yY]/) { + print "\"dpkg --pending --configure\" will restart the configuration.\n\n"; + exit 1; + } + } + print "Creating group \"sudo\" with gid = $gid\n"; + system("groupadd -g $gid sudo"); + exit 0; + ' + # vim:ts=2:sw=2:et