diff --git a/.cvsignore b/.cvsignore index d77201f..b12f150 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -nautilus-2.23.4.tar.bz2 +nautilus-2.23.5.tar.bz2 diff --git a/nautilus-2.21.1-dynamic-search.patch b/nautilus-2.21.1-dynamic-search.patch deleted file mode 100644 index 87d8ab7..0000000 --- a/nautilus-2.21.1-dynamic-search.patch +++ /dev/null @@ -1,324 +0,0 @@ -diff -up nautilus-2.21.1/configure.in.dynamic-search nautilus-2.21.1/configure.in ---- nautilus-2.21.1/configure.in.dynamic-search 2007-12-20 10:33:26.000000000 -0500 -+++ nautilus-2.21.1/configure.in 2007-12-21 22:45:20.000000000 -0500 -@@ -271,42 +271,12 @@ dnl ==================================== - dnl search implementations - dnl **************************** - --AM_CONDITIONAL(HAVE_TRACKER, false) -+# We hardcode beagle and tracker use and then load it dynamically -+AM_CONDITIONAL(HAVE_TRACKER, true) -+AC_DEFINE(HAVE_TRACKER, 1, [Define to enable tracker support]) - --dnl libtracker checking -- --AC_ARG_ENABLE(tracker, [ --disable-tracker build without tracker support]) --msg_tracker=no --if test "x$enable_tracker" != "xno"; then -- PKG_CHECK_MODULES(TRACKER, tracker >= tracker_minver, [ -- AM_CONDITIONAL(HAVE_TRACKER, true) -- AC_DEFINE(HAVE_TRACKER, 1, [Define to enable tracker support]) -- ] -- msg_tracker=yes, -- [AM_CONDITIONAL(HAVE_TRACKER, false)]) -- AC_SUBST(TRACKER_CFLAGS) -- AC_SUBST(TRACKER_LIBS) --fi -- --dnl ========================================================================== -- -- --AM_CONDITIONAL(HAVE_BEAGLE, false) -- --dnl libbeagle checking -- --AC_ARG_ENABLE(beagle, [ --disable-beagle build without beagle support]) --msg_beagle=no --if test "x$enable_beagle" != "xno"; then -- PKG_CHECK_MODULES(BEAGLE, libbeagle-0.0 >= beagle_minver, [ -- AM_CONDITIONAL(HAVE_BEAGLE, true) -- AC_DEFINE(HAVE_BEAGLE, 1, [Define to enable beagle support]) -- ] -- msg_beagle=yes, -- [AM_CONDITIONAL(HAVE_BEAGLE, false)]) -- AC_SUBST(BEAGLE_CFLAGS) -- AC_SUBST(BEAGLE_LIBS) --fi -+AM_CONDITIONAL(HAVE_BEAGLE, true) -+AC_DEFINE(HAVE_BEAGLE, 1, [Define to enable beagle support]) - - dnl ========================================================================== - -diff -up nautilus-2.21.1/libnautilus-private/nautilus-search-engine-beagle.c.dynamic-search nautilus-2.21.1/libnautilus-private/nautilus-search-engine-beagle.c ---- nautilus-2.21.1/libnautilus-private/nautilus-search-engine-beagle.c.dynamic-search 2007-12-14 04:36:31.000000000 -0500 -+++ nautilus-2.21.1/libnautilus-private/nautilus-search-engine-beagle.c 2007-12-21 22:45:20.000000000 -0500 -@@ -23,10 +23,20 @@ - - #include - #include "nautilus-search-engine-beagle.h" --#include - - #include - #include -+#include -+ -+typedef struct _BeagleHit BeagleHit; -+typedef struct _BeagleQuery BeagleQuery; -+typedef struct _BeagleClient BeagleClient; -+typedef struct _BeagleRequest BeagleRequest; -+typedef struct _BeagleFinishedResponse BeagleFinishedResponse; -+typedef struct _BeagleHitsAddedResponse BeagleHitsAddedResponse; -+typedef struct _BeagleQueryPartProperty BeagleQueryPartProperty; -+typedef struct _BeagleQueryPart BeagleQueryPart; -+typedef struct _BeagleHitsSubtractedResponse BeagleHitsSubtractedResponse; - - struct NautilusSearchEngineBeagleDetails { - BeagleClient *client; -@@ -37,6 +47,127 @@ struct NautilusSearchEngineBeagleDetails - gboolean query_finished; - }; - -+/* We dlopen() all the following from libbeagle at runtime */ -+#define BEAGLE_HIT(x) ((BeagleHit *)(x)) -+#define BEAGLE_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), beagle_request_get_type(), BeagleRequest)) -+#define BEAGLE_QUERY_PART(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), beagle_query_part_get_type(), BeagleQueryPart)) -+ -+typedef enum { -+ BEAGLE_QUERY_PART_LOGIC_REQUIRED = 1, -+ BEAGLE_QUERY_PART_LOGIC_PROHIBITED = 2 -+} BeagleQueryPartLogic; -+ -+typedef enum { -+ BEAGLE_PROPERTY_TYPE_UNKNOWN = 0, -+ BEAGLE_PROPERTY_TYPE_TEXT = 1, -+ BEAGLE_PROPERTY_TYPE_KEYWORD = 2, -+ BEAGLE_PROPERTY_TYPE_DATE = 3, -+ BEAGLE_PROPERTY_TYPE_LAST = 4 -+} BeaglePropertyType; -+ -+/* *static* wrapper function pointers */ -+static gboolean (*beagle_client_send_request_async) (BeagleClient *client, -+ BeagleRequest *request, -+ GError **err) = NULL; -+static G_CONST_RETURN char *(*beagle_hit_get_uri) (BeagleHit *hit) = NULL; -+static GSList *(*beagle_hits_added_response_get_hits) (BeagleHitsAddedResponse *response) = NULL; -+static BeagleQuery *(*beagle_query_new) (void) = NULL; -+static void (*beagle_query_add_text) (BeagleQuery *query, -+ const char *str) = NULL; -+static void (*beagle_query_add_hit_type) (BeagleQuery *query, -+ const char *hit_type) = NULL; -+static BeagleQueryPartProperty *(*beagle_query_part_property_new) (void) = NULL; -+static void (*beagle_query_part_set_logic) (BeagleQueryPart *part, -+ BeagleQueryPartLogic logic) = NULL; -+static void (*beagle_query_part_property_set_key) (BeagleQueryPartProperty *part, -+ const char *key) = NULL; -+static void (*beagle_query_part_property_set_value) (BeagleQueryPartProperty *part, -+ const char * value) = NULL; -+static void (*beagle_query_part_property_set_property_type) (BeagleQueryPartProperty *part, -+ BeaglePropertyType prop_type) = NULL; -+static void (*beagle_query_add_part) (BeagleQuery *query, -+ BeagleQueryPart *part) = NULL; -+static GType (*beagle_request_get_type) (void) = NULL; -+static GType (*beagle_query_part_get_type) (void) = NULL; -+static gboolean (*beagle_util_daemon_is_running) (void) = NULL; -+static BeagleClient *(*beagle_client_new_real) (const char *client_name) = NULL; -+static void (*beagle_query_set_max_hits) (BeagleQuery *query, -+ int max_hits) = NULL; -+static void (*beagle_query_add_mime_type) (BeagleQuery *query, -+ const char *mime_type) = NULL; -+static GSList *(*beagle_hits_subtracted_response_get_uris) (BeagleHitsSubtractedResponse *response) = NULL; -+ -+static struct BeagleDlMapping -+{ -+ const char *fn_name; -+ gpointer *fn_ptr_ref; -+} beagle_dl_mapping[] = -+{ -+#define MAP(a) { #a, (gpointer *)&a } -+ MAP (beagle_client_send_request_async), -+ MAP (beagle_hit_get_uri), -+ MAP (beagle_hits_added_response_get_hits), -+ MAP (beagle_query_new), -+ MAP (beagle_query_add_text), -+ MAP (beagle_query_add_hit_type), -+ MAP (beagle_query_part_property_new), -+ MAP (beagle_query_part_set_logic), -+ MAP (beagle_query_part_property_set_key), -+ MAP (beagle_query_part_property_set_value), -+ MAP (beagle_query_part_property_set_property_type), -+ MAP (beagle_query_add_part), -+ MAP (beagle_request_get_type), -+ MAP (beagle_query_part_get_type), -+ MAP (beagle_util_daemon_is_running), -+ MAP (beagle_query_set_max_hits), -+ MAP (beagle_query_add_mime_type), -+ MAP (beagle_hits_subtracted_response_get_uris), -+#undef MAP -+ { "beagle_client_new", (gpointer *)&beagle_client_new_real }, -+}; -+ -+static void -+open_libbeagle (void) -+{ -+ static gboolean done = FALSE; -+ -+ if (!done) -+ { -+ int i; -+ GModule *beagle; -+ -+ done = TRUE; -+ -+ beagle = g_module_open ("libbeagle.so.0", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); -+ if (!beagle) -+ return; -+ -+ for (i = 0; i < G_N_ELEMENTS (beagle_dl_mapping); i++) -+ { -+ if (!g_module_symbol (beagle, beagle_dl_mapping[i].fn_name, -+ beagle_dl_mapping[i].fn_ptr_ref)) -+ { -+ g_warning ("Missing symbol '%s' in libbeagle\n", -+ beagle_dl_mapping[i].fn_name); -+ g_module_close (beagle); -+ -+ for (i = 0; i < G_N_ELEMENTS (beagle_dl_mapping); i++) -+ beagle_dl_mapping[i].fn_ptr_ref = NULL; -+ -+ return; -+ } -+ } -+ } -+} -+ -+static BeagleClient * -+beagle_client_new (const char *client_name) -+{ -+ if (beagle_client_new_real) -+ return beagle_client_new_real (client_name); -+ -+ return NULL; -+} - - static void nautilus_search_engine_beagle_class_init (NautilusSearchEngineBeagleClass *class); - static void nautilus_search_engine_beagle_init (NautilusSearchEngineBeagle *engine); -@@ -276,8 +407,11 @@ nautilus_search_engine_beagle_new (void) - { - NautilusSearchEngineBeagle *engine; - BeagleClient *client; -+ -+ open_libbeagle (); - -- if (!beagle_util_daemon_is_running ()) { -+ if (beagle_util_daemon_is_running == NULL || -+ !beagle_util_daemon_is_running ()) { - /* check whether daemon is running as beagle_client_new - * doesn't fail when a stale socket file exists */ - return NULL; -diff -up nautilus-2.21.1/libnautilus-private/nautilus-search-engine-tracker.c.dynamic-search nautilus-2.21.1/libnautilus-private/nautilus-search-engine-tracker.c ---- nautilus-2.21.1/libnautilus-private/nautilus-search-engine-tracker.c.dynamic-search 2007-12-14 04:36:31.000000000 -0500 -+++ nautilus-2.21.1/libnautilus-private/nautilus-search-engine-tracker.c 2007-12-21 22:55:17.000000000 -0500 -@@ -23,11 +23,89 @@ - - #include - #include "nautilus-search-engine-tracker.h" --#include -+#include - #include - #include - -+typedef struct _TrackerClient TrackerClient; -+ -+typedef void (*TrackerArrayReply) (char **result, GError *error, gpointer user_data); -+ -+static TrackerClient * (*tracker_connect) (gboolean enable_warnings) = NULL; -+static void (*tracker_disconnect) (TrackerClient *client) = NULL; -+static void (*tracker_cancel_last_call) (TrackerClient *client) = NULL; -+ -+static void (*tracker_search_metadata_by_text_async) (TrackerClient *client, -+ const char *query, -+ TrackerArrayReply callback, -+ gpointer user_data) = NULL; -+static void (*tracker_search_metadata_by_text_and_mime_async) (TrackerClient *client, -+ const char *query, -+ const char **mimes, -+ TrackerArrayReply callback, -+ gpointer user_data) = NULL; -+static void (*tracker_search_metadata_by_text_and_location_async) (TrackerClient *client, -+ const char *query, -+ const char *location, -+ TrackerArrayReply callback, -+ gpointer user_data) = NULL; -+static void (*tracker_search_metadata_by_text_and_mime_and_location_async) (TrackerClient *client, -+ const char *query, -+ const char **mimes, -+ const char *location, -+ TrackerArrayReply callback, -+ gpointer user_data) = NULL; -+ -+static struct TrackerDlMapping -+{ -+ const char *fn_name; -+ gpointer *fn_ptr_ref; -+} tracker_dl_mapping[] = -+{ -+#define MAP(a) { #a, (gpointer *)&a } -+ MAP (tracker_connect), -+ MAP (tracker_disconnect), -+ MAP (tracker_cancel_last_call), -+ MAP (tracker_search_metadata_by_text_async), -+ MAP (tracker_search_metadata_by_text_and_mime_async), -+ MAP (tracker_search_metadata_by_text_and_location_async), -+ MAP (tracker_search_metadata_by_text_and_mime_and_location_async) -+#undef MAP -+}; -+ -+static void -+open_libtracker (void) -+{ -+ static gboolean done = FALSE; - -+ if (!done) -+ { -+ int i; -+ GModule *tracker; -+ -+ done = TRUE; -+ -+ tracker = g_module_open ("libtrackerclient.so.0", G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); -+ if (!tracker) -+ return; -+ -+ for (i = 0; i < G_N_ELEMENTS (tracker_dl_mapping); i++) -+ { -+ if (!g_module_symbol (tracker, tracker_dl_mapping[i].fn_name, -+ tracker_dl_mapping[i].fn_ptr_ref)) -+ { -+ g_warning ("Missing symbol '%s' in libtracker\n", -+ tracker_dl_mapping[i].fn_name); -+ g_module_close (tracker); -+ -+ for (i = 0; i < G_N_ELEMENTS (tracker_dl_mapping); i++) -+ tracker_dl_mapping[i].fn_ptr_ref = NULL; -+ -+ return; -+ } -+ } -+ } -+} - - struct NautilusSearchEngineTrackerDetails { - NautilusQuery *query; -@@ -259,6 +337,12 @@ nautilus_search_engine_tracker_new (void - NautilusSearchEngineTracker *engine; - TrackerClient *tracker_client; - -+ open_libtracker (); -+ -+ if (!tracker_connect) { -+ return NULL; -+ } -+ - tracker_client = tracker_connect (FALSE); - - if (!tracker_client) { diff --git a/nautilus-2.22.0-mime-application-x-ext.patch b/nautilus-2.22.0-mime-application-x-ext.patch deleted file mode 100644 index 4835425..0000000 --- a/nautilus-2.22.0-mime-application-x-ext.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- trunk/libnautilus-private/nautilus-mime-application-chooser.c 2008/02/20 15:11:17 13784 -+++ trunk/libnautilus-private/nautilus-mime-application-chooser.c 2008/03/13 15:11:05 13931 -@@ -599,9 +599,9 @@ - const char *extension, - const char *mime_type) - { -- chooser->details->extension = g_strdup (extension); - if (extension != NULL && - g_content_type_is_unknown (mime_type)) { -+ chooser->details->extension = g_strdup (extension); - chooser->details->content_type = g_strdup_printf ("application/x-extension-%s", extension); - /* the %s here is a file extension */ - chooser->details->type_description = diff --git a/nautilus-2.22.1-dynamic-search.patch b/nautilus-2.23.5-dynamic-search.patch similarity index 90% rename from nautilus-2.22.1-dynamic-search.patch rename to nautilus-2.23.5-dynamic-search.patch index abf7996..f3db9d5 100644 --- a/nautilus-2.22.1-dynamic-search.patch +++ b/nautilus-2.23.5-dynamic-search.patch @@ -1,7 +1,7 @@ -diff -up nautilus-2.22.1/configure.in.dynamic-search nautilus-2.22.1/configure.in ---- nautilus-2.22.1/configure.in.dynamic-search 2008-03-14 07:58:02.000000000 -0400 -+++ nautilus-2.22.1/configure.in 2008-04-04 23:59:12.000000000 -0400 -@@ -269,49 +269,18 @@ dnl ==================================== +diff -up nautilus-2.23.5/configure.in.dynamic-search nautilus-2.23.5/configure.in +--- nautilus-2.23.5/configure.in.dynamic-search 2008-07-21 11:27:29.000000000 -0400 ++++ nautilus-2.23.5/configure.in 2008-07-22 00:43:14.000000000 -0400 +@@ -280,53 +280,18 @@ dnl ==================================== dnl search implementations dnl **************************** @@ -9,7 +9,9 @@ diff -up nautilus-2.22.1/configure.in.dynamic-search nautilus-2.22.1/configure.i - -dnl libtracker checking - --AC_ARG_ENABLE(tracker, [ --disable-tracker build without tracker support]) +-AC_ARG_ENABLE(tracker, +- AC_HELP_STRING([--disable-tracker], +- [build without tracker support])) -msg_tracker=no -if test "x$enable_tracker" != "xno"; then - PKG_CHECK_MODULES(TRACKER, tracker >= tracker_minver, [ @@ -28,8 +30,10 @@ diff -up nautilus-2.22.1/configure.in.dynamic-search nautilus-2.22.1/configure.i -AM_CONDITIONAL(HAVE_BEAGLE, false) - -dnl libbeagle checking -- --AC_ARG_ENABLE(beagle, [ --disable-beagle build without beagle support]) +- +-AC_ARG_ENABLE(beagle, +- AC_HELP_STRING([--disable-beagle], +- [build without beagle support])) -msg_beagle=no -if test "x$enable_beagle" != "xno"; then - BEAGLE_PKGCONFIG= @@ -54,7 +58,7 @@ diff -up nautilus-2.22.1/configure.in.dynamic-search nautilus-2.22.1/configure.i +TRACKER_CFLAGS= +AC_SUBST(TRACKER_CFLAGS) +msg_tracker=yes -+ ++ +AM_CONDITIONAL(HAVE_BEAGLE, true) +AC_DEFINE(HAVE_BEAGLE, 1, [Define to enable beagle support]) +BEAGLE_CFLAGS= @@ -63,9 +67,9 @@ diff -up nautilus-2.22.1/configure.in.dynamic-search nautilus-2.22.1/configure.i dnl ========================================================================== -diff -up nautilus-2.22.1/libnautilus-private/nautilus-search-engine-beagle.c.dynamic-search nautilus-2.22.1/libnautilus-private/nautilus-search-engine-beagle.c ---- nautilus-2.22.1/libnautilus-private/nautilus-search-engine-beagle.c.dynamic-search 2007-12-14 04:36:31.000000000 -0500 -+++ nautilus-2.22.1/libnautilus-private/nautilus-search-engine-beagle.c 2008-04-04 23:59:12.000000000 -0400 +diff -up nautilus-2.23.5/libnautilus-private/nautilus-search-engine-beagle.c.dynamic-search nautilus-2.23.5/libnautilus-private/nautilus-search-engine-beagle.c +--- nautilus-2.23.5/libnautilus-private/nautilus-search-engine-beagle.c.dynamic-search 2008-06-30 12:02:43.000000000 -0400 ++++ nautilus-2.23.5/libnautilus-private/nautilus-search-engine-beagle.c 2008-07-22 00:41:24.000000000 -0400 @@ -23,10 +23,20 @@ #include @@ -223,9 +227,9 @@ diff -up nautilus-2.22.1/libnautilus-private/nautilus-search-engine-beagle.c.dyn /* check whether daemon is running as beagle_client_new * doesn't fail when a stale socket file exists */ return NULL; -diff -up nautilus-2.22.1/libnautilus-private/nautilus-search-engine-tracker.c.dynamic-search nautilus-2.22.1/libnautilus-private/nautilus-search-engine-tracker.c ---- nautilus-2.22.1/libnautilus-private/nautilus-search-engine-tracker.c.dynamic-search 2008-03-19 11:34:17.000000000 -0400 -+++ nautilus-2.22.1/libnautilus-private/nautilus-search-engine-tracker.c 2008-04-04 23:59:12.000000000 -0400 +diff -up nautilus-2.23.5/libnautilus-private/nautilus-search-engine-tracker.c.dynamic-search nautilus-2.23.5/libnautilus-private/nautilus-search-engine-tracker.c +--- nautilus-2.23.5/libnautilus-private/nautilus-search-engine-tracker.c.dynamic-search 2008-06-30 12:02:26.000000000 -0400 ++++ nautilus-2.23.5/libnautilus-private/nautilus-search-engine-tracker.c 2008-07-22 00:41:24.000000000 -0400 @@ -23,11 +23,92 @@ #include diff --git a/nautilus-2.23.3-selinux.diff b/nautilus-2.23.5-selinux.patch similarity index 87% rename from nautilus-2.23.3-selinux.diff rename to nautilus-2.23.5-selinux.patch index b4dc421..b285d48 100644 --- a/nautilus-2.23.3-selinux.diff +++ b/nautilus-2.23.5-selinux.patch @@ -1,7 +1,422 @@ -Index: src/file-manager/fm-properties-window.c -=================================================================== ---- src/file-manager/fm-properties-window.c (revision 14227) -+++ src/file-manager/fm-properties-window.c (working copy) +diff -up nautilus-2.23.5/libnautilus-extension/nautilus-column.c.selinux nautilus-2.23.5/libnautilus-extension/nautilus-column.c +--- nautilus-2.23.5/libnautilus-extension/nautilus-column.c.selinux 2008-01-30 09:45:57.000000000 -0500 ++++ nautilus-2.23.5/libnautilus-extension/nautilus-column.c 2008-07-22 00:35:23.000000000 -0400 +@@ -34,6 +34,7 @@ enum { + PROP_LABEL, + PROP_DESCRIPTION, + PROP_XALIGN, ++ PROP_ELLIPSIZE, + LAST_PROP + }; + +@@ -43,6 +44,7 @@ struct _NautilusColumnDetails { + char *label; + char *description; + float xalign; ++ gboolean ellipsize; + }; + + static GObjectClass *parent_class = NULL; +@@ -99,6 +101,9 @@ nautilus_column_get_property (GObject *o + case PROP_XALIGN : + g_value_set_float (value, column->details->xalign); + break; ++ case PROP_ELLIPSIZE : ++ g_value_set_boolean (value, column->details->ellipsize); ++ break; + default : + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + break; +@@ -140,6 +145,10 @@ nautilus_column_set_property (GObject *o + column->details->xalign = g_value_get_float (value); + g_object_notify (object, "xalign"); + break; ++ case PROP_ELLIPSIZE : ++ column->details->ellipsize = g_value_get_boolean (value); ++ g_object_notify (object, "ellipsize"); ++ break; + default : + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + break; +@@ -167,6 +176,7 @@ nautilus_column_instance_init (NautilusC + { + column->details = g_new0 (NautilusColumnDetails, 1); + column->details->xalign = 0.0; ++ column->details->ellipsize = FALSE; + } + + static void +@@ -223,6 +233,13 @@ nautilus_column_class_init (NautilusColu + 1.0, + 0.0, + G_PARAM_READWRITE)); ++ g_object_class_install_property (G_OBJECT_CLASS (class), ++ PROP_ELLIPSIZE, ++ g_param_spec_boolean ("ellipsize", ++ "ellipsize", ++ "Ellipsize text in the column if it's too long to display", ++ FALSE, ++ G_PARAM_READWRITE)); + } + + GType +diff -up nautilus-2.23.5/libnautilus-extension/nautilus-column.h.selinux nautilus-2.23.5/libnautilus-extension/nautilus-column.h +--- nautilus-2.23.5/libnautilus-extension/nautilus-column.h.selinux 2006-12-30 18:16:39.000000000 -0500 ++++ nautilus-2.23.5/libnautilus-extension/nautilus-column.h 2008-07-22 00:35:23.000000000 -0400 +@@ -64,6 +64,7 @@ NautilusColumn * nautilus_column_new + * label (string) - the user-visible label for the column + * description (string) - a user-visible description of the column + * xalign (float) - x-alignment of the column ++ * ellipsize (boolean) - ellipsize text in the column? + */ + + G_END_DECLS +diff -up nautilus-2.23.5/libnautilus-private/nautilus-column-utilities.c.selinux nautilus-2.23.5/libnautilus-private/nautilus-column-utilities.c +--- nautilus-2.23.5/libnautilus-private/nautilus-column-utilities.c.selinux 2008-06-30 12:02:26.000000000 -0400 ++++ nautilus-2.23.5/libnautilus-private/nautilus-column-utilities.c 2008-07-22 00:35:23.000000000 -0400 +@@ -119,6 +119,7 @@ get_builtin_columns (void) + "attribute", "selinux_context", + "label", _("SELinux Context"), + "description", _("The SELinux security context of the file."), ++ "ellipsize", TRUE, + NULL)); + + return columns; +diff -up nautilus-2.23.5/libnautilus-private/nautilus-file.c.selinux nautilus-2.23.5/libnautilus-private/nautilus-file.c +--- nautilus-2.23.5/libnautilus-private/nautilus-file.c.selinux 2008-07-21 10:01:22.000000000 -0400 ++++ nautilus-2.23.5/libnautilus-private/nautilus-file.c 2008-07-22 00:35:23.000000000 -0400 +@@ -1647,7 +1647,7 @@ update_info_internal (NautilusFile *file + file->details->is_mountpoint = is_mountpoint; + + has_permissions = g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_UNIX_MODE); +- permissions = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_MODE);; ++ permissions = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_MODE); + if (file->details->has_permissions != has_permissions || + file->details->permissions != permissions) { + changed = TRUE; +@@ -4300,7 +4300,7 @@ nautilus_file_can_get_selinux_context (N + * context + * @file: NautilusFile representing the file in question. + * +- * Returns: Newly allocated string ready to display to the user. ++ * Returns: Newly allocated string ready to display to the user, or NULL. + * + **/ + char * +@@ -4333,6 +4333,114 @@ nautilus_file_get_selinux_context (Nauti + return translated; + } + ++/** ++ * nautilus_file_get_selinux_matchpathcon: ++ * ++ * Get a user-displayable string representing a file's default selinux ++ * context (as from matchpathcon). Only works on local files. ++ * @file: NautilusFile representing the file in question. ++ * ++ * Returns: Newly allocated string ready to display to the user, or NULL. ++ * ++ **/ ++char * ++nautilus_file_get_selinux_matchpathcon (NautilusFile *file) ++{ ++ char *translated; ++#ifdef HAVE_SELINUX ++ char *raw; ++ char *fname; ++ GFile *location; ++#endif ++ ++ g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL); ++ ++ translated = NULL; ++#ifdef HAVE_SELINUX ++ location = nautilus_file_get_location (file); ++ fname = g_file_get_path (location); ++ ++ if (!fname) { ++ return NULL; ++ } ++ ++ raw = NULL; ++ if (matchpathcon (fname, file->details->permissions, &raw) == 0) { ++ if (selinux_raw_to_trans_context (raw, &translated) == 0) { ++ char *tmp; ++ tmp = g_strdup (translated); ++ freecon (translated); ++ translated = tmp; ++ } ++ freecon (raw); ++ } ++ ++ g_free (fname); ++ g_object_unref (location); ++#endif ++ ++ return translated; ++} ++ ++void ++nautilus_file_set_selinux_context (NautilusFile *file, ++ const char *selinux_context, ++ NautilusFileOperationCallback callback, ++ gpointer callback_data) ++{ ++ GFileInfo *info; ++ GError *error; ++ char *rcontext; ++ ++ rcontext = NULL; ++ ++ /* this is probably mostly right... */ ++ if (!nautilus_file_can_set_permissions (file)) { ++ /* Claim that something changed even if the permission change failed. ++ * This makes it easier for some clients who see the "reverting" ++ * to the old permissions as "changing back". ++ */ ++ nautilus_file_changed (file); ++ error = g_error_new (G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, ++ _("Not allowed to set SELinux security context")); ++ (* callback) (file, NULL, error, callback_data); ++ g_error_free (error); ++ return; ++ } ++ ++ /* Test the permissions-haven't-changed case explicitly ++ * because we don't want to send the file-changed signal if ++ * nothing changed. ++ */ ++ if (file->details->selinux_context != NULL && ++ strcmp(selinux_context, file->details->selinux_context) == 0) { ++ (* callback) (file, NULL, NULL, callback_data); ++ return; ++ } ++ ++#ifdef HAVE_SELINUX ++ /* this is really const, but prototype is wrong, *sigh* */ ++ if (selinux_trans_to_raw_context((char *)selinux_context, &rcontext)) { ++ error = g_error_new (G_IO_ERROR, G_IO_ERROR_INVAL, ++ _("Invalid SELinux security context")); ++ (* callback) (file, NULL, error, callback_data); ++ g_error_free (error); ++ return; ++ } ++ selinux_context = rcontext; ++#endif ++ ++ info = g_file_info_new (); ++ g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_SELINUX_CONTEXT, selinux_context); ++ nautilus_file_set_attributes (file, info, callback, callback_data); ++ g_object_unref (info); ++ ++#ifdef HAVE_SELINUX ++ freecon (rcontext); ++#endif ++} ++ ++ + static char * + get_real_name (const char *name, const char *gecos) + { +diff -up nautilus-2.23.5/libnautilus-private/nautilus-file.h.selinux nautilus-2.23.5/libnautilus-private/nautilus-file.h +--- nautilus-2.23.5/libnautilus-private/nautilus-file.h.selinux 2008-07-21 08:29:41.000000000 -0400 ++++ nautilus-2.23.5/libnautilus-private/nautilus-file.h 2008-07-22 00:35:23.000000000 -0400 +@@ -244,6 +244,7 @@ GList * nautilus_get_all + GList * nautilus_file_get_settable_group_names (NautilusFile *file); + gboolean nautilus_file_can_get_selinux_context (NautilusFile *file); + char * nautilus_file_get_selinux_context (NautilusFile *file); ++char * nautilus_file_get_selinux_matchpathcon (NautilusFile *file); + + /* "Capabilities". */ + gboolean nautilus_file_can_read (NautilusFile *file); +@@ -278,6 +279,10 @@ void nautilus_file_se + guint32 permissions, + NautilusFileOperationCallback callback, + gpointer callback_data); ++void nautilus_file_set_selinux_context (NautilusFile *file, ++ const char *selinux_context, ++ NautilusFileOperationCallback callback, ++ gpointer callback_data); + void nautilus_file_rename (NautilusFile *file, + const char *new_name, + NautilusFileOperationCallback callback, +diff -up nautilus-2.23.5/libnautilus-private/nautilus-file-operations.c.selinux nautilus-2.23.5/libnautilus-private/nautilus-file-operations.c +--- nautilus-2.23.5/libnautilus-private/nautilus-file-operations.c.selinux 2008-07-21 11:28:42.000000000 -0400 ++++ nautilus-2.23.5/libnautilus-private/nautilus-file-operations.c 2008-07-22 00:35:23.000000000 -0400 +@@ -64,6 +64,11 @@ + #include "nautilus-trash-monitor.h" + #include "nautilus-file-utilities.h" + ++#ifdef HAVE_SELINUX ++ #include ++#endif ++ ++ + static gboolean confirm_trash_auto_value; + + /* TODO: TESTING!!! */ +@@ -137,6 +142,7 @@ typedef struct { + guint32 file_mask; + guint32 dir_permissions; + guint32 dir_mask; ++ char *context; + } SetPermissionsJob; + + typedef enum { +@@ -4742,6 +4748,10 @@ set_permissions_job_done (gpointer user_ + job->done_callback (job->done_callback_data); + } + ++ if (job->context) { ++ g_free (job->context); ++ } ++ + finalize_common ((CommonJob *)job); + return FALSE; + } +@@ -4797,6 +4807,14 @@ set_permissions_file (SetPermissionsJob + current, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, + common->cancellable, NULL); + } ++ ++#ifdef HAVE_SELINUX ++ if (!job_aborted (common) && (job->context)) { ++ g_file_set_attribute_string (file, G_FILE_ATTRIBUTE_SELINUX_CONTEXT, ++ job->context, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, ++ common->cancellable, NULL); ++ } ++#endif + + if (!job_aborted (common) && + g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) { +@@ -4860,6 +4878,7 @@ nautilus_file_set_permissions_recursive + guint32 file_mask, + guint32 dir_permissions, + guint32 dir_mask, ++ const char *context, + NautilusOpCallback callback, + gpointer callback_data) + { +@@ -4873,7 +4892,24 @@ nautilus_file_set_permissions_recursive + job->dir_mask = dir_mask; + job->done_callback = callback; + job->done_callback_data = callback_data; +- ++ ++ if (context) { ++ char *rcontext; ++ ++ rcontext = job->context = NULL; ++#ifdef HAVE_SELINUX ++ /* this is really const, but prototype is wrong, *sigh* */ ++ if (selinux_trans_to_raw_context((char *)context, &rcontext)) { ++ g_error ("selinux_trans_to_raw_context: failed to allocate bytes"); ++ return; ++ } ++ job->context = g_strdup (rcontext); ++ freecon (rcontext); ++#endif ++ } else { ++ job->context = NULL; ++ } ++ + g_io_scheduler_push_job (set_permissions_job, + job, + NULL, +diff -up nautilus-2.23.5/libnautilus-private/nautilus-file-operations.h.selinux nautilus-2.23.5/libnautilus-private/nautilus-file-operations.h +--- nautilus-2.23.5/libnautilus-private/nautilus-file-operations.h.selinux 2008-07-21 08:27:39.000000000 -0400 ++++ nautilus-2.23.5/libnautilus-private/nautilus-file-operations.h 2008-07-22 00:35:23.000000000 -0400 +@@ -85,6 +85,7 @@ void nautilus_file_set_permissions_recur + guint32 file_mask, + guint32 folder_permissions, + guint32 folder_mask, ++ const char *context, + NautilusOpCallback callback, + gpointer callback_data); + +diff -up nautilus-2.23.5/src/file-manager/fm-error-reporting.c.selinux nautilus-2.23.5/src/file-manager/fm-error-reporting.c +--- nautilus-2.23.5/src/file-manager/fm-error-reporting.c.selinux 2008-06-30 13:07:19.000000000 -0400 ++++ nautilus-2.23.5/src/file-manager/fm-error-reporting.c 2008-07-22 00:35:23.000000000 -0400 +@@ -232,6 +232,31 @@ fm_report_error_setting_permissions (Nau + g_free (message); + } + ++void ++fm_report_error_setting_selinux (NautilusFile *file, ++ GError *error, ++ GtkWindow *parent_window) ++{ ++ char *file_name; ++ char *message; ++ ++ if (error == NULL) { ++ return; ++ } ++ ++ file_name = nautilus_file_get_display_name (file); ++ ++ message = g_strdup_printf (_("Sorry, couldn't change the permissions of \"%s\": %s"), file_name, error->message); ++ ++ /* Silently drop the error when called from selinux entry and is not finished yet */ ++ if (! g_error_matches(error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT)) { ++ eel_show_error_dialog (_("The SELinux security context could not be changed."), message, parent_window); ++ } ++ ++ g_free (file_name); ++ g_free (message); ++} ++ + typedef struct _FMRenameData { + char *name; + NautilusFileOperationCallback callback; +diff -up nautilus-2.23.5/src/file-manager/fm-error-reporting.h.selinux nautilus-2.23.5/src/file-manager/fm-error-reporting.h +--- nautilus-2.23.5/src/file-manager/fm-error-reporting.h.selinux 2008-06-30 13:07:19.000000000 -0400 ++++ nautilus-2.23.5/src/file-manager/fm-error-reporting.h 2008-07-22 00:35:23.000000000 -0400 +@@ -41,8 +41,11 @@ void fm_report_error_setting_permissions + GError *error, + GtkWindow *parent_window); + void fm_report_error_setting_owner (NautilusFile *file, +- GError *error, ++ GError *error, + GtkWindow *parent_window); ++void fm_report_error_setting_selinux (NautilusFile *file, ++ GError *error, ++ GtkWindow *parent_window); + void fm_report_error_setting_group (NautilusFile *file, + GError *error, + GtkWindow *parent_window); +diff -up nautilus-2.23.5/src/file-manager/fm-list-view.c.selinux nautilus-2.23.5/src/file-manager/fm-list-view.c +--- nautilus-2.23.5/src/file-manager/fm-list-view.c.selinux 2008-07-21 05:53:43.000000000 -0400 ++++ nautilus-2.23.5/src/file-manager/fm-list-view.c 2008-07-22 00:35:23.000000000 -0400 +@@ -1378,13 +1378,15 @@ create_and_set_up_tree_view (FMListView + char *name; + char *label; + float xalign; ++ gboolean ellipsize; + + nautilus_column = NAUTILUS_COLUMN (l->data); + + g_object_get (nautilus_column, + "name", &name, + "label", &label, +- "xalign", &xalign, NULL); ++ "xalign", &xalign, ++ "ellipsize", &ellipsize, NULL); + + column_num = fm_list_model_add_column (view->details->model, + nautilus_column); +@@ -1430,6 +1432,8 @@ create_and_set_up_tree_view (FMListView + } else { + cell = gtk_cell_renderer_text_new (); + g_object_set (cell, "xalign", xalign, NULL); ++ if (ellipsize) ++ g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL); + view->details->cells = g_list_append (view->details->cells, + cell); + column = gtk_tree_view_column_new_with_attributes (label, +diff -up nautilus-2.23.5/src/file-manager/fm-properties-window.c.selinux nautilus-2.23.5/src/file-manager/fm-properties-window.c +--- nautilus-2.23.5/src/file-manager/fm-properties-window.c.selinux 2008-07-21 11:28:42.000000000 -0400 ++++ nautilus-2.23.5/src/file-manager/fm-properties-window.c 2008-07-22 00:39:19.000000000 -0400 @@ -83,6 +83,10 @@ #define FREE_FILL_B (0.811764706 * 65535) @@ -13,7 +428,7 @@ Index: src/file-manager/fm-properties-window.c #define PREVIEW_IMAGE_WIDTH 96 #define ROW_PAD 6 -@@ -125,12 +129,15 @@ +@@ -125,12 +129,15 @@ struct FMPropertiesWindowDetails { unsigned int owner_change_timeout; GList *permission_buttons; @@ -30,7 +445,7 @@ Index: src/file-manager/fm-properties-window.c GList *mime_list; gboolean deep_count_finished; -@@ -217,6 +224,10 @@ +@@ -217,6 +224,10 @@ static void permission_combo_update GtkComboBox *combo); static void value_field_update (FMPropertiesWindow *window, GtkLabel *field); @@ -41,7 +456,7 @@ Index: src/file-manager/fm-properties-window.c static void properties_window_update (FMPropertiesWindow *window, GList *files); static void is_directory_ready_callback (NautilusFile *file, -@@ -246,10 +257,36 @@ +@@ -246,10 +257,36 @@ static GtkLabel *attach_ellipsizing_valu const char *initial_text); static GtkWidget* create_pie_widget (FMPropertiesWindow *window); @@ -55,8 +470,8 @@ Index: src/file-manager/fm-properties-window.c + char *attr_val, + char *def_attr_val); +#endif - + + G_DEFINE_TYPE (FMPropertiesWindow, fm_properties_window, GTK_TYPE_DIALOG); #define parent_class fm_properties_window_parent_class @@ -78,7 +493,7 @@ Index: src/file-manager/fm-properties-window.c static gboolean is_multi_file_window (FMPropertiesWindow *window) { -@@ -270,6 +307,111 @@ +@@ -270,6 +307,111 @@ is_multi_file_window (FMPropertiesWindow return FALSE; } @@ -190,7 +605,7 @@ Index: src/file-manager/fm-properties-window.c static int get_not_gone_original_file_count (FMPropertiesWindow *window) { -@@ -502,7 +644,7 @@ +@@ -502,7 +644,7 @@ fm_properties_window_drag_data_received return; } @@ -199,7 +614,7 @@ Index: src/file-manager/fm-properties-window.c exactly_one = uris[0] != NULL && (uris[1] == NULL || uris[1][0] == '\0'); -@@ -651,11 +793,7 @@ +@@ -651,11 +793,7 @@ set_name_field (FMPropertiesWindow *wind * currently showing. This causes minimal ripples (e.g. * selection change). */ @@ -212,7 +627,7 @@ Index: src/file-manager/fm-properties-window.c } } } -@@ -735,7 +873,6 @@ +@@ -735,7 +873,6 @@ static void name_field_restore_original_name (NautilusEntry *name_field) { const char *original_name; @@ -220,7 +635,7 @@ Index: src/file-manager/fm-properties-window.c original_name = (const char *) g_object_get_data (G_OBJECT (name_field), "original_name"); -@@ -744,14 +881,8 @@ +@@ -744,14 +881,8 @@ name_field_restore_original_name (Nautil return; } @@ -236,7 +651,7 @@ Index: src/file-manager/fm-properties-window.c } static void -@@ -1213,6 +1344,14 @@ +@@ -1213,6 +1344,14 @@ properties_window_update (FMPropertiesWi for (l = window->details->value_fields; l != NULL; l = l->next) { value_field_update (window, GTK_LABEL (l->data)); } @@ -251,7 +666,7 @@ Index: src/file-manager/fm-properties-window.c } mime_list = get_mime_list (window); -@@ -1383,6 +1522,164 @@ +@@ -1383,6 +1522,164 @@ value_field_update (FMPropertiesWindow * window->details->target_files)); } @@ -416,7 +831,7 @@ Index: src/file-manager/fm-properties-window.c static GtkLabel * attach_label (GtkTable *table, int row, -@@ -1437,6 +1734,47 @@ +@@ -1437,6 +1734,47 @@ attach_value_label (GtkTable *table, return attach_label (table, row, column, initial_text, FALSE, FALSE, FALSE, TRUE, FALSE); } @@ -464,7 +879,7 @@ Index: src/file-manager/fm-properties-window.c static GtkLabel * attach_ellipsizing_value_label (GtkTable *table, int row, -@@ -1495,6 +1833,649 @@ +@@ -1495,6 +1833,649 @@ attach_value_field (FMPropertiesWindow * FALSE); } @@ -1114,12 +1529,12 @@ Index: src/file-manager/fm-properties-window.c static GtkWidget* attach_ellipsizing_value_field (FMPropertiesWindow *window, GtkTable *table, -@@ -2448,7 +3429,38 @@ +@@ -2451,6 +3432,37 @@ append_title_value_pair (FMPropertiesWin return last_row; } +#ifdef HAVE_SELINUX - static guint ++static guint +append_title_selinux_edit_pair (FMPropertiesWindow *window, + GtkTable *table, + const char *title, @@ -1149,11 +1564,10 @@ Index: src/file-manager/fm-properties-window.c +} +#endif + -+static guint + static guint append_title_and_ellipsizing_value (FMPropertiesWindow *window, GtkTable *table, - const char *title, -@@ -3467,31 +4479,6 @@ +@@ -3470,31 +4482,6 @@ create_emblems_page (FMPropertiesWindow } static void @@ -1185,7 +1599,7 @@ Index: src/file-manager/fm-properties-window.c permission_change_callback (NautilusFile *file, GFile *res_loc, GError *error, -@@ -4267,40 +5254,7 @@ +@@ -4270,39 +5257,6 @@ append_special_execution_flags (FMProper gtk_table_set_row_spacing (table, table->nrows - 1, 18); } @@ -1202,7 +1616,7 @@ Index: src/file-manager/fm-properties-window.c - return FALSE; - } - } - +- - return TRUE; -} - @@ -1222,11 +1636,10 @@ Index: src/file-manager/fm-properties-window.c - - return TRUE; -} -- + static GHashTable * get_initial_permissions (GList *file_list) - { -@@ -4639,7 +5593,9 @@ +@@ -4642,7 +5596,9 @@ apply_recursive_clicked (GtkWidget *recu guint32 file_permission, file_permission_mask; guint32 dir_permission, dir_permission_mask; guint32 vfs_mask, vfs_new_perm, p; @@ -1237,7 +1650,7 @@ Index: src/file-manager/fm-properties-window.c gboolean active, is_folder, is_special, use_original; GList *l; GtkTreeModel *model; -@@ -4683,9 +5639,9 @@ +@@ -4686,9 +5642,9 @@ apply_recursive_clicked (GtkWidget *recu } /* Simple mode, minus exec checkbox */ for (l = window->details->permission_combos; l != NULL; l = l->next) { @@ -1249,7 +1662,7 @@ Index: src/file-manager/fm-properties-window.c continue; } -@@ -4693,7 +5649,7 @@ +@@ -4696,7 +5652,7 @@ apply_recursive_clicked (GtkWidget *recu is_folder = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (combo), "is-folder")); @@ -1258,7 +1671,7 @@ Index: src/file-manager/fm-properties-window.c gtk_tree_model_get (model, &iter, 1, &new_perm, 2, &use_original, -1); if (use_original) { continue; -@@ -4716,12 +5672,53 @@ +@@ -4719,12 +5675,53 @@ apply_recursive_clicked (GtkWidget *recu } } @@ -1312,7 +1725,7 @@ Index: src/file-manager/fm-properties-window.c if (nautilus_file_is_directory (file) && nautilus_file_can_set_permissions (file)) { uri = nautilus_file_get_uri (file); -@@ -4732,11 +5729,13 @@ +@@ -4735,11 +5732,13 @@ apply_recursive_clicked (GtkWidget *recu file_permission_mask, dir_permission, dir_permission_mask, @@ -1326,458 +1739,24 @@ Index: src/file-manager/fm-properties-window.c } static void -@@ -4785,10 +5784,16 @@ +@@ -4788,10 +5787,16 @@ create_permissions_page (FMPropertiesWin gtk_table_set_row_spacing (page_table, page_table->nrows - 1, 18); #ifdef HAVE_SELINUX - append_title_value_pair - (window, page_table, _("SELinux context:"), -- "selinux_context", "--", +- "selinux_context", INCONSISTENT_STATE_STRING, - FALSE); + if (!is_multi_file_window (window) || multi_have_same_selinux_context (window)) -+ append_title_selinux_edit_pair -+ (window, page_table, _("_SELinux Context:"), -+ "selinux_context", _("--"), -+ FALSE); ++ append_title_selinux_edit_pair (window, page_table, ++ _("_SELinux Context:"), ++ "selinux_context", INCONSISTENT_STATE_STRING, ++ FALSE); + else /* Static text in this case. */ + append_title_value_pair (window, page_table, -+ _("_SELinux Context:"), -+ "selinux_context", _("--"), -+ FALSE); ++ _("_SELinux Context:"), ++ "selinux_context", INCONSISTENT_STATE_STRING, ++ FALSE); #endif append_title_value_pair (window, page_table, _("Last changed:"), -Index: src/file-manager/fm-list-view.c -=================================================================== ---- src/file-manager/fm-list-view.c (revision 14227) -+++ src/file-manager/fm-list-view.c (working copy) -@@ -1368,13 +1368,15 @@ - char *name; - char *label; - float xalign; -+ gboolean ellipsize; - - nautilus_column = NAUTILUS_COLUMN (l->data); - - g_object_get (nautilus_column, - "name", &name, - "label", &label, -- "xalign", &xalign, NULL); -+ "xalign", &xalign, -+ "ellipsize", &ellipsize, NULL); - - column_num = fm_list_model_add_column (view->details->model, - nautilus_column); -@@ -1420,6 +1422,8 @@ - } else { - cell = gtk_cell_renderer_text_new (); - g_object_set (cell, "xalign", xalign, NULL); -+ if (ellipsize) -+ g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL); - view->details->cells = g_list_append (view->details->cells, - cell); - column = gtk_tree_view_column_new_with_attributes (label, -Index: src/file-manager/fm-error-reporting.c -=================================================================== ---- src/file-manager/fm-error-reporting.c (revision 14227) -+++ src/file-manager/fm-error-reporting.c (working copy) -@@ -232,6 +232,31 @@ - g_free (message); - } - -+void -+fm_report_error_setting_selinux (NautilusFile *file, -+ GError *error, -+ GtkWindow *parent_window) -+{ -+ char *file_name; -+ char *message; -+ -+ if (error == NULL) { -+ return; -+ } -+ -+ file_name = nautilus_file_get_display_name (file); -+ -+ message = g_strdup_printf (_("Sorry, couldn't change the permissions of \"%s\": %s"), file_name, error->message); -+ -+ /* Silently drop the error when called from selinux entry and is not finished yet */ -+ if (! g_error_matches(error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT)) { -+ eel_show_error_dialog (_("The SELinux security context could not be changed."), message, parent_window); -+ } -+ -+ g_free (file_name); -+ g_free (message); -+} -+ - typedef struct _FMRenameData { - char *name; - NautilusFileOperationCallback callback; -Index: src/file-manager/fm-error-reporting.h -=================================================================== ---- src/file-manager/fm-error-reporting.h (revision 14227) -+++ src/file-manager/fm-error-reporting.h (working copy) -@@ -41,8 +41,11 @@ - GError *error, - GtkWindow *parent_window); - void fm_report_error_setting_owner (NautilusFile *file, -- GError *error, -+ GError *error, - GtkWindow *parent_window); -+void fm_report_error_setting_selinux (NautilusFile *file, -+ GError *error, -+ GtkWindow *parent_window); - void fm_report_error_setting_group (NautilusFile *file, - GError *error, - GtkWindow *parent_window); -Index: libnautilus-private/nautilus-column-utilities.c -=================================================================== ---- libnautilus-private/nautilus-column-utilities.c (revision 14227) -+++ libnautilus-private/nautilus-column-utilities.c (working copy) -@@ -119,6 +119,7 @@ - "attribute", "selinux_context", - "label", _("SELinux Context"), - "description", _("The SELinux security context of the file."), -+ "ellipsize", TRUE, - NULL)); - - return columns; -Index: libnautilus-private/nautilus-file-operations.c -=================================================================== ---- libnautilus-private/nautilus-file-operations.c (revision 14227) -+++ libnautilus-private/nautilus-file-operations.c (working copy) -@@ -64,6 +64,11 @@ - #include "nautilus-trash-monitor.h" - #include "nautilus-file-utilities.h" - -+#ifdef HAVE_SELINUX -+ #include -+#endif -+ -+ - static gboolean confirm_trash_auto_value; - - /* TODO: TESTING!!! */ -@@ -137,6 +142,7 @@ - guint32 file_mask; - guint32 dir_permissions; - guint32 dir_mask; -+ char *context; - } SetPermissionsJob; - - typedef enum { -@@ -4689,6 +4695,10 @@ - job->done_callback (job->done_callback_data); - } - -+ if (job->context) { -+ g_free (job->context); -+ } -+ - finalize_common ((CommonJob *)job); - return FALSE; - } -@@ -4744,6 +4754,14 @@ - current, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, - common->cancellable, NULL); - } -+ -+#ifdef HAVE_SELINUX -+ if (!job_aborted (common) && (job->context)) { -+ g_file_set_attribute_string (file, G_FILE_ATTRIBUTE_SELINUX_CONTEXT, -+ job->context, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, -+ common->cancellable, NULL); -+ } -+#endif - - if (!job_aborted (common) && - g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) { -@@ -4807,6 +4825,7 @@ - guint32 file_mask, - guint32 dir_permissions, - guint32 dir_mask, -+ const char *context, - NautilusOpCallback callback, - gpointer callback_data) - { -@@ -4820,7 +4839,24 @@ - job->dir_mask = dir_mask; - job->done_callback = callback; - job->done_callback_data = callback_data; -- -+ -+ if (context) { -+ char *rcontext; -+ -+ rcontext = job->context = NULL; -+#ifdef HAVE_SELINUX -+ /* this is really const, but prototype is wrong, *sigh* */ -+ if (selinux_trans_to_raw_context((char *)context, &rcontext)) { -+ g_error ("selinux_trans_to_raw_context: failed to allocate bytes"); -+ return; -+ } -+ job->context = g_strdup (rcontext); -+ freecon (rcontext); -+#endif -+ } else { -+ job->context = NULL; -+ } -+ - g_io_scheduler_push_job (set_permissions_job, - job, - NULL, -Index: libnautilus-private/nautilus-file-operations.h -=================================================================== ---- libnautilus-private/nautilus-file-operations.h (revision 14227) -+++ libnautilus-private/nautilus-file-operations.h (working copy) -@@ -83,6 +83,7 @@ - guint32 file_mask, - guint32 folder_permissions, - guint32 folder_mask, -+ const char *context, - NautilusOpCallback callback, - gpointer callback_data); - -Index: libnautilus-private/nautilus-file.c -=================================================================== ---- libnautilus-private/nautilus-file.c (revision 14227) -+++ libnautilus-private/nautilus-file.c (working copy) -@@ -1638,7 +1638,7 @@ - file->details->is_mountpoint = is_mountpoint; - - has_permissions = g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_UNIX_MODE); -- permissions = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_MODE);; -+ permissions = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_MODE); - if (file->details->has_permissions != has_permissions || - file->details->permissions != permissions) { - changed = TRUE; -@@ -1799,6 +1799,7 @@ - } - eel_ref_str_unref (file->details->mime_type); - file->details->mime_type = eel_ref_str_get_unique (mime_type); -+ - - selinux_context = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_SELINUX_CONTEXT); - if (eel_strcmp (file->details->selinux_context, selinux_context) != 0) { -@@ -4260,7 +4261,7 @@ - * context - * @file: NautilusFile representing the file in question. - * -- * Returns: Newly allocated string ready to display to the user. -+ * Returns: Newly allocated string ready to display to the user, or NULL. - * - **/ - char * -@@ -4293,6 +4294,114 @@ - return translated; - } - -+/** -+ * nautilus_file_get_selinux_matchpathcon: -+ * -+ * Get a user-displayable string representing a file's default selinux -+ * context (as from matchpathcon). Only works on local files. -+ * @file: NautilusFile representing the file in question. -+ * -+ * Returns: Newly allocated string ready to display to the user, or NULL. -+ * -+ **/ -+char * -+nautilus_file_get_selinux_matchpathcon (NautilusFile *file) -+{ -+ char *translated; -+#ifdef HAVE_SELINUX -+ char *raw; -+ char *fname; -+ GFile *location; -+#endif -+ -+ g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL); -+ -+ translated = NULL; -+#ifdef HAVE_SELINUX -+ location = nautilus_file_get_location (file); -+ fname = g_file_get_path (location); -+ -+ if (!fname) { -+ return NULL; -+ } -+ -+ raw = NULL; -+ if (matchpathcon (fname, file->details->permissions, &raw) == 0) { -+ if (selinux_raw_to_trans_context (raw, &translated) == 0) { -+ char *tmp; -+ tmp = g_strdup (translated); -+ freecon (translated); -+ translated = tmp; -+ } -+ freecon (raw); -+ } -+ -+ g_free (fname); -+ g_object_unref (location); -+#endif -+ -+ return translated; -+} -+ -+void -+nautilus_file_set_selinux_context (NautilusFile *file, -+ const char *selinux_context, -+ NautilusFileOperationCallback callback, -+ gpointer callback_data) -+{ -+ GFileInfo *info; -+ GError *error; -+ char *rcontext; -+ -+ rcontext = NULL; -+ -+ /* this is probably mostly right... */ -+ if (!nautilus_file_can_set_permissions (file)) { -+ /* Claim that something changed even if the permission change failed. -+ * This makes it easier for some clients who see the "reverting" -+ * to the old permissions as "changing back". -+ */ -+ nautilus_file_changed (file); -+ error = g_error_new (G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, -+ _("Not allowed to set SELinux security context")); -+ (* callback) (file, NULL, error, callback_data); -+ g_error_free (error); -+ return; -+ } -+ -+ /* Test the permissions-haven't-changed case explicitly -+ * because we don't want to send the file-changed signal if -+ * nothing changed. -+ */ -+ if (file->details->selinux_context != NULL && -+ strcmp(selinux_context, file->details->selinux_context) == 0) { -+ (* callback) (file, NULL, NULL, callback_data); -+ return; -+ } -+ -+#ifdef HAVE_SELINUX -+ /* this is really const, but prototype is wrong, *sigh* */ -+ if (selinux_trans_to_raw_context((char *)selinux_context, &rcontext)) { -+ error = g_error_new (G_IO_ERROR, G_IO_ERROR_INVAL, -+ _("Invalid SELinux security context")); -+ (* callback) (file, NULL, error, callback_data); -+ g_error_free (error); -+ return; -+ } -+ selinux_context = rcontext; -+#endif -+ -+ info = g_file_info_new (); -+ g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_SELINUX_CONTEXT, selinux_context); -+ nautilus_file_set_attributes (file, info, callback, callback_data); -+ g_object_unref (info); -+ -+#ifdef HAVE_SELINUX -+ freecon (rcontext); -+#endif -+} -+ -+ - static char * - get_real_name (const char *name, const char *gecos) - { -Index: libnautilus-private/nautilus-file.h -=================================================================== ---- libnautilus-private/nautilus-file.h (revision 14227) -+++ libnautilus-private/nautilus-file.h (working copy) -@@ -237,6 +237,7 @@ - GList * nautilus_file_get_settable_group_names (NautilusFile *file); - gboolean nautilus_file_can_get_selinux_context (NautilusFile *file); - char * nautilus_file_get_selinux_context (NautilusFile *file); -+char * nautilus_file_get_selinux_matchpathcon (NautilusFile *file); - - /* "Capabilities". */ - gboolean nautilus_file_can_read (NautilusFile *file); -@@ -271,6 +272,10 @@ - guint32 permissions, - NautilusFileOperationCallback callback, - gpointer callback_data); -+void nautilus_file_set_selinux_context (NautilusFile *file, -+ const char *selinux_context, -+ NautilusFileOperationCallback callback, -+ gpointer callback_data); - void nautilus_file_rename (NautilusFile *file, - const char *new_name, - NautilusFileOperationCallback callback, -Index: libnautilus-extension/nautilus-column.c -=================================================================== ---- libnautilus-extension/nautilus-column.c (revision 14227) -+++ libnautilus-extension/nautilus-column.c (working copy) -@@ -34,6 +34,7 @@ - PROP_LABEL, - PROP_DESCRIPTION, - PROP_XALIGN, -+ PROP_ELLIPSIZE, - LAST_PROP - }; - -@@ -43,6 +44,7 @@ - char *label; - char *description; - float xalign; -+ gboolean ellipsize; - }; - - static GObjectClass *parent_class = NULL; -@@ -99,6 +101,9 @@ - case PROP_XALIGN : - g_value_set_float (value, column->details->xalign); - break; -+ case PROP_ELLIPSIZE : -+ g_value_set_boolean (value, column->details->ellipsize); -+ break; - default : - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; -@@ -140,6 +145,10 @@ - column->details->xalign = g_value_get_float (value); - g_object_notify (object, "xalign"); - break; -+ case PROP_ELLIPSIZE : -+ column->details->ellipsize = g_value_get_boolean (value); -+ g_object_notify (object, "ellipsize"); -+ break; - default : - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; -@@ -167,6 +176,7 @@ - { - column->details = g_new0 (NautilusColumnDetails, 1); - column->details->xalign = 0.0; -+ column->details->ellipsize = FALSE; - } - - static void -@@ -223,6 +233,13 @@ - 1.0, - 0.0, - G_PARAM_READWRITE)); -+ g_object_class_install_property (G_OBJECT_CLASS (class), -+ PROP_ELLIPSIZE, -+ g_param_spec_boolean ("ellipsize", -+ "ellipsize", -+ "Ellipsize text in the column if it's too long to display", -+ FALSE, -+ G_PARAM_READWRITE)); - } - - GType -Index: libnautilus-extension/nautilus-column.h -=================================================================== ---- libnautilus-extension/nautilus-column.h (revision 14227) -+++ libnautilus-extension/nautilus-column.h (working copy) -@@ -64,6 +64,7 @@ - * label (string) - the user-visible label for the column - * description (string) - a user-visible description of the column - * xalign (float) - x-alignment of the column -+ * ellipsize (boolean) - ellipsize text in the column? - */ - - G_END_DECLS diff --git a/nautilus.spec b/nautilus.spec index 7e3598c..ef1bd03 100644 --- a/nautilus.spec +++ b/nautilus.spec @@ -18,7 +18,7 @@ Name: nautilus Summary: Nautilus is a file manager for GNOME -Version: 2.23.4 +Version: 2.23.5 Release: 1%{?dist} License: GPLv2+ Group: User Interface/Desktops @@ -79,10 +79,10 @@ Obsoletes: nautilus-media Patch1: nautilus-2.5.7-rhconfig.patch Patch3: background-no-delay.patch -Patch5: nautilus-2.23.3-selinux.diff +Patch5: nautilus-2.23.5-selinux.patch # Why is this not upstream ? -Patch6: nautilus-2.22.1-dynamic-search.patch +Patch6: nautilus-2.23.5-dynamic-search.patch Patch7: rtl-fix.patch Patch8: nautilus-2.22.1-hide-white-screen.patch @@ -129,7 +129,7 @@ for writing nautilus extensions. %patch1 -p1 -b .rhconfig %patch3 -p1 -b .no-delay -%patch5 -p0 -b .selinux +%patch5 -p1 -b .selinux %patch6 -p1 -b .dynamic-search %patch7 -p1 -b .rtl-fix # %patch8 -p1 -b .hide-white-screen @@ -255,6 +255,9 @@ fi %changelog +* Tue Jul 22 2008 Matthias Clasen - 2.23.5-1 +- Update to 2.23.5 + * Tue Jun 17 2008 Tomas Bzatek - 2.23.4-1 - Update to 2.23.4 diff --git a/parent-info.patch b/parent-info.patch deleted file mode 100644 index 2e21c0d..0000000 --- a/parent-info.patch +++ /dev/null @@ -1,83 +0,0 @@ -Index: libnautilus-private/nautilus-file.c -=================================================================== ---- libnautilus-private/nautilus-file.c (revision 13949) -+++ libnautilus-private/nautilus-file.c (working copy) -@@ -7044,11 +7044,13 @@ - iface->get_uri = nautilus_file_get_uri; - iface->get_parent_location = nautilus_file_get_parent_location; - iface->get_parent_uri = nautilus_file_get_parent_uri; -+ iface->get_parent_info = nautilus_file_get_parent; - iface->get_uri_scheme = nautilus_file_get_uri_scheme; - iface->get_activation_uri = nautilus_file_get_activation_uri; - iface->get_mime_type = nautilus_file_get_mime_type; - iface->is_mime_type = nautilus_file_is_mime_type; - iface->is_directory = nautilus_file_is_directory; -+ iface->can_write = nautilus_file_can_write; - iface->add_emblem = nautilus_file_add_emblem; - iface->get_string_attribute = nautilus_file_get_string_attribute; - iface->add_string_attribute = nautilus_file_add_string_attribute; -Index: libnautilus-extension/nautilus-file-info.c -=================================================================== ---- libnautilus-extension/nautilus-file-info.c (revision 13949) -+++ libnautilus-extension/nautilus-file-info.c (working copy) -@@ -152,6 +152,15 @@ - return NAUTILUS_FILE_INFO_GET_IFACE (file)->get_parent_uri (file); - } - -+NautilusFileInfo * -+nautilus_file_info_get_parent_info (NautilusFileInfo *file) -+{ -+ g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (file), NULL); -+ g_return_val_if_fail (NAUTILUS_FILE_INFO_GET_IFACE (file)->get_parent_info != NULL, NULL); -+ -+ return NAUTILUS_FILE_INFO_GET_IFACE (file)->get_parent_info (file); -+} -+ - char * - nautilus_file_info_get_uri_scheme (NautilusFileInfo *file) - { -@@ -191,6 +200,15 @@ - return NAUTILUS_FILE_INFO_GET_IFACE (file)->is_directory (file); - } - -+gboolean -+nautilus_file_info_can_write (NautilusFileInfo *file) -+{ -+ g_return_val_if_fail (NAUTILUS_IS_FILE_INFO (file), FALSE); -+ g_return_val_if_fail (NAUTILUS_FILE_INFO_GET_IFACE (file)->can_write != NULL, FALSE); -+ -+ return NAUTILUS_FILE_INFO_GET_IFACE (file)->can_write (file); -+} -+ - void - nautilus_file_info_add_emblem (NautilusFileInfo *file, - const char *emblem_name) -Index: libnautilus-extension/nautilus-file-info.h -=================================================================== ---- libnautilus-extension/nautilus-file-info.h (revision 13949) -+++ libnautilus-extension/nautilus-file-info.h (working copy) -@@ -78,6 +78,8 @@ - GFileType (*get_file_type) (NautilusFileInfo *file); - GFile * (*get_location) (NautilusFileInfo *file); - GFile * (*get_parent_location) (NautilusFileInfo *file); -+ NautilusFileInfo* (*get_parent_info) (NautilusFileInfo *file); -+ gboolean (*can_write) (NautilusFileInfo *file); - - }; - -@@ -96,6 +98,7 @@ - char * nautilus_file_info_get_activation_uri (NautilusFileInfo *file); - GFile * nautilus_file_info_get_parent_location (NautilusFileInfo *file); - char * nautilus_file_info_get_parent_uri (NautilusFileInfo *file); -+NautilusFileInfo* nautilus_file_info_get_parent_info (NautilusFileInfo *file); - char * nautilus_file_info_get_uri_scheme (NautilusFileInfo *file); - - /* File Type */ -@@ -103,6 +106,7 @@ - gboolean nautilus_file_info_is_mime_type (NautilusFileInfo *file, - const char *mime_type); - gboolean nautilus_file_info_is_directory (NautilusFileInfo *file); -+gboolean nautilus_file_info_can_write (NautilusFileInfo *file); - - - /* Modifying the NautilusFileInfo */ diff --git a/sources b/sources index b7c224d..8326bf3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6daaf064536cc1c194bb6e1d381679b9 nautilus-2.23.4.tar.bz2 +8d76213546653b36d0a2a32d76c3b438 nautilus-2.23.5.tar.bz2