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
=== modified file 'debian/guest-account.sh'
--- debian/guest-account.sh 2014-07-25 22:12:59 +0000
+++ debian/guest-account.sh 2015-01-17 18:30:51 +0000
@@ -119,46 +119,46 @@
119119
120remove_account ()120remove_account ()
121{121{
122 USER=$1122 GUEST_USER=$1
123 123
124 PWENT=`getent passwd "$USER"` || {124 PWENT=`getent passwd "$GUEST_USER"` || {
125 echo "Error: invalid user $USER"125 echo "Error: invalid user $GUEST_USER"
126 exit 1126 exit 1
127 }127 }
128 UID=`echo "$PWENT" | cut -f3 -d:`128 GUEST_UID=`echo "$PWENT" | cut -f3 -d:`
129 HOME=`echo "$PWENT" | cut -f6 -d:`129 GUEST_HOME=`echo "$PWENT" | cut -f6 -d:`
130130
131 if [ "$UID" -ge 500 ]; then131 if [ "$GUEST_UID" -ge 500 ]; then
132 echo "Error: user $USER is not a system user."132 echo "Error: user $GUEST_USER is not a system user."
133 exit 1133 exit 1
134 fi134 fi
135135
136 if [ "${HOME}" = "${HOME#/tmp/}" ]; then136 if [ "${GUEST_HOME}" = "${GUEST_HOME#/tmp/}" ]; then
137 echo "Error: home directory $HOME is not in /tmp/."137 echo "Error: home directory $GUEST_HOME is not in /tmp/."
138 exit 1138 exit 1
139 fi139 fi
140140
141 # kill all remaining processes141 # kill all remaining processes
142 while ps h -u "$USER" >/dev/null; do 142 while ps h -u "$GUEST_USER" >/dev/null; do
143 killall -9 -u "$USER" || true143 killall -9 -u "$GUEST_USER" || true
144 sleep 0.2; 144 sleep 0.2;
145 done145 done
146146
147 umount "$HOME" || umount -l "$HOME" || true147 umount "$GUEST_HOME" || umount -l "$GUEST_HOME" || true
148 rm -rf "$HOME"148 rm -rf "$GUEST_HOME"
149149
150 # remove leftovers in /tmp150 # remove leftovers in /tmp
151 find /tmp -mindepth 1 -maxdepth 1 -uid "$UID" -print0 | xargs -0 rm -rf || true151 find /tmp -mindepth 1 -maxdepth 1 -uid "$GUEST_UID" -print0 | xargs -0 rm -rf || true
152152
153 # remove possible /media/guest-XXXXXX folder153 # remove possible /media/guest-XXXXXX folder
154 if [ -d /media/"$USER" ]; then154 if [ -d /media/"$GUEST_USER" ]; then
155 for dir in $( find /media/"$USER" -mindepth 1 -maxdepth 1 ); do155 for dir in $( find /media/"$GUEST_USER" -mindepth 1 -maxdepth 1 ); do
156 umount "$dir" || true156 umount "$dir" || true
157 done157 done
158 rmdir /media/"$USER" || true158 rmdir /media/"$GUEST_USER" || true
159 fi159 fi
160160
161 deluser --system "$USER"161 deluser --system "$GUEST_USER"
162}162}
163163
164case "$1" in164case "$1" in

Subscribers

People subscribed via source and target branches