Merge lp:~dpolehn-gmail/ubuntu/precise/pam/fix-110287 into lp:~ubuntu-core-dev/pam/ubuntu

Proposed by Daniel Polehn
Status: Work in progress
Proposed branch: lp:~dpolehn-gmail/ubuntu/precise/pam/fix-110287
Merge into: lp:~ubuntu-core-dev/pam/ubuntu
Diff against target: 29 lines (+9/-2)
2 files modified
debian/changelog (+6/-0)
debian/libpam-modules.postinst (+3/-2)
To merge this branch: bzr merge lp:~dpolehn-gmail/ubuntu/precise/pam/fix-110287
Reviewer Review Type Date Requested Status
Steve Langasek Needs Fixing
Review via email: mp+92599@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

+ DESIRED_PATH='PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"'
+ if ! grep -qs "$DESIRED_PATH" /etc/environment ; then
+ echo $DESIRED_PATH > /etc/environment

This will unconditionally add a new PATH line to /etc/environment unless that exact path is already present. A little bit more finessing is wanted here. We want to:

 - add the PATH variable on new installs
 - on upgrades from versions of the package earlier than 1.1.3-7ubuntu2, *insert* /usr/local/games into the path - don't clobber the path, because if the local admin has modified the path, we don't want to override that setting.

I think the command to use for inserting the added path would be something like:

  sed -i -e'/^PATH / s,\(:/usr/games\),:/usr/local/games\1,' /etc/environment

And then the version number check needs to be fixed up as well, since currently the code only runs on new installs or when upgrading from a very, very ancient version of libpam-modules.

review: Needs Fixing

Unmerged revisions

887. By Daniel Polehn

Add /usr/local/games to default $PATH LP: #110287

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-02-09 01:15:41 +0000
3+++ debian/changelog 2012-02-11 00:18:28 +0000
4@@ -1,3 +1,9 @@
5+pam (1.1.3-7ubuntu3) precise; urgency=low
6+
7+ * Add /usr/local/games to default $PATH LP: #110287
8+
9+ -- Daniel Polehn <dpolehn@gmail.com> Fri, 10 Feb 2012 09:45:11 -0800
10+
11 pam (1.1.3-7ubuntu2) precise; urgency=low
12
13 * No-change rebuild with gzip 1.4-1ubuntu2 to get multiarch-clean
14
15=== modified file 'debian/libpam-modules.postinst'
16--- debian/libpam-modules.postinst 2011-02-18 00:15:43 +0000
17+++ debian/libpam-modules.postinst 2012-02-11 00:18:28 +0000
18@@ -21,8 +21,9 @@
19 # /etc/security/pam_env.conf
20 if [ "$1" = "configure" ] && (dpkg --compare-versions 0.79-3ubuntu6 ge "$2" || [ "$2" = "" ]); then
21 if ! grep -qs ^PATH /etc/security/pam_env.conf; then
22- if ! grep -qs ^PATH /etc/environment; then
23- echo 'PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"' >> /etc/environment
24+ DESIRED_PATH='PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"'
25+ if ! grep -qs "$DESIRED_PATH" /etc/environment ; then
26+ echo $DESIRED_PATH > /etc/environment
27 fi
28 fi
29 fi

Subscribers

People subscribed via source and target branches