From ff85c533919c31a4397e68ceff4ed217ec980d21 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Fri, 7 Aug 2009 12:55:52 +0000 Subject: [PATCH] - Fix bad mount prefix stripping (part of #509612) - Fix gvfsd-sftp segfault when asking a question - Enable tar+xz in the archive mounter --- ...3.4-bug-589434-sftp-choices-segfault.patch | 37 ++++++++++++++++ ...t-strip-mount-prefix-for-local-paths.patch | 44 +++++++++++++++++++ gvfs-archive-integration.patch | 2 +- gvfs.spec | 19 ++++++-- 4 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 gvfs-1.3.4-bug-589434-sftp-choices-segfault.patch create mode 100644 gvfs-1.3.4-dont-strip-mount-prefix-for-local-paths.patch diff --git a/gvfs-1.3.4-bug-589434-sftp-choices-segfault.patch b/gvfs-1.3.4-bug-589434-sftp-choices-segfault.patch new file mode 100644 index 0000000..4a60e93 --- /dev/null +++ b/gvfs-1.3.4-bug-589434-sftp-choices-segfault.patch @@ -0,0 +1,37 @@ +From 54a2ed675de586102462415fce72ed28aa7e2388 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Fri, 7 Aug 2009 11:29:11 +0200 +Subject: [PATCH] =?UTF-8?q?Bug=20589434=20=E2=80=93=20gvfsd-sftp=20crashed=20with=20SIGSEGV=20in=20strlen()?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Pass correct pointer to the choices struct +--- + daemon/gvfsbackendsftp.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c +index 3b510a7..b32d11b 100644 +--- a/daemon/gvfsbackendsftp.c ++++ b/daemon/gvfsbackendsftp.c +@@ -1034,7 +1034,6 @@ handle_login (GVfsBackend *backend, + strstr (buffer, "Key fingerprint:") != NULL) + { + const gchar *choices[] = {_("Log In Anyway"), _("Cancel Login")}; +- const gchar *v_choices = (const gchar *)choices; + const gchar *choice_string; + gchar *hostname = NULL; + gchar *fingerprint = NULL; +@@ -1055,7 +1054,7 @@ handle_login (GVfsBackend *backend, + + if (!g_mount_source_ask_question (mount_source, + message, +- &v_choices, ++ (const gchar **) &choices, + 2, + &aborted, + &choice) || +-- +1.6.4 + diff --git a/gvfs-1.3.4-dont-strip-mount-prefix-for-local-paths.patch b/gvfs-1.3.4-dont-strip-mount-prefix-for-local-paths.patch new file mode 100644 index 0000000..d37f9a1 --- /dev/null +++ b/gvfs-1.3.4-dont-strip-mount-prefix-for-local-paths.patch @@ -0,0 +1,44 @@ +From 3ba4f3e3deae84cbd5ffe8e7bfd2803d96e7e2e6 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Wed, 5 Aug 2009 16:50:28 +0200 +Subject: [PATCH] Don't strip mount prefix when returning local mapped path + +On complex URIs like 'dav://server/gallery/w/TestAlbum', +g_file_get_path () would return malformed path with the middle +path '/gallery/w' stripped. This patch ensures full path to be +returned. + +See bug #590862 for more details. +--- + client/gdaemonfile.c | 8 +------- + 1 files changed, 1 insertions(+), 7 deletions(-) + +diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c +index 8e14929..be9baef 100644 +--- a/client/gdaemonfile.c ++++ b/client/gdaemonfile.c +@@ -167,7 +167,6 @@ g_daemon_file_get_path (GFile *file) + { + GDaemonFile *daemon_file = G_DAEMON_FILE (file); + GMountInfo *mount_info; +- const char *rel_path; + char *path; + + /* This is a sync i/o call, which is a bit unfortunate, as +@@ -185,12 +184,7 @@ g_daemon_file_get_path (GFile *file) + path = NULL; + + if (mount_info->fuse_mountpoint) +- { +- rel_path = daemon_file->path + +- strlen (mount_info->mount_spec->mount_prefix); +- +- path = g_build_filename (mount_info->fuse_mountpoint, rel_path, NULL); +- } ++ path = g_build_filename (mount_info->fuse_mountpoint, daemon_file->path, NULL); + + g_mount_info_unref (mount_info); + +-- +1.6.4 + diff --git a/gvfs-archive-integration.patch b/gvfs-archive-integration.patch index 1119abe..513dce0 100644 --- a/gvfs-archive-integration.patch +++ b/gvfs-archive-integration.patch @@ -39,7 +39,7 @@ diff -up /dev/null gvfs-1.3.2/mount-archive.desktop.in.in +_Name=Archive Mounter +Exec=@libexecdir@/gvfsd-archive file=%u +X-Gnome-Vfs-System=gio -+MimeType=application/x-cd-image;application/x-bzip-compressed-tar;application/x-compressed-tar;application/x-tar;application/x-cpio;application/x-zip;application/zip;application/x-lzma-compressed-tar; ++MimeType=application/x-cd-image;application/x-bzip-compressed-tar;application/x-compressed-tar;application/x-tar;application/x-cpio;application/x-zip;application/zip;application/x-lzma-compressed-tar;application/x-xz-compressed-tar; +Terminal=false +StartupNotify=false +Type=Application diff --git a/gvfs.spec b/gvfs.spec index b92210c..6aec6de 100644 --- a/gvfs.spec +++ b/gvfs.spec @@ -1,7 +1,7 @@ Summary: Backends for the gio framework in GLib Name: gvfs Version: 1.3.3 -Release: 2%{?dist} +Release: 3%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.gtk.org @@ -40,7 +40,13 @@ Patch2: gvfs-1.3.4-output-stream-callback-arg.patch # smb url don't work in the run application dialog # http://bugzilla.gnome.org/show_bug.cgi?id=573994 Patch3: gvfs-1.3.4-smb-browse-fake-content-type.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=497631 +# Bad mount prefix stripping in g_daemon_file_get_path() +# http://bugzilla.gnome.org/show_bug.cgi?id=590862 +Patch4: gvfs-1.3.4-dont-strip-mount-prefix-for-local-paths.patch +# gvfsd-sftp crashed with SIGSEGV in strlen() +# http://bugzilla.gnome.org/show_bug.cgi?id=589434 +Patch5: gvfs-1.3.4-bug-589434-sftp-choices-segfault.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=497631 Patch8: gvfs-1.2.2-dnssd-deadlock.patch # https://bugzilla.redhat.com/show_bug.cgi?id=504339 Patch9: gvfs-1.2.3-sftp-40sec-timeout.patch @@ -89,7 +95,7 @@ shares (SMB) to applications using gvfs. Summary: Archiving support for gvfs Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} -BuildRequires: libarchive-devel >= libarchive-2.5.903a-2 +BuildRequires: libarchive-devel >= libarchive-2.7.1-1 %description archive This package provides support for accessing files inside Zip and Tar archives, @@ -130,6 +136,8 @@ media players (Media Transfer Protocol) to applications using gvfs. %patch1 -p1 -b .archive-integration %patch2 -p1 -b .gedit-segfault %patch3 -p1 -b .smb-fake-content-type +%patch4 -p1 -b .mount-prefix +%patch5 -p1 -b .sftp-choices-segfault %patch8 -p1 -b .dnssd-deadlock %patch9 -p1 -b .sftp-timeout @@ -278,6 +286,11 @@ update-desktop-database &> /dev/null ||: %changelog +* Fri Aug 7 2009 Tomas Bzatek - 1.3.3-3 +- Fix bad mount prefix stripping (part of #509612) +- Fix gvfsd-sftp segfault when asking a question +- Enable tar+xz in the archive mounter + * Tue Aug 4 2009 Tomas Bzatek - 1.3.3-2 - Fix gedit crashed with SEGV in strlen() - Fix SMB protocol not handled when opening from a bookmark (#509832)