Update to 1.26.2

This commit is contained in:
Kalev Lember 2015-11-10 12:03:10 +01:00
parent d635b4e805
commit 8f40fda8fa
4 changed files with 5 additions and 221 deletions

View File

@ -1,153 +0,0 @@
From 54cfe52e718332f369a1fe03f76b955c22f26cfc Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Fri, 23 Oct 2015 18:51:09 +0100
Subject: [PATCH] Accept XDG_RUNTIME_DIR/bus as a valid D-Bus session/user bus
These checks for DBUS_SESSION_BUS_ADDRESS were added to solve
https://bugzilla.gnome.org/show_bug.cgi?id=526454,
in which non-X11-session processes (for example a system service),
or processes under su or similar inside an X11 session, could cause
a dbus-daemon to be autolaunched via dbus-launch. If there was no
X11 display to represent the lifetime of a session, the dbus-daemon
would potentially run forever, causing a "leaked" process;
additionally, other uses of D-Bus by the same uid would start more
dbus-daemons.
This becomes potentially problematic on systems with the "user bus"
model introduced in dbus 1.10: libdbus, GDBus and sd-bus will now
all try the per-uid socket XDG_RUNTIME_DIR/bus before attempting
autolaunch, so if those are known to be the only implementations in
use on a "legacy-free" system, setting DBUS_SESSION_BUS_ADDRESS is
unnecessary. Check for that socket before giving up.
XDG_RUNTIME_DIR/bus as implemented by dbus 1.10 with systemd avoids
several of the down sides of autolaunching: it will never start more
than one session bus per uid, and the socket and bus will automatically
be cleaned up when the corresponding "systemd --user" exits.
---
client/gdaemonvfs.c | 3 ++-
common/gvfsutils.c | 46 +++++++++++++++++++++++++++++++++++++
common/gvfsutils.h | 1 +
monitor/proxy/gproxyvolumemonitor.c | 3 ++-
4 files changed, 51 insertions(+), 2 deletions(-)
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index caf846a..8a91570 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -40,6 +40,7 @@
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
#include <gvfsdbus.h>
+#include "gvfsutils.h"
typedef struct {
char *type;
@@ -1501,7 +1502,7 @@ g_io_module_load (GIOModule *module)
* without spawning private dbus instances.
* See bug 526454.
*/
- if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL)
+ if (!gvfs_have_session_bus ())
return;
/* Make this module resident so that we ground the common
diff --git a/common/gvfsutils.c b/common/gvfsutils.c
index 87718f3..47c3117 100644
--- a/common/gvfsutils.c
+++ b/common/gvfsutils.c
@@ -21,8 +21,15 @@
#include <string.h>
#include <glib.h>
+#include <glib/gstdio.h>
#include "gvfsutils.h"
+#ifdef G_OS_UNIX
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+
/**
* gvfs_randomize_string:
* @str: the string to randomize
@@ -40,3 +47,42 @@ gvfs_randomize_string (char *str,
for (i = 0; i < len; i++)
str[i] = chars[g_random_int_range (0, strlen(chars))];
}
+
+/**
+ * gvfs_have_session_bus:
+ *
+ * Returns: %TRUE if we can connect to a session or user bus without
+ * triggering X11 autolaunching.
+ */
+gboolean
+gvfs_have_session_bus (void)
+{
+ if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") != NULL)
+ return TRUE;
+
+#ifdef G_OS_UNIX
+ {
+ gboolean ret = FALSE;
+ gchar *bus;
+ GStatBuf buf;
+
+ bus = g_build_filename (g_get_user_runtime_dir (), "bus", NULL);
+
+ if (g_stat (bus, &buf) < 0)
+ goto out;
+
+ if (buf.st_uid != geteuid ())
+ goto out;
+
+ if ((buf.st_mode & S_IFMT) != S_IFSOCK)
+ goto out;
+
+ ret = TRUE;
+out:
+ g_free (bus);
+ return ret;
+ }
+#else
+ return FALSE;
+#endif
+}
diff --git a/common/gvfsutils.h b/common/gvfsutils.h
index aa7faf5..edac0b0 100644
--- a/common/gvfsutils.h
+++ b/common/gvfsutils.h
@@ -24,6 +24,7 @@ G_BEGIN_DECLS
void gvfs_randomize_string (char *str,
int len);
+gboolean gvfs_have_session_bus (void);
G_END_DECLS
diff --git a/monitor/proxy/gproxyvolumemonitor.c b/monitor/proxy/gproxyvolumemonitor.c
index a7466f0..d258546 100644
--- a/monitor/proxy/gproxyvolumemonitor.c
+++ b/monitor/proxy/gproxyvolumemonitor.c
@@ -45,6 +45,7 @@
#include "gvfsmonitorimpl.h"
#include "gvfsdbus.h"
#include "gvfsdaemonprotocol.h"
+#include "gvfsutils.h"
G_LOCK_DEFINE_STATIC(proxy_vm);
@@ -1412,7 +1413,7 @@ g_proxy_volume_monitor_setup_session_bus_connection (void)
* without spawning private dbus instances.
* See bug 526454.
*/
- if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL)
+ if (!gvfs_have_session_bus ())
return FALSE;
if (the_volume_monitors == NULL)
--
2.6.1

View File

@ -1,56 +0,0 @@
From d236257299344207736086400960b0add2c1200b Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Mon, 19 Oct 2015 13:48:46 +0200
Subject: [PATCH] google: Fail in-fs copy/move if it leads to display name loss
Complicated file name handling on google backend leads to display name
loss if in-fs copy and move operation is proceeded e.g. using Nautilus.
Proper fix will require larger changes for the whole platform. Therefore
fail the job preferably to avoid display name loss...
https://bugzilla.gnome.org/show_bug.cgi?id=755701
---
daemon/gvfsbackendgoogle.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
index 0acec9a..59e2dfe 100644
--- a/daemon/gvfsbackendgoogle.c
+++ b/daemon/gvfsbackendgoogle.c
@@ -1192,6 +1192,22 @@ g_vfs_backend_google_copy (GVfsBackend *_self,
}
}
+ etag = gdata_entry_get_etag (source_entry);
+ id = gdata_entry_get_id (source_entry);
+ summary = gdata_entry_get_summary (source_entry);
+
+ /* Fail the job if copy/move operation leads to display name loss.
+ * Use G_IO_ERROR_FAILED instead of _NOT_SUPPORTED to avoid r/w fallback.
+ * See: https://bugzilla.gnome.org/show_bug.cgi?id=755701 */
+ if (g_strcmp0 (id, destination_basename) == 0)
+ {
+ g_vfs_job_failed_literal (G_VFS_JOB (job),
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ _("Operation unsupported"));
+ goto out;
+ }
+
if (destination_not_directory)
{
g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY, _("The file is not a directory"));
@@ -1230,10 +1246,6 @@ g_vfs_backend_google_copy (GVfsBackend *_self,
}
}
- etag = gdata_entry_get_etag (source_entry);
- id = gdata_entry_get_id (source_entry);
- summary = gdata_entry_get_summary (source_entry);
-
source_entry_type = G_OBJECT_TYPE (source_entry);
dummy_source_entry = g_object_new (source_entry_type,
"etag", etag,
--
2.5.0

View File

@ -2,8 +2,8 @@
%global libgdata_version 0.17.3 %global libgdata_version 0.17.3
Name: gvfs Name: gvfs
Version: 1.26.1.1 Version: 1.26.2
Release: 3%{?dist} Release: 1%{?dist}
Summary: Backends for the gio framework in GLib Summary: Backends for the gio framework in GLib
License: GPLv3 and LGPLv2+ and BSD and MPLv2.0 License: GPLv3 and LGPLv2+ and BSD and MPLv2.0
@ -13,13 +13,6 @@ Source0: http://download.gnome.org/sources/gvfs/1.26/gvfs-%{version}.tar.xz
# http://bugzilla.gnome.org/show_bug.cgi?id=567235 # http://bugzilla.gnome.org/show_bug.cgi?id=567235
Patch0: gvfs-archive-integration.patch Patch0: gvfs-archive-integration.patch
# Backported from upstream
Patch1: 0001-google-Fail-in-fs-copy-move-if-it-leads-to-display-n.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=756420
# https://bugzilla.redhat.com/show_bug.cgi?id=1274700
Patch2: 0001-Accept-XDG_RUNTIME_DIR-bus-as-a-valid-D-Bus-session-.patch
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: dbus-glib-devel BuildRequires: dbus-glib-devel
@ -191,8 +184,6 @@ the functionality of the installed gvfs package.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .archive-integration %patch0 -p1 -b .archive-integration
%patch1 -p1 -b .google-fail-in-fs-copy
%patch2 -p1 -b .accept-xdg_runtime_dir-bus
# Needed for gvfs-0.2.1-archive-integration.patch # Needed for gvfs-0.2.1-archive-integration.patch
autoreconf -fi autoreconf -fi
@ -384,6 +375,8 @@ killall -USR1 gvfsd >&/dev/null || :
%{_datadir}/installed-tests %{_datadir}/installed-tests
%changelog %changelog
* Tue Nov 10 2015 Kalev Lember <klember@redhat.com> - 1.26.2-1
- Update to 1.26.2
* Fri Oct 23 2015 poma <poma@gmail.com> - 1.26.1.1-3 * Fri Oct 23 2015 poma <poma@gmail.com> - 1.26.1.1-3
- Accept XDG_RUNTIME_DIR/bus as a valid D-Bus session/user bus - Accept XDG_RUNTIME_DIR/bus as a valid D-Bus session/user bus

View File

@ -1 +1 @@
9f2e8c85ea3bfc216f8594feed4984cb gvfs-1.26.1.1.tar.xz 1d9abe504ab3a60b81c1c6434526d502 gvfs-1.26.2.tar.xz