Merge lp:~lamont/launchpad/lp-buildd-78 into lp:launchpad

Proposed by LaMont Jones
Status: Merged
Merged at revision: 12769
Proposed branch: lp:~lamont/launchpad/lp-buildd-78
Merge into: lp:launchpad
Diff against target: 43 lines (+24/-2)
2 files modified
lib/canonical/buildd/debian/changelog (+6/-0)
lib/canonical/buildd/debian/postinst (+18/-2)
To merge this branch: bzr merge lp:~lamont/launchpad/lp-buildd-78
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
William Grant code* Approve
Review via email: mp+56700@code.launchpad.net

Commit message

[r=stevenk,wgrant][no-qa] Update to launchpad-buildd 78, fixing postinst sudoers mangling.

Description of the change

As released. Sadly, there is still a little bit more to be done before we can really close 742881 for real. the current situation in production is stable, but only because the ppa builders get sudo 1.6.9 still.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

Ew, but it works.

review: Approve (code*)
Revision history for this message
Steve Kowalik (stevenk) wrote :

Indeed. Hideous, but it works.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/buildd/debian/changelog'
2--- lib/canonical/buildd/debian/changelog 2011-04-06 19:35:16 +0000
3+++ lib/canonical/buildd/debian/changelog 2011-04-07 06:41:57 +0000
4@@ -1,3 +1,9 @@
5+launchpad-buildd (78) hardy-cat; urgency=low
6+
7+ * Correctly update sudoers files when needed. LP: #742881
8+
9+ -- LaMont Jones <lamont@canonical.com> Wed, 06 Apr 2011 22:20:17 -0600
10+
11 launchpad-buildd (77) hardy-cat; urgency=low
12
13 * Add back in ultimate-backstop umask() correction.
14
15=== modified file 'lib/canonical/buildd/debian/postinst'
16--- lib/canonical/buildd/debian/postinst 2009-12-16 00:16:24 +0000
17+++ lib/canonical/buildd/debian/postinst 2011-04-07 06:41:57 +0000
18@@ -28,8 +28,24 @@
19 adduser --ingroup buildd --disabled-login --gecos 'Buildd user' \
20 --uid $BUILDDUID ${USER}
21
22- grep -q ^${USER} /etc/sudoers ||
23- echo "${USER} ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
24+ SUDO_VERSION=$(sudo -V | sed -n '/^Sudo version/s/.* //p')
25+ if dpkg --compare-versions $SUDO_VERSION lt 1.7 ||
26+ ! grep -q '^#includedir /etc/sudoers.d' /etc/sudoers; then
27+ grep -q ^${USER} /etc/sudoers ||
28+ echo "${USER} ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
29+ else
30+ if ! sudo -l -U ${USER} | grep -q '(ALL) NOPASSWD: ALL' ||
31+ ! sudo -l -U ${USER} | grep -q umask_override; then
32+ cat << EOF >> /etc/sudoers.d/buildd
33+Defaults:buildd umask_override
34+Defaults>buildd umask_override
35+
36+${USER} ALL=(ALL) NOPASSWD: ALL
37+%buildd ALL=(buildd) NOPASSWD: ALL, (root) NOPASSWD: /bin/su - buildd
38+%lpbuildd ALL=(ALL) NOPASSWD: ALL
39+EOF
40+ fi
41+ fi
42
43 install -d -o${USER} -m0755 /home/${USER}
44