patches/gnome-session-08-trusted-extensions.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 16514 8586290d3018
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15330
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
     1
diff -urN -x'*.orig' -x'*.rej' gnome-session-2.25.92/gnome-session/Makefile.am ../SUNWgnome-session-2.25.91.p10/gnome-session-2.25.92/gnome-session/Makefile.am
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
     2
--- gnome-session-2.25.92/gnome-session/Makefile.am	2009-03-03 16:58:00.000000000 +0000
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
     3
+++ ../SUNWgnome-session-2.25.91.p10/gnome-session-2.25.92/gnome-session/Makefile.am	2009-03-09 15:44:15.916519000 +0000
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
     4
@@ -98,6 +99,8 @@
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
     5
 	gsm-session-save.h			\
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     6
 	gsm-xsmp-server.c			\
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     7
 	gsm-xsmp-server.h			\
15330
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
     8
+	trusted.h				\
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
     9
+	trusted.c				\
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    10
 	$(NULL)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    11
 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    12
 libgsmutil_la_LIBADD = 				\
15330
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
    13
diff -urN -x'*.orig' -x'*.rej' gnome-session-2.25.92/gnome-session/trusted.c ../SUNWgnome-session-2.25.91.p10/gnome-session-2.25.92/gnome-session/trusted.c
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
    14
--- gnome-session-2.25.92/gnome-session/trusted.c	1970-01-01 01:00:00.000000000 +0100
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
    15
+++ ../SUNWgnome-session-2.25.91.p10/gnome-session-2.25.92/gnome-session/trusted.c	2009-03-09 15:41:33.527439000 +0000
14919
b6a836b9c89d 2009-01-16 Stephen Browne <[email protected]>
stephen
parents: 14401
diff changeset
    16
@@ -0,0 +1,116 @@
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    17
+/* trusted.c
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    18
+ * Copyright (C) 2008 SUN Microsystems, Inc.
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    19
+ *
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    20
+ * This program is free software; you can redistribute it and/or
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    21
+ * modify it under the terms of the GNU General Public License as
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    22
+ * published by the Free Software Foundation; either version 2 of the
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    23
+ * License, or (at your option) any later version.
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    24
+ *
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    25
+ * This program is distributed in the hope that it will be useful, but
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    26
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    28
+ * Lesser General Public License for more details.
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    29
+ *
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    30
+ * You should have received a copy of the GNU General Public License
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    31
+ * along with this program; if not, write to the Free Software
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    32
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    33
+ * 02111-1307, USA.
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    34
+ */
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    35
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    36
+#include <priv.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    37
+#include <user_attr.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    38
+#include <secdb.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    39
+#include <gtk/gtk.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    40
+#include <X11/Xlib.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    41
+#include <sys/types.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    42
+#include <unistd.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    43
+#include <glib/gi18n.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    44
+#include "trusted.h"
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    45
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    46
+void
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    47
+escalate_privs (void)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    48
+{
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    49
+	priv_set_t *pset;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    50
+	
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    51
+	pset = priv_allocset ();
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    52
+	getppriv (PRIV_PERMITTED, pset);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    53
+	setppriv (PRIV_SET, PRIV_INHERITABLE, pset);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    54
+}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    55
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    56
+void
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    57
+drop_privs (void)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    58
+{
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    59
+	priv_set_t *pset;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    60
+	userattr_t *uattr = NULL;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    61
+	char *value = NULL;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    62
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    63
+	pset = priv_allocset ();
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    64
+	if ((uattr = getuseruid (getuid())) && 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    65
+	    (value = kva_match (uattr->attr, USERATTR_DFLTPRIV_KW))) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    66
+		pset = priv_str_to_set (value, ",", NULL);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    67
+	} else {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    68
+		pset = priv_str_to_set ("basic", ",", NULL);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    69
+	}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    70
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    71
+	setppriv (PRIV_SET, PRIV_INHERITABLE, pset);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    72
+	priv_freeset (pset);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    73
+}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    74
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    75
+void
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    76
+gsm_trusted_session_start (void)
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    77
+{
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    78
+	char **app_path = NULL;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    79
+	static char *setup_apps[] = {"/usr/lib/gnome-settings-daemon",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    80
+	        "/usr/lib/gnome-session/helpers/gnome-settings-daemon-helper", 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    81
+		"/usr/lib/gnome-session/helpers/gnome-keyring-daemon-wrapper",
14919
b6a836b9c89d 2009-01-16 Stephen Browne <[email protected]>
stephen
parents: 14401
diff changeset
    82
+		"/usr/lib/nwam-manager",
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    83
+		NULL};
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    84
+	static char *trusted_apps[] = {"/usr/bin/tsoljds-setssheight",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    85
+				       "/usr/bin/metacity",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    86
+                                       "/usr/bin/tsoljdsselmgr",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    87
+                                       "/usr/bin/tsoljds-tstripe",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    88
+                                       "/usr/lib/wnck_applet",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    89
+                                       "/usr/bin/gnome-panel",
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    90
+                                       NULL};
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    91
+
16514
8586290d3018 2009-09-09 Stephen Browne <[email protected]>
stephen
parents: 16403
diff changeset
    92
+	static char *untrusted_apps[] = {"/usr/X11/bin/xscreensaver", NULL};
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    93
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    94
+  	for (app_path = setup_apps; *app_path != NULL; app_path++) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    95
+		g_spawn_command_line_async (*app_path, NULL);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    96
+	}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    97
+	escalate_privs ();
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    98
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    99
+  	for (app_path = trusted_apps; *app_path != NULL; app_path++) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   100
+		g_spawn_command_line_async (*app_path, NULL);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   101
+	}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   102
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   103
+	drop_privs ();
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   104
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   105
+  	for (app_path = untrusted_apps; *app_path != NULL; app_path++) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   106
+		g_spawn_command_line_async (*app_path, NULL);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   107
+	}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   108
+}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   109
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   110
+gboolean
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   111
+trusted_session_init (Display *display) 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   112
+{
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   113
+	int major_code, first_event, first_error;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   114
+	GtkWidget *dialog;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   115
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   116
+	if (XQueryExtension (display, "SUN_TSOL", &major_code, &first_event, 
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   117
+			     &first_error)) {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   118
+		g_setenv ("TRUSTED_SESSION", "TRUE", TRUE);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   119
+		drop_privs ();
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   120
+		return TRUE;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   121
+	} else {
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   122
+		dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR,
14401
b95c41e67d3f 2008-09-30 Takao Fujiwara <[email protected]>
fujiwara
parents: 13810
diff changeset
   123
+						 /* SUN_BRANDING */
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   124
+						 GTK_BUTTONS_OK, _("Unable to login to Trusted Session. Required X server security extension not loaded."));
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   125
+		gtk_widget_show (dialog);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   126
+		gtk_dialog_run (GTK_DIALOG (dialog));
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   127
+		gtk_widget_destroy (dialog);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   128
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   129
+		return FALSE;
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   130
+	}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   131
+}
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   132
+
15330
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
   133
diff -urN -x'*.orig' -x'*.rej' gnome-session-2.25.92/gnome-session/trusted.h ../SUNWgnome-session-2.25.91.p10/gnome-session-2.25.92/gnome-session/trusted.h
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
   134
--- gnome-session-2.25.92/gnome-session/trusted.h	1970-01-01 01:00:00.000000000 +0100
a935e2c278b2 2009-03-09 ghee teo <[email protected]>
gheet
parents: 15117
diff changeset
   135
+++ ../SUNWgnome-session-2.25.91.p10/gnome-session-2.25.92/gnome-session/trusted.h	2009-03-09 15:41:33.527708000 +0000
13117
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   136
@@ -0,0 +1,28 @@
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   137
+/* trusted.h
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   138
+ * Copyright (C) 2008 SUN Microsystems, Inc.
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   139
+ *
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   140
+ * This program is free software; you can redistribute it and/or
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   141
+ * modify it under the terms of the GNU General Public License as
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   142
+ * published by the Free Software Foundation; either version 2 of the
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   143
+ * License, or (at your option) any later version.
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   144
+ *
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   145
+ * This program is distributed in the hope that it will be useful, but
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   146
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   147
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   148
+ * Lesser General Public License for more details.
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   149
+ *
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   150
+ * You should have received a copy of the GNU General Public License
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   151
+ * along with this program; if not, write to the Free Software
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   152
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   153
+ * 02111-1307, USA.
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   154
+ */
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   155
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   156
+#ifndef __TRUSTED_H__
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   157
+#define __TRUSTED_H__
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   158
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   159
+#include <glib.h>
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   160
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   161
+gboolean trusted_session_init ();
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   162
+void gsm_trusted_session_start (void);
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   163
+
5b81a6e7dcfc 2008-08-13 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
   164
+#endif
15416
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   165
--- gnome-session-2.26.0/gnome-session/main.c.ori	2009-03-17 14:52:41.087991974 +0000
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   166
+++ gnome-session-2.26.0/gnome-session/main.c	2009-03-17 14:53:49.364619311 +0000
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   167
@@ -62,6 +62,7 @@
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   168
 static gboolean failsafe = FALSE;
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   169
 static gboolean show_version = FALSE;
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   170
 static gboolean debug = FALSE;
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   171
+static gboolean trusted_session = FALSE;
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   172
 
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   173
 static void
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   174
 on_bus_name_lost (DBusGProxy *bus_proxy,
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   175
@@ -506,6 +507,8 @@
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   176
                 { "default-session-key", 0, 0, G_OPTION_ARG_STRING, &default_session_key, N_("GConf key used to lookup default session"), NULL },
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   177
                 { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   178
                 { "failsafe", 'f', 0, G_OPTION_ARG_NONE, &failsafe, N_("Do not load user-specified applications"), NULL },
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   179
+        /* SUN_BRANDING */
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   180
+                { "trusted-session", '\0', 0, G_OPTION_ARG_NONE, &trusted_session, N_("Used for Trusted Multi-Label Session"), NULL },
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   181
                 { "version", 0, 0, G_OPTION_ARG_NONE, &show_version, N_("Version of this application"), NULL },
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   182
                 { NULL, 0, 0, 0, NULL, NULL, NULL }
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   183
         };
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   184
@@ -561,6 +564,12 @@
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   185
 	xdisp = gdk_x11_display_get_xdisplay (gdisp);
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   186
 	XInternAtom (xdisp, "GNOME_SM_DESKTOP", FALSE);
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   187
 
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   188
+    if (trusted_session) {
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   189
+        if (!trusted_session_init (xdisp)) {
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   190
+            exit (1);
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   191
+        }
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   192
+    }
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   193
+
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   194
 	gsm_wait_for_unfinished_postrun ();
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   195
 
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   196
         /* Some third-party programs rely on GNOME_DESKTOP_SESSION_ID to
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   197
@@ -597,7 +606,13 @@
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   198
         }
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   199
 
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   200
         gsm_xsmp_server_start (xsmp_server);
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   201
-        gsm_manager_start (manager);
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   202
+
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   203
+        if (trusted_session) {
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   204
+            gsm_trusted_session_start ();
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   205
+            gsm_manager_set_phase (manager, GSM_MANAGER_PHASE_RUNNING);
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   206
+        } else {
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   207
+            gsm_manager_start (manager);
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   208
+        }
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   209
 
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   210
         gtk_main ();
b107f2f9716f * base-specs/metacity.spec: Bump to 2.26.0.
davelam
parents: 15330
diff changeset
   211
 
16403
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   212
diff -ruN gnome-session-2.27.91.orig/gnome-session/Makefile.am gnome-session-2.27.91/gnome-session/Makefile.am
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   213
--- gnome-session-2.27.91.orig/gnome-session/Makefile.am	2009-08-28 00:03:35.464750989 +0100
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   214
+++ gnome-session-2.27.91/gnome-session/Makefile.am	2009-08-28 00:04:24.074458760 +0100
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   215
@@ -47,6 +47,7 @@
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   216
 	$(top_builddir)/egg/libeggdesktopfile.la \
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   217
 	$(SM_LIBS)				\
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   218
 	$(ICE_LIBS)				\
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   219
+	-lsecdb					\
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   220
 	$(GNOME_SESSION_LIBS)			\
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   221
 	$(GCONF_LIBS)				\
a1310e9c9d9e 2009-08-27 Christian Kelly <[email protected]>
chrisk
parents: 15416
diff changeset
   222
 	$(XRENDER_LIBS)				\