Merge lp:~xnox/ubuntu-touch-session/no-export-bogus-environment into lp:ubuntu-touch-session

Proposed by Dimitri John Ledkov
Status: Merged
Approved by: Oliver Grawert
Approved revision: 169
Merged at revision: 171
Proposed branch: lp:~xnox/ubuntu-touch-session/no-export-bogus-environment
Merge into: lp:ubuntu-touch-session
Diff against target: 25 lines (+7/-4)
2 files modified
etc/profile.d/dbus-source.sh (+1/-1)
etc/profile.d/upstart-phablet.sh (+6/-3)
To merge this branch: bzr merge lp:~xnox/ubuntu-touch-session/no-export-bogus-environment
Reviewer Review Type Date Requested Status
Oliver Grawert Approve
Review via email: mp+213646@code.launchpad.net

Commit message

Clean up root user environment, to not export bogus variables.

Description of the change

Clean up root user environment, to not export bogus variables.

To post a comment you must log in.
Revision history for this message
Oliver Grawert (ogra) wrote :

looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'etc/profile.d/dbus-source.sh'
2--- etc/profile.d/dbus-source.sh 2013-07-17 10:06:28 +0000
3+++ etc/profile.d/dbus-source.sh 2014-04-01 12:52:54 +0000
4@@ -3,4 +3,4 @@
5
6 # source dbus address from new location
7 [ -e $HOME/.cache/upstart/dbus-session ] && . $HOME/.cache/upstart/dbus-session
8-export DBUS_SESSION_BUS_ADDRESS
9+[ -n "$DBUS_SESSION_BUS_ADDRESS" ] && export DBUS_SESSION_BUS_ADDRESS
10
11=== modified file 'etc/profile.d/upstart-phablet.sh'
12--- etc/profile.d/upstart-phablet.sh 2013-09-04 14:12:30 +0000
13+++ etc/profile.d/upstart-phablet.sh 2014-04-01 12:52:54 +0000
14@@ -1,5 +1,8 @@
15 # Join the phablet Upstart session
16-uid=$(getent passwd "$USER"|cut -d: -f3)
17-export XDG_RUNTIME_DIR="/run/user/$uid"
18+if [ "$USER" != "root" ]
19+then
20+ uid=$(getent passwd "$USER"|cut -d: -f3)
21+ export XDG_RUNTIME_DIR="/run/user/$uid"
22
23-export UPSTART_SESSION=$(/sbin/initctl list-sessions | awk '{ print $NF; quit }')
24+ export UPSTART_SESSION=$(/sbin/initctl list-sessions | awk '{ print $NF; quit }')
25+fi

Subscribers

People subscribed via source and target branches