gdm r6085 - in trunk: . gui/simple-greeter
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r6085 - in trunk: . gui/simple-greeter
- Date: Tue, 1 Apr 2008 04:38:34 +0100 (BST)
Author: mccann
Date: Tue Apr 1 04:38:34 2008
New Revision: 6085
URL: http://svn.gnome.org/viewvc/gdm?rev=6085&view=rev
Log:
2008-03-31 William Jon McCann <jmccann redhat com>
* gui/simple-greeter/gdm-user-manager.c: (reload_passwd),
(reload_shells), (gdm_user_manager_init):
Explicitly exclude users with shells that are well
known as invalid shells: /sbin/nologin, /bin/false.
Modified:
trunk/ChangeLog
trunk/gui/simple-greeter/gdm-user-manager.c
Modified: trunk/gui/simple-greeter/gdm-user-manager.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-user-manager.c (original)
+++ trunk/gui/simple-greeter/gdm-user-manager.c Tue Apr 1 04:38:34 2008
@@ -1301,13 +1301,15 @@
}
/* ...And users w/ invalid shells... */
- if (!pwent->pw_shell ||
+ if (pwent->pw_shell == NULL ||
!g_hash_table_lookup (manager->priv->shells, pwent->pw_shell)) {
+ g_debug ("GdmUserManager: skipping user with bad shell: %s", pwent->pw_name);
continue;
}
/* ...And explicitly excluded users */
if (g_hash_table_lookup (manager->priv->exclusions, pwent->pw_name)) {
+ g_debug ("GdmUserManager: explicitly skipping user: %s", pwent->pw_name);
continue;
}
@@ -1394,7 +1396,14 @@
setusershell ();
g_hash_table_remove_all (manager->priv->shells);
- for (shell = getusershell (); shell; shell = getusershell ()) {
+ for (shell = getusershell (); shell != NULL; shell = getusershell ()) {
+ /* skip well known not-real shells */
+ if (shell == NULL
+ || strcmp (shell, "/sbin/nologin") == 0
+ || strcmp (shell, "/bin/false") == 0) {
+ g_debug ("GdmUserManager: skipping shell %s", shell);
+ continue;
+ }
g_hash_table_insert (manager->priv->shells,
g_strdup (shell),
GUINT_TO_POINTER (TRUE));
@@ -1537,7 +1546,7 @@
G_FILE_MONITOR_NONE,
NULL,
&error);
- if (manager->priv->shells_monitor != NULL) {
+ if (manager->priv->passwd_monitor != NULL) {
g_signal_connect (manager->priv->passwd_monitor,
"changed",
G_CALLBACK (on_passwd_monitor_changed),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]