From f63cd95c0c7011e9de9a1e550ee76f06470d72ec Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Sun, 3 Jan 2010 19:52:56 +0000 Subject: [PATCH] sudo-enable-wheel-group: Cleanup recipe to install a rule file in /etc/sudoers.d in place of old postinst munge of /etc/sudoers. --- recipes/sudo/sudo-enable-wheel-group.bb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/recipes/sudo/sudo-enable-wheel-group.bb b/recipes/sudo/sudo-enable-wheel-group.bb index b281ddb09d..b53983f1d3 100644 --- a/recipes/sudo/sudo-enable-wheel-group.bb +++ b/recipes/sudo/sudo-enable-wheel-group.bb @@ -1,4 +1,4 @@ -PR = "r0" +PR = "r2" RDEPENDS = "sudo" @@ -8,13 +8,15 @@ PACKAGE_ARCH = "all" # Edit sudoers to allow the use of the wheel group and non root users to mount/shutdown etc. # Please consider this when using. -pkg_postinst() { -#!/bin/sh -mkdir -p $D${sysconfdir}/ -touch $D${sysconfdir}/sudoers -sed -i /# %wheel/d $D${sysconfdir}/sudoers -echo '%wheel ALL=(ALL) ALL' >> $D${sysconfdir}/sudoers -sed -i /# %users/d $D${sysconfdir}/sudoers -echo '%users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom' >> $D${sysconfdir}/sudoers -echo '%users localhost=/sbin/shutdown -h now' >> $D${sysconfdir}/sudoers +do_compile() { + touch ${WORKDIR}/sudoers + echo '%wheel ALL=(ALL) ALL' >> ${WORKDIR}/sudoers + echo '%users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom' >> ${WORKDIR}/sudoers + echo '%users localhost=/sbin/shutdown -h now' >> ${WORKDIR}/sudoers + echo '' >> ${WORKDIR}/sudoers +} + +do_install() { + install -d ${D}${sysconfdir}/sudoers.d/ + install -m 440 ${WORKDIR}/sudoers ${D}${sysconfdir}/sudoers.d/01_enablewheel } -- 2.39.5