From a3932394ed862024c5e51aac055bd6fdb77af844 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Tue, 22 Apr 2008 17:16:34 +0000 Subject: [PATCH] - Ensure archive mounts are read-only and turn on thumbnailing on them - Update fuse threading patch --- gvfs-archive-minor-fixes-2.patch | 95 ++++++++++++++++++++++++++++++++ gvfs-fuse-threading.patch | 15 ++++- gvfs.spec | 10 +++- 3 files changed, 117 insertions(+), 3 deletions(-) create mode 100644 gvfs-archive-minor-fixes-2.patch diff --git a/gvfs-archive-minor-fixes-2.patch b/gvfs-archive-minor-fixes-2.patch new file mode 100644 index 0000000..a006a29 --- /dev/null +++ b/gvfs-archive-minor-fixes-2.patch @@ -0,0 +1,95 @@ +Index: daemon/gvfsbackendarchive.c +=================================================================== +--- daemon/gvfsbackendarchive.c (revision 1746) ++++ daemon/gvfsbackendarchive.c (working copy) +@@ -322,6 +322,13 @@ + g_file_info_set_content_type (info, "inode/directory"); + g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, "inode/directory"); + ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ, TRUE); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, FALSE); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE, FALSE); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE, TRUE); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME, FALSE); ++ + icon = g_themed_icon_new ("folder"); + g_file_info_set_icon (info, icon); + g_object_unref (icon); +@@ -340,19 +347,19 @@ + g_file_info_set_attribute_uint64 (info, + G_FILE_ATTRIBUTE_TIME_ACCESS, + archive_entry_atime (entry)); +- g_file_info_set_attribute_uint64 (info, ++ g_file_info_set_attribute_uint32 (info, + G_FILE_ATTRIBUTE_TIME_ACCESS_USEC, + archive_entry_atime_nsec (entry) / 1000); + g_file_info_set_attribute_uint64 (info, + G_FILE_ATTRIBUTE_TIME_CHANGED, + archive_entry_ctime (entry)); +- g_file_info_set_attribute_uint64 (info, ++ g_file_info_set_attribute_uint32 (info, + G_FILE_ATTRIBUTE_TIME_CHANGED_USEC, + archive_entry_ctime_nsec (entry) / 1000); + g_file_info_set_attribute_uint64 (info, + G_FILE_ATTRIBUTE_TIME_MODIFIED, + archive_entry_mtime (entry)); +- g_file_info_set_attribute_uint64 (info, ++ g_file_info_set_attribute_uint32 (info, + G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC, + archive_entry_mtime_nsec (entry) / 1000); + +@@ -387,6 +394,13 @@ + g_file_info_set_size (info, + archive_entry_size (entry)); + ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ, TRUE); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, FALSE); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE, FALSE); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE, type == G_FILE_TYPE_DIRECTORY); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE); ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME, FALSE); ++ + /* FIXME: add info for these + dev_t archive_entry_dev(struct archive_entry *); + dev_t archive_entry_devmajor(struct archive_entry *); +@@ -508,11 +522,11 @@ + return; + } + +- archive->file = g_file_new_for_uri (filename); ++ archive->file = g_file_new_for_commandline_arg (filename); + g_free (filename); + } + else +- archive->file = g_file_new_for_uri (file); ++ archive->file = g_file_new_for_commandline_arg (file); + + DEBUG ("Trying to mount %s\n", g_file_get_uri (archive->file)); + +@@ -714,6 +728,19 @@ + g_vfs_job_succeeded (G_VFS_JOB (job)); + } + ++static gboolean ++try_query_fs_info (GVfsBackend *backend, ++ GVfsJobQueryFsInfo *job, ++ const char *filename, ++ GFileInfo *info, ++ GFileAttributeMatcher *attribute_matcher) ++{ ++ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, TRUE); ++ g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL); ++ g_vfs_job_succeeded (G_VFS_JOB (job)); ++ return TRUE; ++} ++ + static void + g_vfs_backend_archive_class_init (GVfsBackendArchiveClass *klass) + { +@@ -729,4 +756,5 @@ + backend_class->read = do_read; + backend_class->enumerate = do_enumerate; + backend_class->query_info = do_query_info; ++ backend_class->try_query_fs_info = try_query_fs_info; + } diff --git a/gvfs-fuse-threading.patch b/gvfs-fuse-threading.patch index 210dab0..1b54696 100644 --- a/gvfs-fuse-threading.patch +++ b/gvfs-fuse-threading.patch @@ -1,6 +1,6 @@ Index: client/gvfsfusedaemon.c =================================================================== ---- client/gvfsfusedaemon.c (revision 1744) +--- client/gvfsfusedaemon.c (revision 1746) +++ client/gvfsfusedaemon.c (working copy) @@ -71,6 +71,8 @@ } FileOp; @@ -82,4 +82,15 @@ Index: client/gvfsfusedaemon.c SET_FILE_HANDLE (fi, fh); g_assert (fh->stream == NULL); - +@@ -1047,7 +1063,10 @@ + debug_print ("vfs_release: %s\n", path); + + if (fh) +- free_file_handle_for_path (path); ++ { ++ if (!file_handle_unref (fh)) ++ free_file_handle_for_path (path); ++ } + + return 0; + } diff --git a/gvfs.spec b/gvfs.spec index d27b98b..01d7a07 100644 --- a/gvfs.spec +++ b/gvfs.spec @@ -1,7 +1,7 @@ Summary: Backends for the gio framework in GLib Name: gvfs Version: 0.2.3 -Release: 8%{?dist} +Release: 9%{?dist} License: LGPLv2+ Group: System Environment/Libraries URL: http://www.gtk.org @@ -47,6 +47,9 @@ Patch8: gvfs-fuse-threading.patch # Patch9: gvfs-dbus-exit.patch +# http://bugzilla.gnome.org/show_bug.cgi?id=528950 +Patch10: gvfs-archive-minor-fixes-2.patch + %description The gvfs package provides backend implementations for the gio framework in GLib. It includes ftp, sftp, cifs. @@ -83,6 +86,7 @@ to access the gvfs filesystems. %patch7 -p1 -b .unmount-scheme %patch8 -p0 -b .fuse-threading %patch9 -p1 -b .dbus-exit +%patch10 -p0 -b .archive-fixes %build @@ -197,6 +201,10 @@ update-desktop-database &> /dev/null ||: %changelog +* Sun Apr 19 2008 David Zeuthen - 0.2.3-9 +- Ensure archive mounts are read-only and turn on thumbnailing on them +- Update fuse threading patch + * Fri Apr 18 2008 Matthias Clasen - 0.2.3-8 - Fix thread-safety issues in gvfs-fuse-daemon - Prevent dbus from shutting us down unexpectedly