Guest user not removed after guest session ends when using bash as default shell

Bug #1411100 reported by Schlomo Schapiro on 2015-01-15
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
High
Unassigned
Precise
High
Unassigned
Trusty
High
Unassigned
Utopic
High
Unassigned

Bug Description

The /usr/sbin/giest-account script contains a bug which prevents the removal of guest accounts:

$ sudo /usr/sbin/guest-account remove guest-Hhiook
/usr/sbin/guest-account: line 129: UID: readonly variable

Maybe this is related to /bin/sh actually beeing a Bash:

$ ll -d /bin/sh
lrwxrwxrwx 1 root root 4 Jan 1 01:44 /bin/sh -> bash*

But since using Bash as default sh is still a "feature" of Ubuntu, all scripts should work with both.

Running the script with dash actually works:

$ sudo dash /usr/sbin/guest-account remove guest-ZWCtva
umount: /tmp/guest-ZWCtva: mountpoint not found
umount: /tmp/guest-ZWCtva: mountpoint not found
Removing user `guest-ZWCtva' ...
Warning: group `guest-ZWCtva' has no more members.
Done.

Related branches

Schlomo Schapiro (sschapiro) wrote :

This patch renames the variables in the remove part of the script so that they cannot conflict with reserved Bash variables

Schlomo Schapiro (sschapiro) wrote :

Sorry, this is the real patch.

The attachment "Patch to use non-conflicting variable names" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in lightdm (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Gunnar Hjalmarsson (gunnarhj) wrote :

The original guest-account script resides in lp:lightdm, so I added a lightdm bug task.

Schlomo Schapiro (sschapiro) wrote :

It would be nice to see the fix in vivid and utopic, if possible.

Gunnar Hjalmarsson (gunnarhj) wrote :

On 2015-01-15 21:13, Schlomo Schapiro wrote:
> It would be nice to see the fix in vivid and utopic, if possible.

To speed it up I would suggest that you prepare merge proposals against lp:lightdm and lp:lightdm/1.12 .

Schlomo Schapiro (sschapiro) wrote :

I tried my best - first time doing this on Launchpad so please forgive if I am doing it the wrong way.

no longer affects: lightdm
Changed in lightdm (Ubuntu):
status: Confirmed → Triaged
Changed in lightdm (Ubuntu Utopic):
status: New → Triaged
importance: Undecided → High
Changed in lightdm (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → High
summary: - guest user not removed after guest session ends
+ Guest user not removed after guest session ends when using bash as
+ default shell
Changed in lightdm (Ubuntu Precise):
status: New → Triaged
importance: Undecided → High
Changed in lightdm (Ubuntu):
status: Triaged → Fix Committed
Changed in lightdm (Ubuntu Utopic):
status: Triaged → Fix Committed
Changed in lightdm (Ubuntu Trusty):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.13.1-0ubuntu2

---------------
lightdm (1.13.1-0ubuntu2) vivid; urgency=medium

  * debian/guest-account.sh:
    - Rename variables to make script compatible with Bash (LP: #1411100)
  * debian/control:
    - Set required version of bash
 -- Robert Ancell <email address hidden> Wed, 21 Jan 2015 12:20:42 +1300

Changed in lightdm (Ubuntu):
status: Fix Committed → Fix Released
Sebastien Bacher (seb128) wrote :

Doesn't seem there is something left to sponsor (fixes is in current serie and stable one, likely going to be part of the next SRU), unsubscribing sponsors

Hello Schlomo, or anyone else affected,

Accepted lightdm into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/lightdm/1.12.3-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Timo Aaltonen (tjaalton) wrote :

Hello Schlomo, or anyone else affected,

Accepted lightdm into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/lightdm/1.10.5-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in lightdm (Ubuntu Precise):
status: Triaged → Fix Committed
status: Fix Committed → Triaged
Robert Ancell (robert-ancell) wrote :

Confirmed script works with bash in trusty-proposed and utopic-proposed

tags: added: verification-done-precise verification-done-trusty
removed: verification-needed
tags: added: verification-done-utopic
removed: verification-done-precise
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.10.5-0ubuntu1

---------------
lightdm (1.10.5-0ubuntu1) trusty; urgency=medium

  * New upstream release:
    - Fix pipe file descriptor leak for each greeter session. (LP: #1190344)
    - Don't attempt generate D-Bus seat/session removal signals on shutdown.
  * debian/guest-account.sh:
    - Rename variables to make script compatible with Bash (LP: #1411100)
  * debian/control:
    - Set required version of bash
 -- Robert Ancell <email address hidden> Tue, 10 Mar 2015 16:49:11 +1300

Changed in lightdm (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for lightdm has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.12.3-0ubuntu1

---------------
lightdm (1.12.3-0ubuntu1) utopic; urgency=medium

  * New upstream release:
    - Fix pipe file descriptor leak for each greeter session. (LP: #1190344)
    - Don't attempt generate D-Bus seat/session removal signals on shutdown.
  * debian/guest-account.sh:
    - Rename variables to make script compatible with Bash (LP: #1411100)
  * debian/lightdm-session:
    - Use bash for the session to improve error handling (LP: #678421)
  * debian/control:
    - Depend on bash

lightdm (1.12.2-0ubuntu1) utopic; urgency=medium

  * New upstream release:
    - Fix pipe file descriptor leak for each session login / authentication
      (LP: #1190344)
    - Use correct syntax for DesktopNames key in session files (LP: #1383321)
    - Mock /run in tests
  * debian/config-error-dialog.sh:
    - Show warning dialog instead of interrupted login if syntax error in
      ~/.profile etc (LP: #678421)
 -- Robert Ancell <email address hidden> Tue, 10 Mar 2015 16:02:44 +1300

Changed in lightdm (Ubuntu Utopic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers