diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2013-05-06 12:57:45 +0300 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2013-05-06 12:57:45 +0300 |
commit | 27a7a6e69dfe228f67cebcdf0d2e7f5a57a686d6 (patch) | |
tree | 971bc9cf1b6d9edf0f585a68264b3ecc741bcac2 /raring-armhf-nano/customization/hooks/03-check_sudoers_for_admin.chroot | |
parent | 9d5a88c404ee6882855bde7baa0474b1bdd11669 (diff) |
Add live-build configuration for Raring
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'raring-armhf-nano/customization/hooks/03-check_sudoers_for_admin.chroot')
-rwxr-xr-x | raring-armhf-nano/customization/hooks/03-check_sudoers_for_admin.chroot | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/raring-armhf-nano/customization/hooks/03-check_sudoers_for_admin.chroot b/raring-armhf-nano/customization/hooks/03-check_sudoers_for_admin.chroot new file mode 100755 index 0000000..5c82429 --- /dev/null +++ b/raring-armhf-nano/customization/hooks/03-check_sudoers_for_admin.chroot @@ -0,0 +1,17 @@ +#!/bin/sh + +# check to make sure sudoers file has ref for admin +ADMINEXISTS="$(awk '$1 == "%admin" { print $1 }' /etc/sudoers)" +if [ -z "$ADMINEXISTS" ]; then + # append admin entry to sudoers + echo "# Members of the admin group may gain root privileges" >> /etc/sudoers + echo "%admin ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers +fi + +# make sure that NOPASSWD is set for %admin +# expecially in the case that we didn't add it to /etc/sudoers +# just blow the %admin line away and force it to be NOPASSWD +sed -i -e ' +/\%admin/ c \ +%admin ALL = (ALL) NOPASSWD: ALL +' /etc/sudoers |