13439
|
1 |
diff -urN -x '*.orig' -x '*.rej' naut.orig/libnautilus-private/Makefile.am naut.new/libnautilus-private/Makefile.am
|
15579
|
2 |
--- naut.orig/libnautilus-private/Makefile.am 2009-03-25 15:48:56.404881573 +0000
|
|
3 |
+++ naut.new/libnautilus-private/Makefile.am 2009-03-25 15:50:31.163076538 +0000
|
|
4 |
@@ -174,6 +174,8 @@
|
13439
|
5 |
nautilus-trash-monitor.h \
|
|
6 |
nautilus-tree-view-drag-dest.c \
|
|
7 |
nautilus-tree-view-drag-dest.h \
|
|
8 |
+ nautilus-tsol-extensions.c \
|
|
9 |
+ nautilus-tsol-extensions.h \
|
|
10 |
nautilus-ui-utilities.c \
|
|
11 |
nautilus-ui-utilities.h \
|
|
12 |
nautilus-undo-manager.c \
|
15579
|
13 |
diff -urN -x '*.orig' -x '*.rej' naut.orig/libnautilus-private/nautilus-module.c naut.new/libnautilus-private/nautilus-module.c
|
|
14 |
--- naut.orig/libnautilus-private/nautilus-module.c 2009-03-25 15:48:56.426647854 +0000
|
|
15 |
+++ naut.new/libnautilus-private/nautilus-module.c 2009-03-31 11:05:33.382333482 +0100
|
|
16 |
@@ -23,6 +23,7 @@
|
|
17 |
|
|
18 |
#include <config.h>
|
|
19 |
#include "nautilus-module.h"
|
|
20 |
+#include "nautilus-tsol-extensions.h"
|
|
21 |
|
|
22 |
#include <eel/eel-gtk-macros.h>
|
|
23 |
#include <eel/eel-debug.h>
|
|
24 |
@@ -191,6 +192,15 @@
|
|
25 |
const char *name;
|
|
26 |
|
|
27 |
while ((name = g_dir_read_name (dir))) {
|
|
28 |
+ /* Brasero extension does not currently work with
|
|
29 |
+ labeled zones (no dbus system bus)*/
|
|
30 |
+ if (nautilus_tsol_multi_label_session () &&
|
|
31 |
+ getzoneid () != 0) {
|
|
32 |
+ if (g_str_has_prefix (name,
|
|
33 |
+ "libnautilus-brasero")) {
|
|
34 |
+ continue;
|
|
35 |
+ }
|
|
36 |
+ }
|
|
37 |
if (g_str_has_suffix (name, "." G_MODULE_SUFFIX)) {
|
|
38 |
char *filename;
|
|
39 |
|
13439
|
40 |
diff -urN -x '*.orig' -x '*.rej' naut.orig/libnautilus-private/nautilus-tsol-extensions.c naut.new/libnautilus-private/nautilus-tsol-extensions.c
|
|
41 |
--- naut.orig/libnautilus-private/nautilus-tsol-extensions.c 1970-01-01 01:00:00.000000000 +0100
|
15579
|
42 |
+++ naut.new/libnautilus-private/nautilus-tsol-extensions.c 2009-03-25 15:50:31.163916608 +0000
|
13439
|
43 |
@@ -0,0 +1,303 @@
|
|
44 |
+/*
|
|
45 |
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
|
46 |
+ * Use is subject to license terms.
|
|
47 |
+ */
|
|
48 |
+
|
|
49 |
+#include <config.h>
|
|
50 |
+#include <X11/Xatom.h>
|
|
51 |
+#include <gdk/gdkx.h>
|
|
52 |
+#include <gtk/gtk.h>
|
|
53 |
+#include <strings.h>
|
|
54 |
+#include <zone.h>
|
|
55 |
+#include <sys/types.h>
|
|
56 |
+#include <unistd.h>
|
|
57 |
+#include <tsol/label.h>
|
|
58 |
+#include <stdlib.h>
|
|
59 |
+#include <dlfcn.h>
|
|
60 |
+#include <link.h>
|
|
61 |
+#include <libgnomevfs/gnome-vfs-utils.h>
|
|
62 |
+
|
|
63 |
+#include "nautilus-tsol-extensions.h"
|
|
64 |
+
|
|
65 |
+typedef int (*tsol_getlabel) (const char*, m_label_t*);
|
|
66 |
+typedef int (*tsol_getplabel) (m_label_t*);
|
|
67 |
+typedef m_label_t* (*tsol_blabel_alloc) (void);
|
|
68 |
+typedef void (*tsol_blabel_free) (m_label_t*);
|
|
69 |
+typedef int (*tsol_blequal) (m_label_t*, m_label_t*);
|
|
70 |
+typedef int (*tsol_label_to_str) (const m_label_t*, char**,
|
|
71 |
+ const m_label_str_t, uint_t);
|
|
72 |
+typedef int (*tsol_str_to_label) (const char*, m_label_t**,
|
|
73 |
+ const m_label_type_t, uint_t, int*);
|
|
74 |
+
|
|
75 |
+static tsol_getlabel libtsol_getlabel = NULL;
|
|
76 |
+static tsol_getplabel libtsol_getplabel = NULL;
|
|
77 |
+static tsol_label_to_str libtsol_label_to_str = NULL;
|
|
78 |
+static tsol_str_to_label libtsol_str_to_label = NULL;
|
|
79 |
+static tsol_blabel_alloc libtsol_blabel_alloc = NULL;
|
|
80 |
+static tsol_blabel_free libtsol_blabel_free = NULL;
|
|
81 |
+static tsol_blequal libtsol_blequal = NULL;
|
|
82 |
+
|
|
83 |
+static gboolean
|
|
84 |
+init_tsol ()
|
|
85 |
+{
|
|
86 |
+ static gboolean tsol_init = FALSE;
|
|
87 |
+ gpointer handle = NULL;
|
|
88 |
+
|
|
89 |
+ if (!tsol_init) {
|
|
90 |
+ if (handle = dlopen ("/usr/lib/libtsol.so.2", RTLD_LAZY)) {
|
|
91 |
+ libtsol_getlabel = (tsol_getlabel) dlsym (handle,
|
|
92 |
+ "getlabel");
|
|
93 |
+ libtsol_getplabel = (tsol_getplabel) dlsym (handle,
|
|
94 |
+ "getplabel");
|
|
95 |
+ libtsol_label_to_str = (tsol_label_to_str)dlsym (handle,
|
|
96 |
+ "label_to_str");
|
|
97 |
+ libtsol_str_to_label = (tsol_str_to_label)dlsym (handle,
|
|
98 |
+ "str_to_label");
|
|
99 |
+ libtsol_blabel_alloc = (tsol_blabel_alloc)dlsym (handle,
|
|
100 |
+ "blabel_alloc");
|
|
101 |
+ libtsol_blabel_free = (tsol_blabel_free)dlsym (handle,
|
|
102 |
+ "blabel_free");
|
|
103 |
+ libtsol_blequal = (tsol_blequal) dlsym (handle,
|
|
104 |
+ "blequal");
|
|
105 |
+ }
|
|
106 |
+ tsol_init = TRUE;
|
|
107 |
+ }
|
|
108 |
+
|
|
109 |
+ if (!libtsol_getlabel || !libtsol_getplabel || !libtsol_blabel_alloc ||
|
|
110 |
+ !libtsol_blabel_free || !libtsol_label_to_str || !libtsol_blequal ||
|
|
111 |
+ !libtsol_str_to_label) {
|
|
112 |
+ return FALSE;
|
|
113 |
+ }
|
|
114 |
+
|
|
115 |
+ return TRUE;
|
|
116 |
+}
|
|
117 |
+
|
|
118 |
+char*
|
|
119 |
+nautilus_tsol_get_process_label (void)
|
|
120 |
+{
|
|
121 |
+ char *label_str;
|
|
122 |
+ m_label_t *label = NULL;
|
|
123 |
+
|
|
124 |
+ if (init_tsol ()) {
|
|
125 |
+ label = libtsol_blabel_alloc ();
|
|
126 |
+ if (libtsol_getplabel (label) == -1) {
|
|
127 |
+ label_str = NULL;
|
|
128 |
+ } else if (libtsol_label_to_str (label, &label_str, M_LABEL,
|
|
129 |
+ DEF_NAMES)) {
|
|
130 |
+ label_str = NULL;
|
|
131 |
+ }
|
|
132 |
+
|
|
133 |
+ libtsol_blabel_free (label);
|
|
134 |
+
|
|
135 |
+ return label_str;
|
|
136 |
+ } else {
|
|
137 |
+ return NULL;
|
|
138 |
+ }
|
|
139 |
+}
|
|
140 |
+
|
|
141 |
+char*
|
|
142 |
+nautilus_tsol_get_file_label (const char *uri)
|
|
143 |
+{
|
|
144 |
+ char *label_str;
|
|
145 |
+ m_label_t *label;
|
|
146 |
+ char *path;
|
|
147 |
+
|
|
148 |
+ if (init_tsol () && strncmp (uri, "file://", 7) == 0) {
|
|
149 |
+ label = libtsol_blabel_alloc ();
|
|
150 |
+ path = gnome_vfs_get_local_path_from_uri (uri);
|
|
151 |
+ if (libtsol_getlabel (path, label) == -1) {
|
|
152 |
+ label_str = NULL;
|
|
153 |
+ } else if (libtsol_label_to_str (label, &label_str, M_LABEL,
|
|
154 |
+ LONG_NAMES)) {
|
|
155 |
+ label_str = NULL;
|
|
156 |
+ }
|
|
157 |
+ g_free (path);
|
|
158 |
+
|
|
159 |
+ libtsol_blabel_free (label);
|
|
160 |
+
|
|
161 |
+ return label_str;
|
|
162 |
+ } else {
|
|
163 |
+ return g_strdup ("ADMIN_LOW");
|
|
164 |
+ }
|
|
165 |
+}
|
|
166 |
+
|
|
167 |
+gboolean
|
|
168 |
+nautilus_tsol_label_equal_to_process_label (char *label_str)
|
|
169 |
+{
|
|
170 |
+ gboolean ret = TRUE;
|
|
171 |
+ m_label_t *plabel = NULL, *label = NULL;
|
|
172 |
+ int error;
|
|
173 |
+
|
|
174 |
+ if (init_tsol ()) {
|
|
175 |
+ plabel = libtsol_blabel_alloc ();
|
|
176 |
+ label = libtsol_blabel_alloc ();
|
|
177 |
+
|
|
178 |
+ if (libtsol_getplabel (plabel) == -1) {
|
|
179 |
+ ret = TRUE;
|
|
180 |
+ } else if (libtsol_str_to_label (label_str, &label, MAC_LABEL,
|
|
181 |
+ L_NO_CORRECTION, &error) ==-1){
|
|
182 |
+ ret = TRUE;
|
|
183 |
+ } else if (libtsol_blequal (plabel, label)) {
|
|
184 |
+ ret = TRUE;
|
|
185 |
+ } else {
|
|
186 |
+ ret = FALSE;
|
|
187 |
+ }
|
|
188 |
+
|
|
189 |
+ libtsol_blabel_free (plabel);
|
|
190 |
+ libtsol_blabel_free (label);
|
|
191 |
+ }
|
|
192 |
+
|
|
193 |
+ return ret;
|
|
194 |
+}
|
|
195 |
+
|
|
196 |
+gboolean
|
|
197 |
+nautilus_tsol_multi_label_session (void)
|
|
198 |
+{
|
|
199 |
+ static int trusted = -1;
|
|
200 |
+
|
|
201 |
+ if (trusted < 0) {
|
|
202 |
+ if (getenv ("TRUSTED_SESSION")) {
|
|
203 |
+ trusted = 1;
|
|
204 |
+ } else {
|
|
205 |
+ trusted = 0;
|
|
206 |
+ }
|
|
207 |
+ }
|
|
208 |
+
|
|
209 |
+ return trusted ? TRUE : FALSE;
|
|
210 |
+}
|
|
211 |
+
|
|
212 |
+static char*
|
|
213 |
+nautilus_tsol_get_active_desktop_id (void)
|
|
214 |
+{
|
|
215 |
+ static char *dwid = NULL;
|
|
216 |
+ uid_t uid;
|
|
217 |
+ zoneid_t zid;
|
|
218 |
+
|
|
219 |
+ if (!dwid) {
|
|
220 |
+ uid = getuid();
|
|
221 |
+ zid = getzoneid();
|
|
222 |
+ dwid = g_strdup_printf ("%d_%d", uid, zid);
|
|
223 |
+ }
|
|
224 |
+
|
|
225 |
+ return dwid;
|
|
226 |
+}
|
|
227 |
+
|
|
228 |
+gboolean
|
|
229 |
+nautilus_tsol_show_desktop_window (GdkScreen *screen)
|
|
230 |
+{
|
|
231 |
+ char *dwid;
|
|
232 |
+ int format;
|
|
233 |
+ unsigned long nitems;
|
|
234 |
+ unsigned long bytesafter;
|
|
235 |
+ unsigned char *prop_data = NULL;
|
|
236 |
+ char *p;
|
|
237 |
+ int i, n_strings;
|
|
238 |
+ Atom atom, utf8_string;
|
|
239 |
+ Atom type = None;
|
|
240 |
+ Window root_win;
|
|
241 |
+ char **contents;
|
|
242 |
+ GdkDisplay *gdk_dpy = gdk_display_get_default ();
|
|
243 |
+ Display *x_dpy = GDK_DISPLAY_XDISPLAY (gdk_dpy);
|
|
244 |
+
|
|
245 |
+ root_win = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
|
|
246 |
+
|
|
247 |
+ utf8_string = XInternAtom (x_dpy, "UTF8_STRING", FALSE);
|
|
248 |
+ dwid = nautilus_tsol_get_active_desktop_id ();
|
|
249 |
+ atom = XInternAtom (x_dpy, "NAUTILUS_ACTIVE_DESKTOP_ID", FALSE);
|
|
250 |
+
|
|
251 |
+ if (XGetWindowProperty (x_dpy, root_win, atom, 0L, (long)1024, False,
|
|
252 |
+ utf8_string, &type, &format, &nitems,
|
|
253 |
+ &bytesafter, (unsigned char **)&prop_data)
|
|
254 |
+ != Success) {
|
|
255 |
+ return FALSE;
|
|
256 |
+ }
|
|
257 |
+
|
|
258 |
+ if (type != utf8_string || format != 8 || nitems == 0) {
|
|
259 |
+ if (prop_data) {
|
|
260 |
+ XFree (prop_data);
|
|
261 |
+ }
|
|
262 |
+ return FALSE;
|
|
263 |
+ }
|
|
264 |
+
|
|
265 |
+ i = 0;
|
|
266 |
+ n_strings = 0;
|
|
267 |
+ while (i < nitems) {
|
|
268 |
+ if (prop_data[i] == '\0') {
|
|
269 |
+ ++n_strings;
|
|
270 |
+ }
|
|
271 |
+ ++i;
|
|
272 |
+ }
|
|
273 |
+
|
|
274 |
+ if (prop_data[nitems -1] != '/0') {
|
|
275 |
+ ++n_strings;
|
|
276 |
+ }
|
|
277 |
+
|
|
278 |
+ contents = g_new0 (char *, n_strings+1);
|
|
279 |
+
|
|
280 |
+ p = prop_data;
|
|
281 |
+ i = 0;
|
|
282 |
+ while (i < n_strings) {
|
|
283 |
+ if (!g_utf8_validate ((const gchar *)p, -1, NULL)) {
|
|
284 |
+ g_warning ("Property contained invalid utf8\n");
|
|
285 |
+ XFree (prop_data);
|
|
286 |
+ g_strfreev (contents);
|
|
287 |
+ return FALSE;
|
|
288 |
+ }
|
|
289 |
+ contents[i] = g_strdup (p);
|
|
290 |
+ p = p + strlen (p) +1;
|
|
291 |
+ ++i;
|
|
292 |
+ }
|
|
293 |
+
|
|
294 |
+ if (prop_data) XFree (prop_data);
|
|
295 |
+
|
|
296 |
+ if (strcmp (contents[0], dwid) == 0) {
|
|
297 |
+ return TRUE;
|
|
298 |
+ } else {
|
|
299 |
+ return FALSE;
|
|
300 |
+ }
|
|
301 |
+}
|
|
302 |
+
|
|
303 |
+GdkFilterReturn
|
|
304 |
+nautilus_tsol_filter_func (GdkXEvent *gdkxevent, GdkEvent *event, gpointer data)
|
|
305 |
+{
|
|
306 |
+ Atom atom;
|
|
307 |
+ XEvent *xevent = gdkxevent;
|
|
308 |
+ GtkWidget *widget = (GtkWidget *)data;
|
|
309 |
+ GdkScreen *screen = gtk_widget_get_screen (widget);
|
|
310 |
+ GdkDisplay *gdk_dpy = gdk_display_get_default ();
|
|
311 |
+ Display *x_dpy = GDK_DISPLAY_XDISPLAY (gdk_dpy);
|
|
312 |
+
|
|
313 |
+ if (xevent->type != PropertyNotify) {
|
|
314 |
+ return GDK_FILTER_CONTINUE;
|
|
315 |
+ }
|
|
316 |
+
|
|
317 |
+ atom = XInternAtom (x_dpy, "NAUTILUS_ACTIVE_DESKTOP_ID", FALSE);
|
|
318 |
+
|
|
319 |
+ if (xevent->xproperty.atom != atom) {
|
|
320 |
+ return GDK_FILTER_CONTINUE;
|
|
321 |
+ }
|
|
322 |
+
|
|
323 |
+ if (nautilus_tsol_show_desktop_window (screen)) {
|
|
324 |
+ gtk_widget_show (widget);
|
|
325 |
+ } else {
|
|
326 |
+ gtk_widget_hide (widget);
|
|
327 |
+ }
|
|
328 |
+
|
|
329 |
+ return GDK_FILTER_CONTINUE;
|
|
330 |
+}
|
|
331 |
+
|
|
332 |
+void
|
|
333 |
+nautilus_tsol_update_paste_location_property (GtkClipboard *cb, char *dir)
|
|
334 |
+{
|
|
335 |
+ GtkWidget *widget = g_object_get_data (gtk_clipboard_get_display (cb),
|
|
336 |
+ "gtk-clipboard-widget");
|
|
337 |
+ Display *x_dpy = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget));
|
|
338 |
+ Atom atom = XInternAtom (x_dpy, "_NAUTILUS_TARGET_DIR", FALSE);
|
|
339 |
+ Atom utf8 = XInternAtom (x_dpy, "UTF8_STRING", FALSE);
|
|
340 |
+ Window win = GDK_WINDOW_XWINDOW (widget->window);
|
|
341 |
+
|
|
342 |
+ XChangeProperty (x_dpy, win, atom, utf8, 8, PropModeReplace, dir,
|
|
343 |
+ strlen (dir));
|
|
344 |
+
|
|
345 |
+ XSync (x_dpy, FALSE);
|
|
346 |
+}
|
|
347 |
diff -urN -x '*.orig' -x '*.rej' naut.orig/libnautilus-private/nautilus-tsol-extensions.h naut.new/libnautilus-private/nautilus-tsol-extensions.h
|
|
348 |
--- naut.orig/libnautilus-private/nautilus-tsol-extensions.h 1970-01-01 01:00:00.000000000 +0100
|
15579
|
349 |
+++ naut.new/libnautilus-private/nautilus-tsol-extensions.h 2009-03-25 15:50:31.164171360 +0000
|
13439
|
350 |
@@ -0,0 +1,20 @@
|
|
351 |
+/*
|
|
352 |
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
|
353 |
+ * Use is subject to license terms.
|
|
354 |
+ */
|
|
355 |
+#ifndef NAUTILUS_TSOL_EXTENSIONS_H
|
|
356 |
+#define NAUTILUS_TSOL_EXTENSIONS_H
|
|
357 |
+#include <config.h>
|
|
358 |
+#include <gdk/gdk.h>
|
|
359 |
+#include <gtk/gtkclipboard.h>
|
|
360 |
+#include <glib/glist.h>
|
|
361 |
+
|
|
362 |
+gboolean nautilus_tsol_multi_label_session (void);
|
|
363 |
+gboolean nautilus_tsol_show_desktop_window (GdkScreen *screen);
|
|
364 |
+gboolean nautilus_tsol_label_equal_to_process_label (char *label);
|
|
365 |
+GdkFilterReturn nautilus_tsol_filter_func (GdkXEvent *gdkxevent, GdkEvent *event, gpointer data);
|
|
366 |
+char *nautilus_tsol_get_file_label (const char *filename);
|
|
367 |
+char *nautilus_tsol_get_process_label ();
|
|
368 |
+void nautilus_tsol_update_paste_location_property (GtkClipboard *cb, char *dir);
|
|
369 |
+
|
|
370 |
+#endif
|
|
371 |
diff -urN -x '*.orig' -x '*.rej' naut.orig/src/file-manager/fm-directory-view.c naut.new/src/file-manager/fm-directory-view.c
|
15579
|
372 |
--- naut.orig/src/file-manager/fm-directory-view.c 2009-03-25 15:48:56.555869222 +0000
|
|
373 |
+++ naut.new/src/file-manager/fm-directory-view.c 2009-03-25 15:50:31.168489932 +0000
|
|
374 |
@@ -79,6 +79,7 @@
|
13439
|
375 |
#include <libnautilus-private/nautilus-trash-monitor.h>
|
|
376 |
#include <libnautilus-private/nautilus-ui-utilities.h>
|
|
377 |
#include <libnautilus-private/nautilus-signaller.h>
|
|
378 |
+#include <libnautilus-private/nautilus-tsol-extensions.h>
|
|
379 |
#include <libnautilus-private/nautilus-autorun.h>
|
|
380 |
#include <libnautilus-private/nautilus-icon-names.h>
|
|
381 |
|
15579
|
382 |
@@ -5566,7 +5567,7 @@
|
13439
|
383 |
gsize *len)
|
|
384 |
{
|
|
385 |
GString *uris;
|
|
386 |
- char *uri, *tmp;
|
|
387 |
+ char *uri, *tmp, *label;
|
|
388 |
GFile *f;
|
|
389 |
guint i;
|
|
390 |
|
15579
|
391 |
@@ -5574,6 +5575,12 @@
|
13439
|
392 |
uris = g_string_new (NULL);
|
|
393 |
} else {
|
|
394 |
uris = g_string_new (info->cut ? "cut" : "copy");
|
|
395 |
+ if (nautilus_tsol_multi_label_session ()) {
|
|
396 |
+ label = nautilus_tsol_get_process_label ();
|
|
397 |
+ g_string_append_c (uris, '\n');
|
|
398 |
+ g_string_append (uris, label);
|
|
399 |
+ g_free (label);
|
|
400 |
+ }
|
|
401 |
}
|
|
402 |
|
|
403 |
for (i = 0; i < info->n_file_uris; ++i) {
|
15579
|
404 |
@@ -5763,6 +5770,7 @@
|
13439
|
405 |
{
|
|
406 |
gboolean cut;
|
|
407 |
GList *item_uris;
|
|
408 |
+ char *label = NULL;
|
|
409 |
|
|
410 |
cut = FALSE;
|
|
411 |
item_uris = nautilus_clipboard_get_uri_list_from_selection_data (selection_data, &cut,
|
15579
|
412 |
@@ -5772,10 +5780,12 @@
|
13439
|
413 |
nautilus_window_slot_info_set_status (view->details->slot,
|
|
414 |
_("There is nothing on the clipboard to paste."));
|
|
415 |
} else {
|
|
416 |
- fm_directory_view_move_copy_items (item_uris, NULL, destination_uri,
|
|
417 |
+ if (!label || nautilus_tsol_label_equal_to_process_label (label)){
|
|
418 |
+ fm_directory_view_move_copy_items (item_uris, NULL, destination_uri,
|
|
419 |
cut ? GDK_ACTION_MOVE : GDK_ACTION_COPY,
|
|
420 |
0, 0,
|
|
421 |
view);
|
|
422 |
+ }
|
|
423 |
|
|
424 |
/* If items are cut then remove from clipboard */
|
|
425 |
if (cut) {
|
15579
|
426 |
diff -urN -x '*.orig' -x '*.rej' naut.orig/src/file-manager/fm-properties-window.c naut.new/src/file-manager/fm-properties-window.c
|
|
427 |
--- naut.orig/src/file-manager/fm-properties-window.c 2009-03-25 15:48:56.554763663 +0000
|
|
428 |
+++ naut.new/src/file-manager/fm-properties-window.c 2009-03-25 15:50:31.171186528 +0000
|
|
429 |
@@ -4784,7 +4786,9 @@
|
13439
|
430 |
{
|
|
431 |
GtkWidget *vbox, *button, *hbox;
|
|
432 |
GtkTable *page_table;
|
|
433 |
+ GtkLabel *label_label;
|
|
434 |
char *file_name, *prompt_text;
|
|
435 |
+ char *label_str, *uri;
|
|
436 |
GList *file_list;
|
|
437 |
guint last_row;
|
|
438 |
|
15579
|
439 |
@@ -4830,6 +4834,17 @@
|
13439
|
440 |
"selinux_context", INCONSISTENT_STATE_STRING,
|
|
441 |
FALSE);
|
|
442 |
#endif
|
|
443 |
+ if (nautilus_tsol_multi_label_session ()) {
|
|
444 |
+ last_row = append_title_field (page_table,
|
14930
|
445 |
+ /* SUN_BRANDING TJDS */
|
13439
|
446 |
+ _("File Label:"), &label_label);
|
|
447 |
+ uri = nautilus_file_get_uri (get_target_file (window));
|
|
448 |
+ label_str = nautilus_tsol_get_file_label (uri);
|
|
449 |
+ attach_value_label (page_table, last_row, VALUE_COLUMN,
|
|
450 |
+ label_str);
|
|
451 |
+ g_free (label_str);
|
|
452 |
+ }
|
|
453 |
+
|
|
454 |
append_title_value_pair
|
|
455 |
(window, page_table, _("Last changed:"),
|
|
456 |
"date_permissions", INCONSISTENT_STATE_STRING,
|
15579
|
457 |
diff -urN -x '*.orig' -x '*.rej' naut.orig/src/nautilus-application.c naut.new/src/nautilus-application.c
|
|
458 |
--- naut.orig/src/nautilus-application.c 2009-03-25 15:48:56.565159696 +0000
|
|
459 |
+++ naut.new/src/nautilus-application.c 2009-03-25 15:50:31.172417300 +0000
|
|
460 |
@@ -897,12 +900,12 @@
|
13439
|
461 |
static GtkWidget *
|
|
462 |
get_desktop_manager_selection (GdkDisplay *display, int screen)
|
|
463 |
{
|
|
464 |
- char selection_name[32];
|
|
465 |
+ char selection_name[52];
|
|
466 |
GdkAtom selection_atom;
|
|
467 |
Window selection_owner;
|
|
468 |
GtkWidget *selection_widget;
|
|
469 |
|
|
470 |
- g_snprintf (selection_name, sizeof (selection_name), "_NET_DESKTOP_MANAGER_S%d", screen);
|
|
471 |
+ g_snprintf (selection_name, sizeof (selection_name), "_NET_DESKTOP_MANAGER_S%d_%d_%d", screen, getuid(), getzoneid());
|
|
472 |
selection_atom = gdk_atom_intern (selection_name, FALSE);
|
|
473 |
|
|
474 |
selection_owner = XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display),
|
15579
|
475 |
diff -urN -x '*.orig' -x '*.rej' naut.orig/src/nautilus-desktop-window.c naut.new/src/nautilus-desktop-window.c
|
|
476 |
--- naut.orig/src/nautilus-desktop-window.c 2009-03-25 15:48:56.559673968 +0000
|
|
477 |
+++ naut.new/src/nautilus-desktop-window.c 2009-03-25 15:50:31.172816870 +0000
|
13439
|
478 |
@@ -36,6 +36,10 @@
|
|
479 |
#include <libnautilus-private/nautilus-icon-names.h>
|
|
480 |
#include <gio/gio.h>
|
14836
|
481 |
#include <glib/gi18n.h>
|
13439
|
482 |
+#include <libnautilus-private/nautilus-tsol-extensions.h>
|
|
483 |
+
|
|
484 |
+#include <strings.h>
|
|
485 |
+#include <zone.h>
|
|
486 |
|
|
487 |
struct NautilusDesktopWindowDetails {
|
|
488 |
int dummy;
|
|
489 |
@@ -112,6 +116,7 @@
|
|
490 |
nautilus_desktop_window_new (NautilusApplication *application,
|
|
491 |
GdkScreen *screen)
|
|
492 |
{
|
|
493 |
+ GdkWindow *root_window;
|
|
494 |
NautilusDesktopWindow *window;
|
|
495 |
int width_request, height_request;
|
|
496 |
|
|
497 |
@@ -131,6 +136,12 @@
|
|
498 |
|
|
499 |
g_signal_connect (window, "delete_event", G_CALLBACK (nautilus_desktop_window_delete_event), NULL);
|
|
500 |
|
|
501 |
+ if (nautilus_tsol_multi_label_session ()) {
|
|
502 |
+ root_window = gdk_screen_get_root_window (screen);
|
|
503 |
+ gdk_window_add_filter (root_window, nautilus_tsol_filter_func,
|
|
504 |
+ window);
|
|
505 |
+ }
|
|
506 |
+
|
|
507 |
/* Point window at the desktop folder.
|
|
508 |
* Note that nautilus_desktop_window_init is too early to do this.
|
|
509 |
*/
|
|
510 |
diff -urN -x '*.orig' -x '*.rej' naut.orig/src/nautilus-window-manage-views.c naut.new/src/nautilus-window-manage-views.c
|
15579
|
511 |
--- naut.orig/src/nautilus-window-manage-views.c 2009-03-25 15:48:56.570198528 +0000
|
|
512 |
+++ naut.new/src/nautilus-window-manage-views.c 2009-03-25 15:50:31.173977404 +0000
|
|
513 |
@@ -66,6 +66,7 @@
|
13439
|
514 |
#include <libnautilus-private/nautilus-window-info.h>
|
|
515 |
#include <libnautilus-private/nautilus-window-slot-info.h>
|
|
516 |
#include <libnautilus-private/nautilus-autorun.h>
|
|
517 |
+#include <libnautilus-private/nautilus-tsol-extensions.h>
|
|
518 |
|
|
519 |
/* FIXME bugzilla.gnome.org 41243:
|
|
520 |
* We should use inheritance instead of these special cases
|
15579
|
521 |
@@ -1405,6 +1406,12 @@
|
13439
|
522 |
|
|
523 |
g_object_unref (location_copy);
|
|
524 |
}
|
|
525 |
+
|
|
526 |
+ if (nautilus_tsol_multi_label_session () &&
|
|
527 |
+ NAUTILUS_IS_DESKTOP_WINDOW (window) &&
|
|
528 |
+ !nautilus_tsol_show_desktop_window (gtk_widget_get_screen (GTK_WIDGET (window)))) {
|
|
529 |
+ gtk_widget_hide (GTK_WIDGET (window));
|
|
530 |
+ }
|
|
531 |
}
|
|
532 |
|
|
533 |
static void
|
15621
|
534 |
--- nautilus-2.26.2/libnautilus-private/nautilus-column-utilities.c.ori 2009-04-15 06:40:35.671068662 +0100
|
|
535 |
+++ nautilus-2.26.2/libnautilus-private/nautilus-column-utilities.c 2009-04-15 06:42:17.453055378 +0100
|
|
536 |
@@ -113,6 +113,7 @@
|
|
537 |
"label", _("MIME Type"),
|
|
538 |
"description", _("The mime type of the file."),
|
|
539 |
NULL));
|
|
540 |
+#ifdef HAVE_SELINUX
|
|
541 |
columns = g_list_append (columns,
|
|
542 |
g_object_new (NAUTILUS_TYPE_COLUMN,
|
|
543 |
"name", "selinux_context",
|
|
544 |
@@ -120,6 +121,7 @@
|
|
545 |
"label", _("SELinux Context"),
|
|
546 |
"description", _("The SELinux security context of the file."),
|
|
547 |
NULL));
|
|
548 |
+#endif
|
|
549 |
columns = g_list_append (columns,
|
|
550 |
g_object_new (NAUTILUS_TYPE_COLUMN,
|
|
551 |
"name", "where",
|
16101
|
552 |
diff -ruN nautilus-2.27.4.orig/src/file-manager/fm-properties-window.c nautilus-2.27.4/src/file-manager/fm-properties-window.c
|
|
553 |
--- nautilus-2.27.4.orig/src/file-manager/fm-properties-window.c 2009-07-23 15:50:33.904002666 +0100
|
|
554 |
+++ nautilus-2.27.4/src/file-manager/fm-properties-window.c 2009-07-23 15:51:09.501841762 +0100
|
|
555 |
@@ -61,6 +61,7 @@
|
|
556 |
#include <string.h>
|
|
557 |
#include <sys/stat.h>
|
|
558 |
#include <cairo.h>
|
|
559 |
+#include <libnautilus-private/nautilus-tsol-extensions.h>
|
|
560 |
|
|
561 |
#if HAVE_SYS_VFS_H
|
|
562 |
#include <sys/vfs.h>
|
17505
|
563 |
diff -ruN nautilus-2.29.2.orig/src/file-manager/fm-directory-view.c nautilus-2.29.2/src/file-manager/fm-directory-view.c
|
|
564 |
--- nautilus-2.29.2.orig/src/file-manager/fm-directory-view.c 2010-02-01 23:04:48.447298960 +0000
|
|
565 |
+++ nautilus-2.29.2/src/file-manager/fm-directory-view.c 2010-02-01 23:06:16.476314358 +0000
|
|
566 |
@@ -6139,7 +6139,11 @@
|
|
567 |
FMDirectoryView *view;
|
|
568 |
|
|
569 |
view = FM_DIRECTORY_VIEW (callback_data);
|
|
570 |
-
|
|
571 |
+ if (nautilus_tsol_multi_label_session ()) {
|
|
572 |
+ char *target_dir = fm_directory_view_get_backing_uri (view);
|
|
573 |
+ nautilus_tsol_update_paste_location_property (nautilus_clipboard_get (view), target_dir);
|
|
574 |
+ g_free (target_dir);
|
|
575 |
+ }
|
|
576 |
g_object_ref (view);
|
|
577 |
gtk_clipboard_request_contents (nautilus_clipboard_get (GTK_WIDGET (view)),
|
|
578 |
copied_files_atom,
|
|
579 |
diff -ruN nautilus-2.29.2.orig/src/nautilus-application.c nautilus-2.29.2/src/nautilus-application.c
|
|
580 |
--- nautilus-2.29.2.orig/src/nautilus-application.c 2010-02-01 23:04:48.455841660 +0000
|
|
581 |
+++ nautilus-2.29.2/src/nautilus-application.c 2010-02-01 23:07:28.282513703 +0000
|
|
582 |
@@ -76,6 +76,8 @@
|
|
583 |
#include <libnautilus-private/nautilus-signaller.h>
|
|
584 |
#include <libnautilus-extension/nautilus-menu-provider.h>
|
|
585 |
#include <libnautilus-private/nautilus-autorun.h>
|
|
586 |
+#include <zone.h>
|
|
587 |
+#include <unistd.h>
|
|
588 |
|
|
589 |
enum
|
|
590 |
{
|