cinnamon-settings-users: User dialog holds if user creates a user that already exists

Bug #1919026 reported by Joshua Peisach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cinnamon (Debian)
Fix Released
Unknown
cinnamon (Ubuntu)
Fix Released
Low
Joshua Peisach
Impish
Won't Fix
Undecided
Unassigned

Bug Description

[Impact]

 * In the user creation dialog if you create a user that already exists (or try to), a GLib.Error is thrown and the dialog holds.

 * While of course someone could see a user exists, it's better to maybe not have someone try to make a user named 'root', 'sudo', 'linux', 'etc' and watch Python mess up and think they screwed up their system.

* This patch checks that the user exists when the information changes and will adjust to not allow the user to be created (while giving a helpful warning

[Test Plan]

 * Boot up Cinnamon < 5.0.0

 * Run cinnamon-settings-users, and enable root if you must

 * Try to create a user, type in a username, your own or another existing one, and see that when trying to add it the application hangs.

[Where problems could occur]

 * Nothing too big except the normal fact that we are using Python. Python breakage to always happen (an update, syntax error, etc.)

 * Another patch that plays with cinnamon-settings, cinnamon-settings-users, or critically the AccountsService or any part of the library that is adjusted can mess up things.

 * Regression is unlikely, but still possible due to the world of Python, and definitely AccountsService in this GTK4/libraries world with Impish specifically

[Other Info]

 * Two patches - one to fix and one for translations fixing

Affected:
Focal - Cinnamon 4.4.8
Impish - Cinnamon 4.8.6
Jammy - Fixed in the current unstable, 5.0.5. Check Debian #985138

ProblemType: Bug
DistroRelease: Ubuntu 20.10
Package: cinnamon 4.6.7-1ubuntu1.1
ProcVersionSignature: Ubuntu 5.8.0-44.50-generic 5.8.18
Uname: Linux 5.8.0-44-generic x86_64
ApportVersion: 2.20.11-0ubuntu50.5
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Sat Mar 13 09:14:42 2021
InstallationDate: Installed on 2020-10-23 (141 days ago)
InstallationMedia: Ubuntu 20.10 "Groovy Gorilla" - Release amd64 (20201022)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: cinnamon
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Joshua Peisach (itzswirlz) wrote :
Changed in cinnamon (Ubuntu):
assignee: nobody → Joshua Peisach (itzswirlz)
Revision history for this message
Joshua Peisach (itzswirlz) wrote :
description: updated
tags: added: focal hirsute
Revision history for this message
Joshua Peisach (itzswirlz) wrote :

I have a debdiff/patch for this, based on two commits-one is the actual patch and another one is a localization fix. I put them into one if whoever reviews doesn't mind.

Changed in cinnamon (Ubuntu):
status: New → Confirmed
status: Confirmed → In Progress
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "cinnamon_4.4.8-4ubuntu0.3.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

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

tags: added: patch
Mathew Hodson (mhodson)
Changed in cinnamon (Ubuntu):
importance: Undecided → Low
Changed in cinnamon (Debian):
status: Unknown → New
Revision history for this message
Joshua Peisach (itzswirlz) wrote :

Groovy patch. The patch file is the same, this is just really an adjusted changelog and patch file name.

Changed in cinnamon (Debian):
status: New → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Could you please add SRU information to this bug report? Once that is done I'll be happy to sponsor it!

description: updated
description: updated
description: updated
Revision history for this message
Joshua Peisach (itzswirlz) wrote :

I'm not that interested in groovy/hirsute, but feel free to play with it if you *really* wish.

Revision history for this message
Brian Murray (brian-murray) wrote :

 $ dput cinnamon_4.8.6-2ubuntu0.1_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /tmp/pkgs/impish/cinnamon_4.8.6-2ubuntu0.1_source.changes: Valid signature from 1E918B66765B3E31
Checking signature on .dsc
gpg: /tmp/pkgs/impish/cinnamon_4.8.6-2ubuntu0.1.dsc: Valid signature from 1E918B66765B3E31
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading cinnamon_4.8.6-2ubuntu0.1.dsc: done.
  Uploading cinnamon_4.8.6-2ubuntu0.1.debian.tar.xz: done.
  Uploading cinnamon_4.8.6-2ubuntu0.1_source.buildinfo: done.
  Uploading cinnamon_4.8.6-2ubuntu0.1_source.changes: done.
Successfully uploaded packages.

This now awaiting review by the SRU team.

Changed in cinnamon (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

is there any risk here that enumerating the users, in environments where a large number of users are visible to the system (AD realms, etc), will cause all user creation to be slow here? I would normally expect either to do a try and then catch whatever exception is raised when trying to create an already-existing user, or else to query for the exact username from the backend to find out whether it exists rather than enumerating. (Basically, one of the two options already listed in https://github.com/linuxmint/cinnamon/issues/9494#issue-667846043.) I see that this is already committed upstream, but I still have reservations about making a change such as this in SRU because of the risk that making a change that fixes behavior when the user has made an uncommon error (conflicting username) could impact all users in certain environments (AD realms) that haven't committed an error.

Changed in cinnamon (Ubuntu Impish):
status: New → Incomplete
Revision history for this message
Robie Basak (racb) wrote : Proposed package upload rejected

An upload of cinnamon to impish-proposed has been rejected from the upload queue for the following reason: "No answer to request for clarification in over a month: https://bugs.launchpad.net/ubuntu/+source/cinnamon/+bug/1919026/comments/9".

Revision history for this message
Joshua Peisach (itzswirlz) wrote :

Hello, I've been busy with school and life - Cinnamon 5.2 is currently WIP in Debian experimental

This shouldn't slow anything down significantly. The only slowing that could happen is processing and checking the issue on info change.

I can agree that this may not be as important but it shouldn't cause any error. I tested the patch a lot before I finished submitting it to LM and I think it will be fine for Ubuntu.

Revision history for this message
Joshua Peisach (itzswirlz) wrote :

Vorlon: In response to your question, it probably could cause performance impacts if it was like, 100 accounts. But there are already a lot of users taken in the system. ~40 on my laptop. CS users cycles through all of them. Why would adding one or two more cause a big performance issue? Unless for some reason there are already an insane amount of users I find it unlikely this would happen.

But I suppose it could cause the application to just freeze, potentially DoS if a local attacker or for some reason like 1000 accounts exist on the machine. But again, why would anyone do that?

Revision history for this message
Steve Langasek (vorlon) wrote :

The point is that if the system is joined to an Active Directory realm, enumerating the list of users may mean going through tens of thousands of users. This is not a question of adding "one or two more users", and saying that you've tested it on systems with less than 100 accounts does not address this concern.

Revision history for this message
Joshua Peisach (itzswirlz) wrote :

Sorry for late response.

I have not tested that; and I do not know if I can. Maybe my dad's workplace computers (which is at a university) can be able to help but I don't know.

And I guess it could cause the program to freeze up which may not be the best idea.

Not entirely sure what to think of this as to whether it should be SRU'd or not.

Revision history for this message
Brian Murray (brian-murray) wrote :

Ubuntu 21.10 (Impish Indri) has reached end of life, so this bug will not be fixed for that specific release.

Changed in cinnamon (Ubuntu Impish):
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.