2008-08-05 Stephen Browne <[email protected]>
authorstephen
Tue, 05 Aug 2008 13:04:30 +0000
changeset 13029 4be2c81a1c27
parent 13028 62d8d632aa5f
child 13030 6b118454cdb7
2008-08-05 Stephen Browne <[email protected]> * base-specs/gnome-session.spec: enable patch 11 in all cases * patches/SUNWtgnome-xagent-01-trusted-extensions.diff: update for new tarball * patches/gnome-session-02-gnome-about.diff: move code to session.c to stop it clashing with other patches all the time :) * patches/gnome-session-11-trusted-extensions.diff: remove dependancy on patch2. Shouldnt get so may clashes now. Also set phase to running for trusted session to fix 6706611 and start settings daemon properly to fix 6732238.
ChangeLog
base-specs/gnome-session.spec
patches/SUNWtgnome-xagent-01-trusted-extensions.diff
patches/gnome-session-02-gnome-about.diff
patches/gnome-session-11-trusted-extensions.diff
--- a/ChangeLog	Tue Aug 05 12:47:12 2008 +0000
+++ b/ChangeLog	Tue Aug 05 13:04:30 2008 +0000
@@ -1,3 +1,15 @@
+2008-08-05  Stephen Browne  <[email protected]>
+
+	* base-specs/gnome-session.spec: enable patch 11 in all cases
+	* patches/SUNWtgnome-xagent-01-trusted-extensions.diff: update for 
+	new tarball
+	* patches/gnome-session-02-gnome-about.diff: move code to session.c
+        to stop it clashing with other patches all the time :)
+	* patches/gnome-session-11-trusted-extensions.diff: remove dependancy on
+	patch2. Shouldnt get so may clashes now.  Also set phase to running for
+	trusted session to fix 6706611 and start settings daemon properly to
+	fix 6732238.
+
 2008-08-05  Ghee Teo <[email protected]>
 
 	Include DMZ cursro themes as a move from spec-files-other to here.
--- a/base-specs/gnome-session.spec	Tue Aug 05 12:47:12 2008 +0000
+++ b/base-specs/gnome-session.spec	Tue Aug 05 13:04:30 2008 +0000
@@ -98,13 +98,7 @@
 %patch8 -p1
 %endif
 %patch10 -p1
-# Note that the Trusted patch modifies the code in
-# patch2, which adds gnome-about.  Therefore, this
-# patch fails to apply unless building with sun-branding.
-# This is probably a bug and should be fixed.
-%if %option_with_sun_branding
 %patch11 -p1
-%endif
 %patch12 -p1
 
 %build
--- a/patches/SUNWtgnome-xagent-01-trusted-extensions.diff	Tue Aug 05 12:47:12 2008 +0000
+++ b/patches/SUNWtgnome-xagent-01-trusted-extensions.diff	Tue Aug 05 13:04:30 2008 +0000
@@ -1,6 +1,6 @@
-diff -urN xagent.orig/gnome-session/Makefile.am xagent.new/gnome-session/Makefile.am
---- xagent.orig/gnome-session/Makefile.am	2008-07-14 17:46:08.660910000 +0100
-+++ xagent.new/gnome-session/Makefile.am	2008-07-14 19:35:52.590734000 +0100
+diff -urN -x '*.orig' -x '*.rej' xagent.orig/gnome-session/Makefile.am xagent.new/gnome-session/Makefile.am
+--- xagent.orig/gnome-session/Makefile.am	2008-08-05 14:17:55.406294000 +0100
++++ xagent.new/gnome-session/Makefile.am	2008-08-05 14:19:07.105079000 +0100
 @@ -1,4 +1,4 @@
 -bin_PROGRAMS = gnome-session
 +bin_PROGRAMS = tsoljds-xagent
@@ -27,8 +27,8 @@
  	app-resumed.c				\
 @@ -47,11 +47,9 @@
  	gsm.h					\
- 	logout-dialog.h				\
- 	logout-dialog.c				\
+ 	logout.h				\
+ 	logout.c				\
 -	main.c					\
 +	xagent.c				\
  	power-manager.h				\
@@ -38,9 +38,9 @@
  	session.c				\
  	session.h				\
  	xsmp.c					\
-diff -urN xagent.orig/gnome-session/session.c xagent.new/gnome-session/session.c
---- xagent.orig/gnome-session/session.c	2008-07-14 17:46:08.661992000 +0100
-+++ xagent.new/gnome-session/session.c	2008-07-21 16:22:09.831012000 +0100
+diff -urN -x '*.orig' -x '*.rej' xagent.orig/gnome-session/session.c xagent.new/gnome-session/session.c
+--- xagent.orig/gnome-session/session.c	2008-08-05 14:17:55.392661000 +0100
++++ xagent.new/gnome-session/session.c	2008-08-05 14:18:31.474823000 +0100
 @@ -171,6 +171,20 @@
    session->name = g_strdup (name);
  }
@@ -50,7 +50,7 @@
 +{
 +  char **app;
 +  char *xagent_blacklist[] = {"metacity", "gnome-panel", "tsoljdsselmgr", 
-+			      "tsoljds-tstripe", "gnome-session-splash", NULL};
++			      "tsoljds-tstripe", "gnome-session-splash", "gnome-settings-deamon", "gnome-power-manager", "at-spi-registryd-wrapper", "gnome-login-sound", "ospm-applet", NULL};
 +
 +  for (app = xagent_blacklist; *app != NULL; app++) {
 +	if (strncmp (name, *app, strlen (*app)) == 0) return TRUE;
@@ -71,9 +71,9 @@
      {
        g_object_unref (app);
        return;
-diff -urN xagent.orig/gnome-session/xagent.c xagent.new/gnome-session/xagent.c
+diff -urN -x '*.orig' -x '*.rej' xagent.orig/gnome-session/xagent.c xagent.new/gnome-session/xagent.c
 --- xagent.orig/gnome-session/xagent.c	1970-01-01 01:00:00.000000000 +0100
-+++ xagent.new/gnome-session/xagent.c	2008-07-21 16:54:05.363806000 +0100
++++ xagent.new/gnome-session/xagent.c	2008-08-05 14:18:31.477084000 +0100
 @@ -0,0 +1,288 @@
 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 +/*
@@ -323,6 +323,7 @@
 +   * already running. This requires us to initialize XSMP too, because
 +   * we want $SESSION_MANAGER to be set before launching dbus-daemon.
 +   */
++  if (!nosession) {
 +  gsm_gconf_init ();
 +  gsm_xsmp_init ();
 +  gsm_dbus_init ();
@@ -331,14 +332,13 @@
 +   * gsm_initialization_error() if they failed.)
 +   */
 +  gsm_gconf_check ();
-+  gsm_dbus_check ();
++  gsm_dbus_check (); 
 +
 +  global_session = gsm_session_new (defaultsession);
 +
 +  gsm_xsmp_run ();
 +  gsm_dbus_run ();
 +
-+  if (!nosession) {
 +    if (g_file_test (TSOLJDS_MIGRATION_SCRIPT, G_FILE_TEST_IS_EXECUTABLE)) {
 +      system (TSOLJDS_MIGRATION_SCRIPT);
 +    }
--- a/patches/gnome-session-02-gnome-about.diff	Tue Aug 05 12:47:12 2008 +0000
+++ b/patches/gnome-session-02-gnome-about.diff	Tue Aug 05 13:04:30 2008 +0000
@@ -1,21 +1,12 @@
---- gnome-session-2.23.4/gnome-session/gsm.h-orig	2008-06-19 15:12:05.273155000 -0500
-+++ gnome-session-2.23.4/gnome-session/gsm.h	2008-06-19 15:12:29.015042000 -0500
-@@ -4,6 +4,9 @@
- #define GSM_GCONF_DEFAULT_SESSION_KEY           "/desktop/gnome/session/default-session"
- #define GSM_GCONF_REQUIRED_COMPONENTS_DIRECTORY "/desktop/gnome/session/required-components"
+diff -urN session.orig/gnome-session/session.c session.new/gnome-session/session.c
+--- session.orig/gnome-session/session.c	2008-08-05 13:11:56.645264000 +0100
++++ session.new/gnome-session/session.c	2008-08-05 13:42:35.726774000 +0100
+@@ -636,12 +636,36 @@
+     end_phase (session);
+ }
  
-+/* Start gnome-about on first-time startup */
-+#define ABOUT_PROMPT_KEY                        "/desktop/gnome/session/sun_extensions/viewed_about_jds_three"
++#define ABOUT_PROMPT_KEY "/desktop/gnome/session/sun_extensions/viewed_about_jds_three"
 +
- void gsm_initialization_error (gboolean fatal, const char *format, ...);
- 
- extern GsmSession *global_session;
---- gnome-session-2.23.4/gnome-session/main.c-orig	2008-06-19 16:26:15.033705000 -0500
-+++ gnome-session-2.23.4/gnome-session/main.c	2008-06-19 16:34:42.940141000 -0500
-@@ -37,6 +37,21 @@ static GOptionEntry entries[] = {
-   { NULL, 0, 0, 0, NULL, NULL, NULL }
- };
- 
 +static gint
 +show_gnome_about (gpointer data)
 +{
@@ -31,34 +22,19 @@
 +  return FALSE;
 +}
 +
- /**
-  * gsm_initialization_error:
-  * @fatal: whether or not the error is fatal to the login session
-@@ -94,6 +109,8 @@ main (int argc, char **argv)
-   char *display_str;
-   Display *xdisp;
-   GdkDisplay *gdisp;
+ void
+ gsm_session_start (GsmSession *session)
+ {
 +  gboolean show_about;
 +  GConfClient *gconf_client;
++
+   session->phase = GSM_SESSION_PHASE_INITIALIZATION;
  
-   bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
-   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-@@ -143,6 +160,18 @@ main (int argc, char **argv)
- 
-   gsm_session_start (global_session);
- 
+   start_phase (session);
++
 +  gconf_client = gconf_client_get_default ();
 +  show_about = gconf_client_get_bool (gconf_client, ABOUT_PROMPT_KEY, NULL);
-+
-+#ifndef HAVE_XTSOL
-+  if (! show_about)
-+    gtk_timeout_add (4000, show_gnome_about, NULL);
-+#else
-+  if (! trusted_session)
-+    if (! show_about)
-+      gtk_timeout_add (4000, show_gnome_about, NULL);
-+#endif
-+
-   gtk_main ();
++  if (!show_about) gtk_timeout_add (4000, show_gnome_about, NULL);
+ }
  
-   gsm_xsmp_shutdown ();
+ GsmSessionPhase
--- a/patches/gnome-session-11-trusted-extensions.diff	Tue Aug 05 12:47:12 2008 +0000
+++ b/patches/gnome-session-11-trusted-extensions.diff	Tue Aug 05 13:04:30 2008 +0000
@@ -1,6 +1,6 @@
-diff -urN session.orig/gnome-session/Makefile.am session.new/gnome-session/Makefile.am
---- session.orig/gnome-session/Makefile.am	2008-07-03 16:15:37.374116000 +0100
-+++ session.new/gnome-session/Makefile.am	2008-07-14 16:57:17.460528000 +0100
+diff -urN -x '*.orig' -x '*.rej' session.orig/gnome-session/Makefile.am session.new/gnome-session/Makefile.am
+--- session.orig/gnome-session/Makefile.am	2008-08-05 13:53:43.498787000 +0100
++++ session.new/gnome-session/Makefile.am	2008-08-05 13:53:53.432894000 +0100
 @@ -17,7 +17,7 @@
  	-DGCONFTOOL_CMD=\"$(GCONFTOOL)\" 
  
@@ -19,9 +19,9 @@
  	session.c				\
  	session.h				\
  	xsmp.c					\
-diff -urN session.orig/gnome-session/main.c session.new/gnome-session/main.c
---- session.orig/gnome-session/main.c	2008-07-03 16:15:37.380305000 +0100
-+++ session.new/gnome-session/main.c	2008-07-14 16:21:40.818798000 +0100
+diff -urN -x '*.orig' -x '*.rej' session.orig/gnome-session/main.c session.new/gnome-session/main.c
+--- session.orig/gnome-session/main.c	2008-08-05 13:53:43.505385000 +0100
++++ session.new/gnome-session/main.c	2008-08-05 13:55:52.930449000 +0100
 @@ -28,15 +28,20 @@
  #include "session.h"
  #include "util.h"
@@ -43,7 +43,7 @@
    { NULL, 0, 0, 0, NULL, NULL, NULL }
  };
  
-@@ -205,6 +210,12 @@
+@@ -188,6 +193,12 @@
    xdisp = gdk_x11_display_get_xdisplay (gdisp);
    XInternAtom (xdisp, "GNOME_SM_DESKTOP", FALSE);
  
@@ -56,38 +56,54 @@
    gsm_wait_for_unfinished_postrun ();
  
    /* Start up gconfd and dbus-daemon (in parallel) if they're not
-@@ -226,19 +237,17 @@
+@@ -208,8 +219,13 @@
+ 
    gsm_xsmp_run ();
    gsm_dbus_run ();
- 
+-
 -  gsm_session_start (global_session);
++ 
 +  if (trusted_session) {
 +    gsm_trusted_session_start ();
++    gsm_set_session_phase_running (global_session);
 +  } else {
 +    gsm_session_start (global_session);
-+ 
-+    gconf_client = gconf_client_get_default ();
-+    show_about = gconf_client_get_bool (gconf_client, ABOUT_PROMPT_KEY, NULL);
- 
--  gconf_client = gconf_client_get_default ();
--  show_about = gconf_client_get_bool (gconf_client, ABOUT_PROMPT_KEY, NULL);
--
--#ifndef HAVE_XTSOL
--  if (! show_about)
--    gtk_timeout_add (4000, show_gnome_about, NULL);
--#else
--  if (! trusted_session)
-     if (! show_about)
-       gtk_timeout_add (4000, show_gnome_about, NULL);
--#endif
 +  }
  
    gtk_main ();
  
-diff -urN session.orig/gnome-session/trusted.c session.new/gnome-session/trusted.c
+diff -urN -x '*.orig' -x '*.rej' session.orig/gnome-session/session.c session.new/gnome-session/session.c
+--- session.orig/gnome-session/session.c	2008-08-05 13:53:43.480271000 +0100
++++ session.new/gnome-session/session.c	2008-08-05 14:07:53.539793000 +0100
+@@ -461,6 +461,13 @@
+   g_slist_free (required_components);
+ }
+ 
++void
++gsm_set_session_phase_running (GsmSession *session)
++{
++  session->phase = GSM_SESSION_PHASE_RUNNING;
++  gsm_dbus_emit_session_running ();
++}
++
+ static void start_phase (GsmSession *session);
+ 
+ static void
+diff -urN -x '*.orig' -x '*.rej' session.orig/gnome-session/session.h session.new/gnome-session/session.h
+--- session.orig/gnome-session/session.h	2008-08-05 13:53:43.492473000 +0100
++++ session.new/gnome-session/session.h	2008-08-05 13:53:53.493089000 +0100
+@@ -71,6 +71,7 @@
+                                                 const char *name);
+ 
+ void             gsm_session_start             (GsmSession *session);
++void		 gsm_set_session_phase_running (GsmSession *session);
+ 
+ GsmSessionPhase  gsm_session_get_phase         (GsmSession *session);
+ 
+diff -urN -x '*.orig' -x '*.rej' session.orig/gnome-session/trusted.c session.new/gnome-session/trusted.c
 --- session.orig/gnome-session/trusted.c	1970-01-01 01:00:00.000000000 +0100
-+++ session.new/gnome-session/trusted.c	2008-07-21 16:58:07.125554000 +0100
-@@ -0,0 +1,107 @@
++++ session.new/gnome-session/trusted.c	2008-08-05 13:53:53.494644000 +0100
+@@ -0,0 +1,114 @@
 +/* trusted.c
 + * Copyright (C) 2008 SUN Microsystems, Inc.
 + *
@@ -146,31 +162,38 @@
 +	priv_freeset (pset);
 +}
 +
-+static void
-+start_trusted_apps (void)
++void
++gsm_trusted_session_start (void)
 +{
 +	char **app_path = NULL;
-+	static char *trusted_apps[] = {
-+				      "/usr/bin/tsoljds-setssheight",
-+				      "/usr/bin/metacity",
-+                                      "/usr/bin/tsoljdsselmgr",
-+                                      "/usr/bin/tsoljds-tstripe",
-+                                      "/usr/lib/wnck_applet",
-+                                      "/usr/bin/gnome-panel",
-+				      "/usr/bin/nautilus",
-+                                      NULL};
++	static char *setup_apps[] = {"/usr/lib/gnome-settings-daemon",
++	        "/usr/lib/gnome-session/helpers/gnome-settings-daemon-helper", 
++		"/usr/lib/gnome-session/helpers/gnome-keyring-daemon-wrapper",
++		NULL};
++	static char *trusted_apps[] = {"/usr/bin/tsoljds-setssheight",
++				       "/usr/bin/metacity",
++                                       "/usr/bin/tsoljdsselmgr",
++                                       "/usr/bin/tsoljds-tstripe",
++                                       "/usr/lib/wnck_applet",
++                                       "/usr/bin/gnome-panel",
++                                       NULL};
++
++	static char *untrusted_apps[] = { "/usr/bin/nautilus --no-default-window", NULL};
++
++  	for (app_path = setup_apps; *app_path != NULL; app_path++) {
++		g_spawn_command_line_async (*app_path, NULL);
++	}
++	escalate_privs ();
 +
 +  	for (app_path = trusted_apps; *app_path != NULL; app_path++) {
 +		g_spawn_command_line_async (*app_path, NULL);
 +	}
-+}
++
++	drop_privs ();
 +
-+void
-+gsm_trusted_session_start (void)
-+{
-+	escalate_privs ();
-+	start_trusted_apps ();
-+	drop_privs ();
++  	for (app_path = untrusted_apps; *app_path != NULL; app_path++) {
++		g_spawn_command_line_async (*app_path, NULL);
++	}
 +}
 +
 +gboolean
@@ -186,18 +209,18 @@
 +		return TRUE;
 +	} else {
 +		dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR,
-+						 GTK_BUTTONS_OK, _("Unable to login to Trusted Session. Required X server security extension ot loaded."));
-+		g_signal_connect (dialog, "response", 
-+				     G_CALLBACK (gtk_widget_destroy), NULL);
++						 GTK_BUTTONS_OK, _("Unable to login to Trusted Session. Required X server security extension not loaded."));
 +		gtk_widget_show (dialog);
 +		gtk_dialog_run (GTK_DIALOG (dialog));
++		gtk_widget_destroy (dialog);
++
 +		return FALSE;
 +	}
 +}
 +
-diff -urN session.orig/gnome-session/trusted.h session.new/gnome-session/trusted.h
+diff -urN -x '*.orig' -x '*.rej' session.orig/gnome-session/trusted.h session.new/gnome-session/trusted.h
 --- session.orig/gnome-session/trusted.h	1970-01-01 01:00:00.000000000 +0100
-+++ session.new/gnome-session/trusted.h	2008-07-14 15:35:16.413466000 +0100
++++ session.new/gnome-session/trusted.h	2008-08-05 13:53:53.496391000 +0100
 @@ -0,0 +1,28 @@
 +/* trusted.h
 + * Copyright (C) 2008 SUN Microsystems, Inc.