18292
|
1 |
diff -urN -x '*.orig' -x '*.rej' ../amd64/gtk+-2.19.6/configure.in gtk+-2.19.6/configure.in
|
|
2 |
--- ../amd64/gtk+-2.19.6/configure.in 2010-02-23 05:39:16.000000000 +0100
|
|
3 |
+++ gtk+-2.19.6/configure.in 2010-03-02 16:57:31.541365910 +0100
|
|
4 |
@@ -1771,7 +1771,15 @@
|
|
5 |
if test "x$gdktarget" = "xx11"; then
|
|
6 |
GTK_PACKAGES="$GTK_PACKAGES pangoft2"
|
|
7 |
fi
|
|
8 |
-GTK_EXTRA_LIBS=
|
|
9 |
+
|
|
10 |
+case "$host" in
|
|
11 |
+ *-*-solaris*)
|
|
12 |
+ GTK_EXTRA_LIBS="-lsecdb -ltsol"
|
|
13 |
+ ;;
|
|
14 |
+ *)
|
|
15 |
+ GTK_EXTRA_LIBS=
|
|
16 |
+ ;;
|
|
17 |
+ esac
|
|
18 |
GTK_EXTRA_CFLAGS=
|
|
19 |
GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS"
|
|
20 |
GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS"
|
17637
|
21 |
diff -urN -x '*.orig' -x '*.rej' ../amd64/gtk+-2.19.6/gdk/x11/gdkmain-x11.c gtk+-2.19.6/gdk/x11/gdkmain-x11.c
|
|
22 |
--- ../amd64/gtk+-2.19.6/gdk/x11/gdkmain-x11.c 2009-11-26 10:05:07.000000000 +0100
|
|
23 |
+++ gtk+-2.19.6/gdk/x11/gdkmain-x11.c 2010-03-02 16:57:31.541731616 +0100
|
16275
|
24 |
@@ -438,6 +438,8 @@
|
13180
|
25 |
{
|
|
26 |
if (error->error_code)
|
|
27 |
{
|
|
28 |
+ if (error->error_code == 3)
|
|
29 |
+ return 1;
|
|
30 |
if (_gdk_error_warnings)
|
|
31 |
{
|
|
32 |
gchar buf[64];
|
17637
|
33 |
diff -urN -x '*.orig' -x '*.rej' ../amd64/gtk+-2.19.6/gtk/Makefile.am gtk+-2.19.6/gtk/Makefile.am
|
|
34 |
--- ../amd64/gtk+-2.19.6/gtk/Makefile.am 2010-02-23 05:39:18.000000000 +0100
|
|
35 |
+++ gtk+-2.19.6/gtk/Makefile.am 2010-03-02 16:57:31.542242114 +0100
|
|
36 |
@@ -407,6 +407,7 @@
|
|
37 |
gtktoolpaletteprivate.h \
|
16786
|
38 |
gtktreedatalist.h \
|
|
39 |
gtktreeprivate.h \
|
16706
|
40 |
+ gtktrustedutils.h \
|
16786
|
41 |
gtkwindow-decorate.h \
|
|
42 |
$(gtk_clipboard_dnd_h_sources)
|
|
43 |
|
17637
|
44 |
@@ -614,6 +615,7 @@
|
16706
|
45 |
gtktreestore.c \
|
|
46 |
gtktreeview.c \
|
|
47 |
gtktreeviewcolumn.c \
|
|
48 |
+ gtktrustedutils.c \
|
|
49 |
gtktypebuiltins.c \
|
|
50 |
gtktypeutils.c \
|
|
51 |
gtkuimanager.c \
|
17637
|
52 |
diff -urN -x '*.orig' -x '*.rej' ../amd64/gtk+-2.19.6/gtk/gtkaboutdialog.c gtk+-2.19.6/gtk/gtkaboutdialog.c
|
|
53 |
--- ../amd64/gtk+-2.19.6/gtk/gtkaboutdialog.c 2010-02-23 05:39:18.000000000 +0100
|
|
54 |
+++ gtk+-2.19.6/gtk/gtkaboutdialog.c 2010-03-02 16:57:31.543217714 +0100
|
|
55 |
@@ -229,6 +229,26 @@
|
16707
|
56 |
GError *error = NULL;
|
16706
|
57 |
|
|
58 |
screen = gtk_widget_get_screen (GTK_WIDGET (about));
|
16707
|
59 |
+
|
16706
|
60 |
+ if (gtk_trusted_path_is_restricted () ) {
|
|
61 |
+ GtkWidget *dialog;
|
|
62 |
+
|
|
63 |
+ dialog = gtk_message_dialog_new (GTK_WINDOW (about),
|
|
64 |
+ GTK_DIALOG_DESTROY_WITH_PARENT |
|
|
65 |
+ GTK_DIALOG_MODAL,
|
|
66 |
+ GTK_MESSAGE_ERROR,
|
|
67 |
+ GTK_BUTTONS_CLOSE,
|
|
68 |
+ "%s", _("Could not show link"));
|
|
69 |
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
|
|
70 |
+ "%s", _("You do not have sufficient clearance to invoke this link"));
|
|
71 |
+
|
|
72 |
+ g_signal_connect (dialog, "response",
|
|
73 |
+ G_CALLBACK (gtk_widget_destroy), NULL);
|
|
74 |
+
|
|
75 |
+ gtk_window_present (GTK_WINDOW (dialog));
|
|
76 |
+
|
|
77 |
+ return;
|
|
78 |
+ }
|
16707
|
79 |
|
17637
|
80 |
if (!gtk_show_uri (screen, uri, gtk_get_current_event_time (), &error))
|
|
81 |
{
|
|
82 |
@@ -823,7 +843,7 @@
|
|
83 |
|
|
84 |
gtk_widget_show (priv->website_label);
|
16820
|
85 |
|
|
86 |
- if (priv->website_url && (!activate_url_hook_set || activate_url_hook != NULL))
|
|
87 |
+ if (priv->website_url && (!activate_url_hook_set || activate_url_hook != NULL) && !gtk_trusted_path_is_restricted ())
|
|
88 |
{
|
17637
|
89 |
gchar *markup;
|
|
90 |
|
|
91 |
@@ -2350,7 +2370,11 @@
|
16706
|
92 |
old = activate_email_hook;
|
|
93 |
|
|
94 |
activate_email_hook_set = TRUE;
|
|
95 |
- activate_email_hook = func;
|
|
96 |
+ if (gtk_trusted_path_is_restricted ()) {
|
|
97 |
+ activate_email_hook = NULL;
|
|
98 |
+ } else {
|
|
99 |
+ activate_email_hook = func;
|
16707
|
100 |
+ }
|
16706
|
101 |
activate_email_hook_data = data;
|
|
102 |
activate_email_hook_destroy = destroy;
|
|
103 |
|
17637
|
104 |
@@ -2386,7 +2410,11 @@
|
16706
|
105 |
old = activate_url_hook;
|
|
106 |
|
|
107 |
activate_url_hook_set = TRUE;
|
|
108 |
- activate_url_hook = func;
|
|
109 |
+ if (gtk_trusted_path_is_restricted ()) {
|
|
110 |
+ activate_url_hook = NULL;
|
|
111 |
+ } else {
|
|
112 |
+ activate_url_hook = func;
|
|
113 |
+ }
|
|
114 |
activate_url_hook_data = data;
|
|
115 |
activate_url_hook_destroy = destroy;
|
|
116 |
|
17637
|
117 |
diff -urN -x '*.orig' -x '*.rej' ../amd64/gtk+-2.19.6/gtk/gtkfilechooserdefault.c gtk+-2.19.6/gtk/gtkfilechooserdefault.c
|
|
118 |
--- ../amd64/gtk+-2.19.6/gtk/gtkfilechooserdefault.c 2010-02-23 05:39:18.000000000 +0100
|
|
119 |
+++ gtk+-2.19.6/gtk/gtkfilechooserdefault.c 2010-03-02 16:57:31.546257922 +0100
|
18292
|
120 |
@@ -72,6 +72,10 @@
|
|
121 |
|
|
122 |
#include "gtkalias.h"
|
|
123 |
|
|
124 |
+#ifdef sun
|
|
125 |
+#include "gtktrustedutils.h"
|
|
126 |
+#endif
|
|
127 |
+
|
|
128 |
#include <errno.h>
|
|
129 |
#include <string.h>
|
|
130 |
#include <time.h>
|
17637
|
131 |
@@ -5201,6 +5205,13 @@
|
16275
|
132 |
impl->browse_widgets = browse_widgets_create (impl);
|
|
133 |
gtk_box_pack_start (GTK_BOX (impl), impl->browse_widgets, TRUE, TRUE, 0);
|
|
134 |
|
|
135 |
+#ifdef sun
|
|
136 |
+ /* trusted path restriction label */
|
17273
|
137 |
+ /* SUN_BRANDING */
|
16275
|
138 |
+ impl->trustedpathlabel = gtk_label_new (_("You do not have sufficient clearance to use this file chooser"));
|
|
139 |
+ gtk_box_pack_start (GTK_BOX (impl), impl->trustedpathlabel, FALSE, FALSE, 0);
|
|
140 |
+#endif
|
|
141 |
+
|
|
142 |
/* Alignment to hold extra widget */
|
|
143 |
impl->extra_align = gtk_alignment_new (0.0, 0.5, 1.0, 1.0);
|
|
144 |
gtk_box_pack_start (GTK_BOX (impl), impl->extra_align, FALSE, FALSE, 0);
|
17637
|
145 |
@@ -5235,7 +5246,13 @@
|
16275
|
146 |
if (impl->extra_widget)
|
|
147 |
{
|
|
148 |
gtk_container_add (GTK_CONTAINER (impl->extra_align), impl->extra_widget);
|
|
149 |
+#ifdef sun
|
16706
|
150 |
+ if (!gtk_trusted_path_is_restricted ()) {
|
16275
|
151 |
+ gtk_widget_show (impl->extra_align);
|
|
152 |
+ }
|
|
153 |
+#else
|
|
154 |
gtk_widget_show (impl->extra_align);
|
|
155 |
+#endif
|
|
156 |
}
|
|
157 |
else
|
|
158 |
gtk_widget_hide (impl->extra_align);
|
17637
|
159 |
@@ -5351,6 +5368,10 @@
|
16275
|
160 |
static void
|
|
161 |
update_appearance (GtkFileChooserDefault *impl)
|
|
162 |
{
|
|
163 |
+#ifdef sun
|
|
164 |
+ gtk_widget_hide (impl->trustedpathlabel);
|
|
165 |
+#endif
|
|
166 |
+
|
|
167 |
if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
|
|
168 |
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
|
|
169 |
{
|
17637
|
170 |
@@ -5405,6 +5426,16 @@
|
16275
|
171 |
else
|
|
172 |
gtk_widget_show (impl->browse_new_folder_button);
|
|
173 |
|
|
174 |
+#ifdef sun
|
16706
|
175 |
+ if (gtk_trusted_path_is_restricted ())
|
16275
|
176 |
+ {
|
|
177 |
+ gtk_widget_hide (impl->location_button);
|
|
178 |
+ gtk_widget_hide (impl->browse_widgets);
|
|
179 |
+ if (impl->save_widgets) gtk_widget_hide (impl->save_widgets);
|
|
180 |
+ gtk_widget_show (impl->trustedpathlabel);
|
|
181 |
+ }
|
|
182 |
+#endif
|
|
183 |
+
|
|
184 |
/* This *is* needed; we need to redraw the file list because the "sensitivity"
|
|
185 |
* of files may change depending whether we are in a file or folder-only mode.
|
|
186 |
*/
|
17637
|
187 |
@@ -8008,9 +8039,10 @@
|
16275
|
188 |
|
|
189 |
impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
|
|
190 |
|
|
191 |
- if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|
16706
|
192 |
+ if ( !gtk_trusted_path_is_restricted () &&
|
16275
|
193 |
+ ( impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|
|
194 |
|| impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
|
|
195 |
- || impl->expand_folders)
|
|
196 |
+ || impl->expand_folders))
|
|
197 |
{
|
|
198 |
GtkFileChooserSettings *settings;
|
|
199 |
int x, y, width, height;
|
17637
|
200 |
diff -urN -x '*.orig' -x '*.rej' ../amd64/gtk+-2.19.6/gtk/gtkfilechooserdialog.c gtk+-2.19.6/gtk/gtkfilechooserdialog.c
|
|
201 |
--- ../amd64/gtk+-2.19.6/gtk/gtkfilechooserdialog.c 2010-02-23 05:39:18.000000000 +0100
|
|
202 |
+++ gtk+-2.19.6/gtk/gtkfilechooserdialog.c 2010-03-02 16:57:31.546665214 +0100
|
18292
|
203 |
@@ -30,6 +30,10 @@
|
|
204 |
#include "gtktypebuiltins.h"
|
|
205 |
#include "gtkintl.h"
|
|
206 |
#include "gtkalias.h"
|
|
207 |
+#include "gtkstock.h"
|
|
208 |
+#ifdef sun
|
|
209 |
+#include "gtktrustedutils.h"
|
|
210 |
+#endif
|
|
211 |
|
|
212 |
#include <stdarg.h>
|
|
213 |
|
16706
|
214 |
@@ -336,6 +340,14 @@
|
16275
|
215 |
GtkFileChooserDialog *dialog = GTK_FILE_CHOOSER_DIALOG (data);
|
|
216 |
int response_id;
|
|
217 |
|
|
218 |
+#ifdef sun
|
16706
|
219 |
+ if (gtk_trusted_path_is_restricted ())
|
16275
|
220 |
+ {
|
|
221 |
+ gtk_widget_hide (widget);
|
|
222 |
+ return;
|
|
223 |
+ }
|
|
224 |
+#endif
|
|
225 |
+
|
|
226 |
response_id = gtk_dialog_get_response_for_widget (GTK_DIALOG (dialog), widget);
|
|
227 |
if (is_stock_accept_response_id (response_id))
|
|
228 |
gtk_dialog_set_default_response (GTK_DIALOG (dialog), response_id);
|
16706
|
229 |
@@ -347,6 +359,14 @@
|
16275
|
230 |
gtk_container_foreach (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area),
|
|
231 |
foreach_ensure_default_response_cb,
|
|
232 |
dialog);
|
|
233 |
+
|
|
234 |
+#ifdef sun
|
16706
|
235 |
+ if (gtk_trusted_path_is_restricted ())
|
16275
|
236 |
+ {
|
|
237 |
+ gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_DELETE_EVENT);
|
|
238 |
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_DELETE_EVENT);
|
|
239 |
+ }
|
|
240 |
+#endif
|
|
241 |
}
|
|
242 |
|
|
243 |
/* GtkWidget::map handler */
|
17637
|
244 |
diff -urN -x '*.orig' -x '*.rej' ../amd64/gtk+-2.19.6/gtk/gtkfilechooserprivate.h gtk+-2.19.6/gtk/gtkfilechooserprivate.h
|
|
245 |
--- ../amd64/gtk+-2.19.6/gtk/gtkfilechooserprivate.h 2010-02-18 00:28:09.000000000 +0100
|
|
246 |
+++ gtk+-2.19.6/gtk/gtkfilechooserprivate.h 2010-03-02 16:57:31.546921223 +0100
|
|
247 |
@@ -210,6 +210,10 @@
|
16275
|
248 |
GtkWidget *extra_align;
|
|
249 |
GtkWidget *extra_widget;
|
|
250 |
|
|
251 |
+#ifdef sun
|
|
252 |
+ GtkWidget *trustedpathlabel;
|
|
253 |
+#endif
|
|
254 |
+
|
|
255 |
GtkWidget *location_button;
|
|
256 |
GtkWidget *location_entry_box;
|
|
257 |
GtkWidget *location_label;
|
17637
|
258 |
diff -urN -x '*.orig' -x '*.rej' ../amd64/gtk+-2.19.6/gtk/gtktrustedutils.c gtk+-2.19.6/gtk/gtktrustedutils.c
|
|
259 |
--- ../amd64/gtk+-2.19.6/gtk/gtktrustedutils.c 1970-01-01 01:00:00.000000000 +0100
|
|
260 |
+++ gtk+-2.19.6/gtk/gtktrustedutils.c 2010-03-02 16:57:31.547129569 +0100
|
16706
|
261 |
@@ -0,0 +1,82 @@
|
|
262 |
+/* GTK - The GIMP Toolkit
|
|
263 |
+ * gtktrustedutils.c: Private utility functions useful for
|
|
264 |
+ * Trusted Path checks
|
|
265 |
+ * Copyright (C) 2009, Sun Microsystems, Inc.
|
|
266 |
+ *
|
|
267 |
+ * This library is free software; you can redistribute it and/or
|
|
268 |
+ * modify it under the terms of the GNU Lesser General Public
|
|
269 |
+ * License as published by the Free Software Foundation; either
|
|
270 |
+ * version 2 of the License, or (at your option) any later version.
|
|
271 |
+ *
|
|
272 |
+ * This library is distributed in the hope that it will be useful,
|
|
273 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
274 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
275 |
+ * Lesser General Public License for more details.
|
|
276 |
+ *
|
|
277 |
+ * You should have received a copy of the GNU Lesser General Public
|
|
278 |
+ * License along with this library; if not, write to the
|
|
279 |
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
280 |
+ * Boston, MA 02111-1307, USA.
|
|
281 |
+ */
|
|
282 |
+
|
|
283 |
+#include "config.h"
|
|
284 |
+#include <glib.h>
|
16275
|
285 |
+#include <user_attr.h>
|
|
286 |
+#include <secdb.h>
|
|
287 |
+#include <tsol/label.h>
|
16706
|
288 |
+#include <zone.h>
|
|
289 |
+
|
16275
|
290 |
+gboolean
|
16706
|
291 |
+gtk_trusted_path_is_restricted (void)
|
16275
|
292 |
+{
|
|
293 |
+ static int restricted = -1;
|
|
294 |
+ m_label_t *adminhigh = NULL;
|
|
295 |
+ m_label_t *clearance = NULL;
|
|
296 |
+ char *value = NULL;
|
|
297 |
+ int err;
|
|
298 |
+ userattr_t *uattr;
|
|
299 |
+
|
|
300 |
+ if (restricted == -1)
|
|
301 |
+ {
|
|
302 |
+ if (!is_system_labeled () || getzoneid () != 0)
|
|
303 |
+ { /* Not trusted system or not running in global zone = no restriction*/
|
|
304 |
+ restricted = 0;
|
|
305 |
+ }
|
|
306 |
+ else if (str_to_label (ADMIN_HIGH, &adminhigh, USER_CLEAR, L_DEFAULT,
|
|
307 |
+ &err))
|
|
308 |
+ { /* string translation of ADMIN_HIGH failed so user is restricted */
|
|
309 |
+ restricted = 1;
|
|
310 |
+ }
|
|
311 |
+ else
|
|
312 |
+ {
|
16347
|
313 |
+ if (uattr = getuseruid (getuid ()))
|
|
314 |
+ {
|
|
315 |
+ value = kva_match (uattr->attr, USERATTR_CLEARANCE);
|
|
316 |
+ if (value == NULL)
|
|
317 |
+ { /* no value defined for users clearance, assume restricted */
|
|
318 |
+ restricted = 1;
|
|
319 |
+ }
|
|
320 |
+ else if (str_to_label (value, &clearance, USER_CLEAR, L_DEFAULT,
|
|
321 |
+ &err))
|
|
322 |
+ { /*string translation, this shouldn't happen */
|
|
323 |
+ restricted = 1;
|
|
324 |
+ }
|
|
325 |
+ else if (blequal (adminhigh, clearance))
|
|
326 |
+ {
|
|
327 |
+ restricted = 0;
|
|
328 |
+ }
|
|
329 |
+ else
|
|
330 |
+ {
|
|
331 |
+ restricted = 1;
|
|
332 |
+ }
|
|
333 |
+ free_userattr (uattr);
|
|
334 |
+ }
|
|
335 |
+ else
|
|
336 |
+ {
|
|
337 |
+ restricted = 1;
|
|
338 |
+ }
|
16275
|
339 |
+ }
|
|
340 |
+ }
|
|
341 |
+
|
|
342 |
+ return restricted ? TRUE : FALSE;
|
|
343 |
+}
|
17637
|
344 |
diff -urN -x '*.orig' -x '*.rej' ../amd64/gtk+-2.19.6/gtk/gtktrustedutils.h gtk+-2.19.6/gtk/gtktrustedutils.h
|
|
345 |
--- ../amd64/gtk+-2.19.6/gtk/gtktrustedutils.h 1970-01-01 01:00:00.000000000 +0100
|
|
346 |
+++ gtk+-2.19.6/gtk/gtktrustedutils.h 2010-03-02 16:57:31.547289333 +0100
|
16706
|
347 |
@@ -0,0 +1,31 @@
|
|
348 |
+/* GTK - The GIMP Toolkit
|
|
349 |
+ * gtktrustedutils.h: Private utility functions useful for
|
|
350 |
+ * Trusted Path checks
|
|
351 |
+ * Copyright (C) 2009, Sun Microsystems, Inc.
|
|
352 |
+ *
|
|
353 |
+ * This library is free software; you can redistribute it and/or
|
|
354 |
+ * modify it under the terms of the GNU Lesser General Public
|
|
355 |
+ * License as published by the Free Software Foundation; either
|
|
356 |
+ * version 2 of the License, or (at your option) any later version.
|
|
357 |
+ *
|
|
358 |
+ * This library is distributed in the hope that it will be useful,
|
|
359 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
360 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
361 |
+ * Lesser General Public License for more details.
|
|
362 |
+ *
|
|
363 |
+ * You should have received a copy of the GNU Lesser General Public
|
|
364 |
+ * License along with this library; if not, write to the
|
|
365 |
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
366 |
+ * Boston, MA 02111-1307, USA.
|
|
367 |
+ */
|
16275
|
368 |
+
|
16706
|
369 |
+#ifndef __GTK_TRUSTED_UTILS_H__
|
|
370 |
+#define __GTK_TRUSTED_UTILS_H__
|
|
371 |
+
|
|
372 |
+G_BEGIN_DECLS
|
16275
|
373 |
+
|
16706
|
374 |
+gboolean gtk_trusted_path_is_restricted (void);
|
|
375 |
+
|
|
376 |
+G_END_DECLS
|
|
377 |
+
|
|
378 |
+#endif /* __GTK_TRUSTED_UTILS_H__ */
|