There are 2 bugs here. The first one is due to one of our patches to implement a different session dialog, which will cause gnome-session to crash if shutdown is not available. In particular, this bit of gnome-session/gsm-logout-dialog.c:
switch (logout_dialog->priv->default_response) {
case GSM_LOGOUT_RESPONSE_LOGOUT: info_text = ngettext ("You will be automatically logged " "out in %d second.", "You will be automatically logged " "out in %d seconds.", seconds); break;
case GSM_LOGOUT_RESPONSE_SHUTDOWN: info_text = ngettext ("This system will be automatically " "shut down in %d second.", "This system will be automatically " "shut down in %d seconds.", seconds); break;
case GTK_RESPONSE_CANCEL: info_text = _("You are currently logged in as \"%s\".\n"); ****GOES WRONG HERE**** break;
default: g_assert_not_reached ();
}
if (session_type == NULL) {
GsmConsolekit *consolekit;
if (!name) { name = g_strdup (g_get_user_name ());
}
buf = g_strdup_printf (_("You are currently logged in as \"%s\"."), name); buf2 = g_strdup_printf (info_text, seconds); ****CRASHES HERE**** markup = g_markup_printf_escaped ("<i>%s</i>", g_strconcat (buf, "\n", buf2, NULL)); g_free (buf); g_free (buf2); g_free (name);
I think that looks like the first bug.
The default_response is earlier set to GTK_RESPONSE_CANCEL (when it would normally be GTK_RESPONSE_SHUTDOWN) because this fails:
if (!gsm_logout_supports_shutdown (logout_dialog)) { gtk_widget_set_sensitive (tile, FALSE); /* If shutdown is not available, let's just fallback * on cancel as the default action. We could fallback * on reboot first, then suspend and then hibernate * but it's not that useful, really */ logout_dialog->priv->default_response = GTK_RESPONSE_CANCEL;
}
The reason for this is because in gsm_consolekit_can_stop, it calls org.freedesktop.Consolekit.Manager.CanStop, which returns with a permissions error, and that looks like the second bug.
There are 2 bugs here. The first one is due to one of our patches to implement a different session dialog, which will cause gnome-session to crash if shutdown is not available. In particular, this bit of gnome-session/ gsm-logout- dialog. c:
switch (logout_ dialog- >priv-> default_ response) { RESPONSE_ LOGOUT:
info_ text = ngettext ("You will be automatically logged "
"out in %d second.",
"You will be automatically logged "
"out in %d seconds.",
seconds) ;
break;
case GSM_LOGOUT_
case GSM_LOGOUT_ RESPONSE_ SHUTDOWN:
info_ text = ngettext ("This system will be automatically "
"shut down in %d second.",
"This system will be automatically "
"shut down in %d seconds.",
seconds) ;
break;
case GTK_RESPONSE_ CANCEL:
info_ text = _("You are currently logged in as \"%s\".\n"); ****GOES WRONG HERE****
break;
default:
g_assert_ not_reached ();
}
if (session_type == NULL) {
GsmConsolekit *consolekit;
}
if (g_strcmp0 (session_type, GSM_CONSOLEKIT_ SESSION_ TYPE_LOGIN_ WINDOW) != 0) {
char *name, *buf, *buf2;
name = g_locale_to_utf8 (g_get_real_name (), -1, NULL, NULL, NULL);
if (!name || name[0] == '\0' || strcmp (name, "Unknown") == 0) {
name = g_locale_to_utf8 (g_get_user_name (), -1 , NULL, NULL, NULL);
}
if (!name) {
name = g_strdup (g_get_user_name ());
}
buf = g_strdup_printf (_("You are currently logged in as \"%s\"."), name);
buf2 = g_strdup_printf (info_text, seconds); ****CRASHES HERE****
markup = g_markup_ printf_ escaped ("<i>%s</i>", g_strconcat (buf, "\n", buf2, NULL));
g_free (buf);
g_free (buf2);
g_free (name);
I think that looks like the first bug.
The default_response is earlier set to GTK_RESPONSE_CANCEL (when it would normally be GTK_RESPONSE_ SHUTDOWN) because this fails:
if (!gsm_logout_ supports_ shutdown (logout_dialog)) {
gtk_ widget_ set_sensitive (tile, FALSE);
/* If shutdown is not available, let's just fallback
* on cancel as the default action. We could fallback
* on reboot first, then suspend and then hibernate
* but it's not that useful, really */
logout_ dialog- >priv-> default_ response = GTK_RESPONSE_ CANCEL;
}
The reason for this is because in gsm_consolekit_ can_stop, it calls org.freedesktop .Consolekit. Manager. CanStop, which returns with a permissions error, and that looks like the second bug.