Merge lp:~sschapiro/lightdm/guest-account-scripts-bash-support-1_12 into lp:lightdm/1.12

Proposed by Schlomo Schapiro
Status: Merged
Merged at revision: 2083
Proposed branch: lp:~sschapiro/lightdm/guest-account-scripts-bash-support-1_12
Merge into: lp:lightdm/1.12
Diff against target: 68 lines (+18/-18)
1 file modified
debian/guest-account.sh (+18/-18)
To merge this branch: bzr merge lp:~sschapiro/lightdm/guest-account-scripts-bash-support-1_12
Reviewer Review Type Date Requested Status
Robert Ancell Approve
Gunnar Hjalmarsson (community) Approve
Review via email: mp+246824@code.launchpad.net

Description of the change

Fixes #1411100

To post a comment you must log in.
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :
review: Approve
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Thanks Schlomo, I've also merged this into the 1.10 branch.

Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/guest-account.sh'
2--- debian/guest-account.sh 2014-07-25 22:12:59 +0000
3+++ debian/guest-account.sh 2015-01-17 18:30:51 +0000
4@@ -119,46 +119,46 @@
5
6 remove_account ()
7 {
8- USER=$1
9+ GUEST_USER=$1
10
11- PWENT=`getent passwd "$USER"` || {
12- echo "Error: invalid user $USER"
13+ PWENT=`getent passwd "$GUEST_USER"` || {
14+ echo "Error: invalid user $GUEST_USER"
15 exit 1
16 }
17- UID=`echo "$PWENT" | cut -f3 -d:`
18- HOME=`echo "$PWENT" | cut -f6 -d:`
19+ GUEST_UID=`echo "$PWENT" | cut -f3 -d:`
20+ GUEST_HOME=`echo "$PWENT" | cut -f6 -d:`
21
22- if [ "$UID" -ge 500 ]; then
23- echo "Error: user $USER is not a system user."
24+ if [ "$GUEST_UID" -ge 500 ]; then
25+ echo "Error: user $GUEST_USER is not a system user."
26 exit 1
27 fi
28
29- if [ "${HOME}" = "${HOME#/tmp/}" ]; then
30- echo "Error: home directory $HOME is not in /tmp/."
31+ if [ "${GUEST_HOME}" = "${GUEST_HOME#/tmp/}" ]; then
32+ echo "Error: home directory $GUEST_HOME is not in /tmp/."
33 exit 1
34 fi
35
36 # kill all remaining processes
37- while ps h -u "$USER" >/dev/null; do
38- killall -9 -u "$USER" || true
39+ while ps h -u "$GUEST_USER" >/dev/null; do
40+ killall -9 -u "$GUEST_USER" || true
41 sleep 0.2;
42 done
43
44- umount "$HOME" || umount -l "$HOME" || true
45- rm -rf "$HOME"
46+ umount "$GUEST_HOME" || umount -l "$GUEST_HOME" || true
47+ rm -rf "$GUEST_HOME"
48
49 # remove leftovers in /tmp
50- find /tmp -mindepth 1 -maxdepth 1 -uid "$UID" -print0 | xargs -0 rm -rf || true
51+ find /tmp -mindepth 1 -maxdepth 1 -uid "$GUEST_UID" -print0 | xargs -0 rm -rf || true
52
53 # remove possible /media/guest-XXXXXX folder
54- if [ -d /media/"$USER" ]; then
55- for dir in $( find /media/"$USER" -mindepth 1 -maxdepth 1 ); do
56+ if [ -d /media/"$GUEST_USER" ]; then
57+ for dir in $( find /media/"$GUEST_USER" -mindepth 1 -maxdepth 1 ); do
58 umount "$dir" || true
59 done
60- rmdir /media/"$USER" || true
61+ rmdir /media/"$GUEST_USER" || true
62 fi
63
64- deluser --system "$USER"
65+ deluser --system "$GUEST_USER"
66 }
67
68 case "$1" in

Subscribers

People subscribed via source and target branches