Merge lp:~tom-gall/linaro/fix-728674-live-helper.config.natty.ubuntu-desktop into lp:~linaro-maintainers/linaro/live-helper.config.natty.ubuntu-desktop

Proposed by Tom Gall
Status: Superseded
Proposed branch: lp:~tom-gall/linaro/fix-728674-live-helper.config.natty.ubuntu-desktop
Merge into: lp:~linaro-maintainers/linaro/live-helper.config.natty.ubuntu-desktop
Diff against target: 24 lines (+11/-2)
1 file modified
chroot_local-hooks/03-check_sudoers_for_admin.sh (+11/-2)
To merge this branch: bzr merge lp:~tom-gall/linaro/fix-728674-live-helper.config.natty.ubuntu-desktop
Reviewer Review Type Date Requested Status
Linaro Maintainers Pending
Review via email: mp+52342@code.launchpad.net

This proposal has been superseded by a proposal from 2011-03-07.

Description of the change

Adjust chroot_local-hooks/03-check_sudoers_for_admin.sh to add "%admin ALL = NOPASSWD: ALL" to sudoers when it is not yet included in the file. The linaro account is in the admin group so this will make sudo passwordless for linaro just fixing the bug.

Further this script also uses sed to blindly change the %admin line in sudoers which will address the case IF we did not put it there. It does also just redo the change we just did if we are the origin of the %admin line in sudos. BFHD.

To post a comment you must log in.
49. By Tom Gall

set NOPASSWD for admin group in sudoers

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'chroot_local-hooks/03-check_sudoers_for_admin.sh'
--- chroot_local-hooks/03-check_sudoers_for_admin.sh 2011-03-04 14:41:26 +0000
+++ chroot_local-hooks/03-check_sudoers_for_admin.sh 2011-03-07 03:05:14 +0000
@@ -2,9 +2,18 @@
22
3# check to make sure sudoers file has ref for admin3# check to make sure sudoers file has ref for admin
4ADMINEXISTS="$(awk '$1 == "%admin" { print $1 }' /etc/sudoers)"4ADMINEXISTS="$(awk '$1 == "%admin" { print $1 }' /etc/sudoers)"
5if [ "%admin" != "$ADMINEXISTS" ]; then5if [ -z "$ADMINEXISTS" ]; then
6 # append admin entry to sudoers6 # append admin entry to sudoers
7 echo "# Members of the admin group may gain root privileges" >> /etc/sudoers7 echo "# Members of the admin group may gain root privileges" >> /etc/sudoers
8 echo "%admin ALL = NOPASSWD: ALL" >> /etc/sudoers8 echo "%admin ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
9fi9fi
1010
11# make sure that NOPASWD is set for %admin
12# expecially in the case that we didn't add it to /etc/sudoers
13# just blow the %admin ine away and force it to be NOPASSWD
14sed -e '
15/\%admin/ c \
16%admin ALL = (ALL) NOPASSWD: ALL
17' < /etc/sudoers > /etc/sudoers.tmp
18mv /etc/sudoers.tmp /etc/sudoers
19

Subscribers

People subscribed via source and target branches

to all changes: