Date: Wed, 07 Dec 2011 13:19:35 -0500 From: Kris Moore <kris@pcbsd.org> To: freebsd-gnome@freebsd.org Subject: Patch for GDM to fix AutoLogin issues Message-ID: <4EDFAE37.1090605@pcbsd.org>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------070402050705080401080708 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit A user sent us a heads up for a patch that fixes issues with GDM auto-login, when you want to logout and login as another user. http://forums.pcbsd.org/showthread.php?t=15615 The attached patch is from opensuse and should work if you drop it into x11/gdm/files/ Anybody want to take a look at it and put it in the port? Thanks! -- Kris Moore PC-BSD Software iXsystems --------------070402050705080401080708 Content-Type: text/plain; name="patch-daemon-gdm-static-display.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-daemon-gdm-static-display.c" --- daemon/gdm-static-display.c +++ daemon/gdm-static-display.c @@ -45,7 +45,7 @@ struct GdmStaticDisplayPrivate { - gboolean enable_timed_login; + gboolean first_login; }; enum { @@ -121,6 +121,8 @@ gdm_static_display_unmanage (GdmDisplay *display) { g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE); + GDM_STATIC_DISPLAY (display)->priv->first_login = FALSE; + GDM_DISPLAY_CLASS (gdm_static_display_parent_class)->unmanage (display); return TRUE; @@ -158,12 +160,14 @@ gdm_static_display_get_timed_login_details (GdmDisplay *display, char **usernamep, int *delayp) { - if (GDM_STATIC_DISPLAY (display)->priv->enable_timed_login) { - GDM_DISPLAY_CLASS (gdm_static_display_parent_class)->get_timed_login_details (display, enabledp, usernamep, delayp); - } else { - *enabledp = FALSE; - *usernamep = g_strdup (""); - *delayp = 0; + GDM_DISPLAY_CLASS (gdm_static_display_parent_class)->get_timed_login_details (display, enabledp, usernamep, delayp); + + if (!GDM_STATIC_DISPLAY (display)->priv->first_login) { + /* if this is autologin but not timed login, then disable + * autologin after the first one */ + if (*enabledp && *delayp == 0) { + *enabledp = FALSE; + } } } @@ -196,7 +200,7 @@ gdm_static_display_init (GdmStaticDisplay *static_display) static_display->priv = GDM_STATIC_DISPLAY_GET_PRIVATE (static_display); - static_display->priv->enable_timed_login = TRUE; + static_display->priv->first_login = TRUE; } static void --------------070402050705080401080708--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EDFAE37.1090605>