From 1e1b531e0cc5203ed5739b3dae22e256721facb8 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 12 May 2009 14:17:22 +0000 Subject: [PATCH] - Require separate libtalloc to fix libsmbclient - Ref the infos in next_files_finish (gnome #582195) - FTP: parse file sizes > 4GB correctly (#499286) - CDDA: allow query well-formed filenames only (#499266) --- ...low-query-well-formed-filenames-only.patch | 32 ++++++++++++++++ ...3-ftp-parse-file-sizes-4GB-correctly.patch | 38 +++++++++++++++++++ ...3-ref-the-infos-in-next_files_finish.patch | 34 +++++++++++++++++ gvfs.spec | 22 ++++++++++- 4 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 gvfs-1.2.3-cdda-allow-query-well-formed-filenames-only.patch create mode 100644 gvfs-1.2.3-ftp-parse-file-sizes-4GB-correctly.patch create mode 100644 gvfs-1.2.3-ref-the-infos-in-next_files_finish.patch diff --git a/gvfs-1.2.3-cdda-allow-query-well-formed-filenames-only.patch b/gvfs-1.2.3-cdda-allow-query-well-formed-filenames-only.patch new file mode 100644 index 0000000..03af1e2 --- /dev/null +++ b/gvfs-1.2.3-cdda-allow-query-well-formed-filenames-only.patch @@ -0,0 +1,32 @@ +From 5073d2736d6a83de04e749ae5952071da3d1ccbc Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Tue, 12 May 2009 15:17:06 +0200 +Subject: [PATCH 4/4] CDDA: allow query well-formed filenames only + +This will check for ".wav" suffix as long as sscanf() +doesn't care of the rest of the formatting string after +last placeholder. Querying filenames like +"Track 10.nonsense" will now throw an error. + +Partially fixes https://bugzilla.redhat.com/show_bug.cgi?id=499266 +--- + daemon/gvfsbackendcdda.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/daemon/gvfsbackendcdda.c b/daemon/gvfsbackendcdda.c +index c97aa44..9b30753 100644 +--- a/daemon/gvfsbackendcdda.c ++++ b/daemon/gvfsbackendcdda.c +@@ -460,7 +460,8 @@ get_track_num_from_name (GVfsBackendCdda *cdda_backend, const char *filename) + char *basename; + + basename = g_path_get_basename (filename); +- if (sscanf (basename, "Track %d.wav", &n) == 1) ++ if (sscanf (basename, "Track %d.wav", &n) == 1 && ++ g_str_has_suffix (basename, ".wav")) + { + g_free (basename); + return n; +-- +1.6.2.2 + diff --git a/gvfs-1.2.3-ftp-parse-file-sizes-4GB-correctly.patch b/gvfs-1.2.3-ftp-parse-file-sizes-4GB-correctly.patch new file mode 100644 index 0000000..a5b4c8f --- /dev/null +++ b/gvfs-1.2.3-ftp-parse-file-sizes-4GB-correctly.patch @@ -0,0 +1,38 @@ +From fe45df2ccfe43077d15c31e21f00f4fb98eea85c Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Thu, 7 May 2009 15:17:06 +0200 +Subject: [PATCH] FTP: parse file sizes > 4GB correctly + +Use 64-bit strtoull() instead of 32-bit strtoul() +when converting string to number. + +https://bugzilla.redhat.com/show_bug.cgi?id=499286 +--- + daemon/gvfsbackendftp.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c +index e650dd0..949573d 100644 +--- a/daemon/gvfsbackendftp.c ++++ b/daemon/gvfsbackendftp.c +@@ -1239,7 +1239,7 @@ dir_default_iter_process (gpointer iter, + else if (symlink) + *symlink = NULL; + +- g_file_info_set_size (info, strtoul (result.fe_size, NULL, 10)); ++ g_file_info_set_size (info, g_ascii_strtoull (result.fe_size, NULL, 10)); + + gvfs_file_info_populate_default (info, s, + type == 'f' ? G_FILE_TYPE_REGULAR : +@@ -2231,7 +2231,7 @@ create_file_info (GVfsBackendFtp *ftp, FtpConnection *conn, const char *filename + + gvfs_file_info_populate_default (info, filename, G_FILE_TYPE_REGULAR); + +- g_file_info_set_size (info, strtoul (conn->read_buffer+4, NULL, 0)); ++ g_file_info_set_size (info, g_ascii_strtoull (conn->read_buffer+4, NULL, 0)); + + g_file_info_set_is_hidden (info, TRUE); + } +-- +1.6.2.2 + diff --git a/gvfs-1.2.3-ref-the-infos-in-next_files_finish.patch b/gvfs-1.2.3-ref-the-infos-in-next_files_finish.patch new file mode 100644 index 0000000..bafe7bb --- /dev/null +++ b/gvfs-1.2.3-ref-the-infos-in-next_files_finish.patch @@ -0,0 +1,34 @@ +From edb7ccb661746fd55ed3b935b44a61d011a0807c Mon Sep 17 00:00:00 2001 +From: Alexander Larsson +Date: Tue, 12 May 2009 14:21:45 +0200 +Subject: [PATCH 3/4] Ref the infos in next_files_finish (#582195) + +In later glib versions setting the GSimpleAsyncResult gpointer data +frees the old data using the destroy notify, which can cause crashes +since we return it. So, just copy+ref the list instead of trying to steal +the asyncresult one. +--- + client/gdaemonfileenumerator.c | 7 ++----- + 1 files changed, 2 insertions(+), 5 deletions(-) + +diff --git a/client/gdaemonfileenumerator.c b/client/gdaemonfileenumerator.c +index 56b1488..1aec092 100644 +--- a/client/gdaemonfileenumerator.c ++++ b/client/gdaemonfileenumerator.c +@@ -417,11 +417,8 @@ g_daemon_file_enumerator_next_files_finish (GFileEnumerator *enumerator, + GList *l; + + l = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result)); +- /* We want the caller to own this, and not the result, so clear the result data */ +- g_simple_async_result_set_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result), +- NULL, NULL); +- +- return l; ++ g_list_foreach (l, (GFunc)g_object_ref, NULL); ++ return g_list_copy (l); + } + + static gboolean +-- +1.6.2.2 + diff --git a/gvfs.spec b/gvfs.spec index 1dd3b4c..95ed274 100644 --- a/gvfs.spec +++ b/gvfs.spec @@ -1,7 +1,7 @@ Summary: Backends for the gio framework in GLib Name: gvfs Version: 1.2.2 -Release: 4%{?dist} +Release: 5%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.gtk.org @@ -36,6 +36,16 @@ Patch2: gvfs-1.1.7-gdu-computer-expose-devices.patch Patch3: gvfs-bash-completion.patch # From svn: Patch4: gvfs-1.2.2-ssh-auth-sock.patch +# nautilus crashes when browsing ssh location after glib 2.21 update +# https://bugzilla.gnome.org/show_bug.cgi?id=582195 +Patch5: gvfs-1.2.3-ref-the-infos-in-next_files_finish.patch +# Files on FTP >4GB reported as 4GB +# https://bugzilla.redhat.com/show_bug.cgi?id=499286 +Patch6: gvfs-1.2.3-ftp-parse-file-sizes-4GB-correctly.patch +# Unable to Play Audio CDs +# https://bugzilla.redhat.com/show_bug.cgi?id=499266 +Patch7: gvfs-1.2.3-cdda-allow-query-well-formed-filenames-only.patch + # Gdu volume monitor patches, from http://cgit.freedesktop.org/~david/gvfs/log/?h=gdu-volume-monitor # @@ -104,6 +114,7 @@ Summary: Windows fileshare support for gvfs Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} BuildRequires: libsmbclient-devel >= 3.2.0-1.pre2.8 +BuildRequires: libtalloc-devel >= 1.3.0-0 %description smb This package provides support for reading and writing files on windows @@ -156,6 +167,9 @@ media players (Media Transfer Protocol) to applications using gvfs. %patch2 -p1 -b .computer-expose-devices %patch3 -p1 -b .bash-completion %patch4 -p0 -b .ssh-auth-sock +%patch5 -p1 -b .sftp-crash +%patch6 -p1 -b .ftp-bigfiles +%patch7 -p1 -b .cdda-query %patch101 -p1 -b .gdu-volume-monitor %patch102 -p1 -b .gdu-volumes-typo @@ -315,6 +329,12 @@ update-desktop-database &> /dev/null ||: %changelog +* Tue May 12 2009 Tomas Bzatek - 1.2.2-5 +- Require separate libtalloc to fix libsmbclient +- Ref the infos in next_files_finish (gnome #582195) +- FTP: parse file sizes > 4GB correctly (#499286) +- CDDA: allow query well-formed filenames only (#499266) + * Sat May 02 2009 David Zeuthen - 1.2.2-4 - Don't show drives that are supposed to be hidden (#498649) - Only automount if media or drive was just inserted - this fixes