Browse Source

fix crasher when adding/removing nameless users

Ionuț Mircea Bîru 14 years ago
parent
commit
60a72ca2bc
2 changed files with 37 additions and 3 deletions
  1. 31 0
      0001-Don-t-crash-when-removing-nameless-user.patch
  2. 6 3
      PKGBUILD

+ 31 - 0
0001-Don-t-crash-when-removing-nameless-user.patch

@@ -0,0 +1,31 @@
+From 8977ba4f23aef8754c0a912e7e1ec46f8da4776e Mon Sep 17 00:00:00 2001
+From: Ionut Biru <ibiru@archlinux.org>
+Date: Mon, 9 May 2011 13:03:17 -0700
+Subject: [PATCH] Don't crash when removing nameless user
+
+Fixes https://bugzilla.gnome.org/show_bug.cgi?id=647893
+
+Signed-off-by: Ionut Biru <ibiru@archlinux.org>
+---
+ src/gdmuser/gdm-user-manager.c |    5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/src/gdmuser/gdm-user-manager.c b/src/gdmuser/gdm-user-manager.c
+index eba9da1..543fcc3 100644
+--- a/src/gdmuser/gdm-user-manager.c
++++ b/src/gdmuser/gdm-user-manager.c
+@@ -777,7 +777,10 @@ remove_user (GdmUserManager *manager,
+         if (gdm_user_get_object_path (user) != NULL) {
+                 g_hash_table_remove (manager->priv->users_by_object_path, gdm_user_get_object_path (user));
+         }
+-        g_hash_table_remove (manager->priv->users_by_name, gdm_user_get_user_name (user));
++
++        if (gdm_user_get_user_name (user) != NULL) {
++            g_hash_table_remove (manager->priv->users_by_name, gdm_user_get_user_name (user));
++        }
+ 
+         if (manager->priv->is_loaded) {
+                 g_signal_emit (manager, signals[USER_REMOVED], 0, user);
+-- 
+1.7.5.1
+

+ 6 - 3
PKGBUILD

@@ -3,7 +3,7 @@
 
 pkgname=gnome-shell
 pkgver=3.0.1
-pkgrel=3
+pkgrel=4
 pkgdesc="The next generation GNOME Shell"
 arch=('i686' 'x86_64')
 url="http://live.gnome.org/GnomeShell"
@@ -20,12 +20,14 @@ source=(http://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver%.*}/$pkgname-$p
         arch.patch
         network_fixes_up_to_5090a4ccce.patch
         shell-xfixes-cursor_missing_free.patch
-        st-private_fix_memory_leak.patch)
+        st-private_fix_memory_leak.patch
+        0001-Don-t-crash-when-removing-nameless-user.patch)
 sha256sums=('01f7ae942ba9687a5e67d62423843ed404d77b35f74acc212a5f391beed8e079'
             'a35d5e5f9f781728070aecae3bfe329f49dadcd50ca2984e0fbdd2219825a0db'
             '01bf41483d5d8935ed2dd6294ee04024f2d9bcb2ef13276b07331e485965c822'
             'c8b92768c869d0d77595da3466cc0dba3b6f067ea5fac048f32a918bbe98bbf6'
-            '8b80a0cec39c38a47521183a3030a782ab84bb6ea5e9cc58213589245288e718')
+            '8b80a0cec39c38a47521183a3030a782ab84bb6ea5e9cc58213589245288e718'
+            '291d1fa51344325e3dabc0c1287750cde98605c30f079ffad9b3523a3aba860d')
 
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
@@ -34,6 +36,7 @@ build() {
   patch -Np1 -i "${srcdir}/network_fixes_up_to_5090a4ccce.patch"
   patch -Np1 -i "${srcdir}/shell-xfixes-cursor_missing_free.patch"
   patch -Np1 -i "${srcdir}/st-private_fix_memory_leak.patch"
+  patch -Np1 -i "${srcdir}/0001-Don-t-crash-when-removing-nameless-user.patch"
 
   ./configure --prefix=/usr --sysconfdir=/etc \
       --libexecdir=/usr/lib/gnome-shell \