[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#985138: cinnamon: User dialog holds if user tries to create a user that already exists

Package: cinnamon
Version: 4.6.7-1ubuntu1.1
Severity: normal
Tags: patch
X-Debbugs-Cc: itzswirlz2020@outlook.com

Dear Maintainer,

   * As seen in all versions of Cinnamon so far, if the user tries to create a
user that already exists, a GLib.Error is thrown saying that the user already
exists, and the user creation dialog will hold.
   * The patch was already made upstream. Two commits actually; one to fix the
bug and one for fixing the string for localization.
   * The patch is attached below.


-- System Information:
Debian Release: bullseye/sid
  APT prefers groovy-updates
  APT policy: (500, 'groovy-updates'), (500, 'groovy-security'), (500, 'groovy'), (100, 'groovy-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.8.0-44-generic (SMP w/4 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cinnamon depends on:
ii  cinnamon-common                              4.6.7-1ubuntu1.1
ii  cinnamon-control-center                      4.6.2-2
ii  cinnamon-desktop-data                        4.6.4-1
ii  cinnamon-screensaver                         4.6.0-2ubuntu0.1
ii  cinnamon-session                             4.6.2-1
ii  cinnamon-settings-daemon                     4.6.4-1
ii  cjs                                          4.6.0-2ubuntu1
ii  cups-pk-helper                               0.2.6-1ubuntu3
ii  dconf-gsettings-backend [gsettings-backend]  0.38.0-1
ii  gir1.2-accountsservice-1.0                   0.6.55-0ubuntu13.2
ii  gir1.2-caribou-1.0                           0.4.21-7
ii  gir1.2-clutter-1.0                           1.26.4+dfsg-1
ii  gir1.2-cmenu-3.0                             4.6.1-1
ii  gir1.2-cogl-1.0                              1.22.8-1
ii  gir1.2-cvc-1.0                               4.6.4-1
ii  gir1.2-gdkpixbuf-2.0                         2.40.0+dfsg-5ubuntu0.2
ii  gir1.2-gkbd-3.0                              3.26.1-1
ii  gir1.2-glib-2.0                              1.66.1-1
ii  gir1.2-gnomedesktop-3.0                      3.38.3-0ubuntu1
ii  gir1.2-gtk-3.0                               3.24.23-1ubuntu1
ii  gir1.2-gtkclutter-1.0                        1.8.4-4
ii  gir1.2-keybinder-3.0                         0.3.2-1ubuntu1
ii  gir1.2-meta-muffin-0.0                       4.6.3-1
ii  gir1.2-nemo-3.0                              4.6.5-1
ii  gir1.2-nm-1.0                                1.26.2-1ubuntu1
ii  gir1.2-nma-1.0                               1.8.30-1
ii  gir1.2-notify-0.7                            0.7.9-1ubuntu2
ii  gir1.2-pango-1.0                             1.46.2-1
ii  gir1.2-polkit-1.0                            0.105-29
ii  gir1.2-soup-2.4                              2.72.0-2
ii  gir1.2-timezonemap-1.0                       0.4.6-2
ii  gir1.2-upowerglib-1.0                        0.99.11-2
ii  gir1.2-xapp-1.0                              1.8.9-1
ii  gkbd-capplet                                 3.26.1-1
ii  gnome-backgrounds                            3.38.0-1
ii  gnome-themes-extra                           3.28-1ubuntu1
ii  gnome-themes-standard                        3.28-1ubuntu1
ii  gsettings-desktop-schemas                    3.38.0-1ubuntu1
ii  iso-flags-png-320x240                        1.0.2-1
ii  libatk-bridge2.0-0                           2.38.0-1
ii  libatk1.0-0                                  2.36.0-0ubuntu1
ii  libc6                                        2.32-0ubuntu3
ii  libcairo2                                    1.16.0-4ubuntu1
ii  libcinnamon-desktop4                         4.6.4-1
ii  libcinnamon-menu-3-0                         4.6.1-1
ii  libcjs0                                      4.6.0-2ubuntu1
ii  libcroco3                                    0.6.13-1
ii  libgdk-pixbuf2.0-0                           2.40.0+dfsg-5ubuntu0.2
ii  libgirepository-1.0-1                        1.66.1-1
ii  libgl1                                       1.3.2-1
ii  libglib2.0-0                                 2.66.1-2ubuntu0.1
ii  libglib2.0-bin                               2.66.1-2ubuntu0.1
ii  libgstreamer1.0-0                            1.18.0-3
ii  libgtk-3-0                                   3.24.23-1ubuntu1
ii  libmuffin0                                   4.6.3-1
ii  libpango-1.0-0                               1.46.2-1
ii  libpangocairo-1.0-0                          1.46.2-1
ii  libstartup-notification0                     0.12-6
ii  libx11-6                                     2:1.6.12-1
ii  libxfixes3                                   1:5.0.3-2
ii  libxml2                                      2.9.10+dfsg-5build1
ii  mesa-utils                                   8.4.0-1build1
ii  muffin                                       4.6.3-1
ii  nemo                                         4.6.5-1
ii  network-manager-gnome                        1.18.0-1ubuntu2
ii  policykit-1-gnome                            0.105-7ubuntu2
ii  python3                                      3.8.6-0ubuntu1
ii  python3-dbus                                 1.2.16-3
ii  python3-distro                               1.5.0-1
ii  python3-gi                                   3.38.0-1
ii  python3-gi-cairo                             3.38.0-1
ii  python3-pampy                                1.8.4-2
ii  python3-pexpect                              4.6.0-4
ii  python3-pil                                  7.2.0-1ubuntu0.2
ii  python3-pyinotify                            0.9.6-1.2ubuntu1
ii  python3-setproctitle                         1.2.1-1
ii  python3-tinycss2                             1.0.2-1
ii  python3-tz                                   2020.1-2
ii  xapps-common                                 1.8.9-1

Versions of packages cinnamon recommends:
pn  blueman                               <none>
ii  cinnamon-l10n                         4.6.2-1
ii  gnome-terminal [x-terminal-emulator]  3.38.0-1ubuntu1.1
ii  libcanberra-pulse                     0.30-7ubuntu2
ii  lxterminal [x-terminal-emulator]      0.3.2-1
ii  metacity-common                       1:3.38.0-1
ii  tilix [x-terminal-emulator]           1.9.3-4build4
ii  xterm [x-terminal-emulator]           353-1ubuntu1.20.10.2

Versions of packages cinnamon suggests:
pn  cinnamon-doc    <none>
ii  python3-opencv  4.2.0+dfsg-6build6

-- no debconf information
Without this, a GLib.Error would result and the dialog would hold if the 
user created an already existing user.

Commit: https://github.com/linuxmint/cinnamon/commit/f1b565a723daa7ab9e36219d8e48581226b33acb
Fix for localization commit: https://github.com/linuxmint/cinnamon/commit/5a72d6061e42bdf934afc9d6444751e316f8e5fa
Index: cinnamon/files/usr/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.py
--- a/files/usr/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.py
+++ b/files/usr/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.py
@@ -392,6 +392,15 @@ def __init__ (self, parent = None):
         except Exception as detail:
+    def user_exists(self, user_name):
+        users = AccountsService.UserManager.get_default().list_users()
+        for user in users:
+            if user.get_user_name() == user_name:
+                return True
+        return False
     def _on_info_changed(self, widget):
         fullname = self.realname_entry.get_text()
         username = self.username_entry.get_text()
@@ -400,6 +409,10 @@ def _on_info_changed(self, widget):
             self.username_entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, "dialog-warning-symbolic")
             self.username_entry.set_icon_tooltip_text(Gtk.EntryIconPosition.SECONDARY, _("Invalid username"))
             valid = False
+        elif self.user_exists(username):
+            self.username_entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, "dialog-warning-symbolic")
+            self.username_entry.set_icon_tooltip_text(Gtk.EntryIconPosition.SECONDARY, _("A user with the name '%s' already exists.") % username)
+            valid = False
             self.username_entry.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, None)
         if username == "" or fullname == "":

Reply to: