diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' gvfs-0.2.3/ChangeLog gvfs-0.2.4/ChangeLog --- gvfs-0.2.3/ChangeLog 2008-04-08 03:47:13.000000000 +0200 +++ gvfs-0.2.4/ChangeLog 2008-05-27 01:03:30.000000000 +0200 @@ -1,3 +1,161 @@ +2008-05-27 Christian Kellner + + * NEWS: Prepare for release. + +2008-05-22 Hans Petter Jansson + + Fix fuse daemon locking and file handle life-cycle issues that + were causing frequent crashes. + + * client/gvfsfusedaemon.c (file_handle_new): Add a "path" field + pointing to a string representing the path this file handle is + associated with, for reverse mapping. + (file_handle_unref): Is now responsible for decrementing the ref + count and freeing the handle if it reaches 0. Note that we need + to check the ref count again after obtaining the global mutex. + (file_handle_free): The new path member is freed here. + (get_file_handle_for_path): Ref the obtained handle. + (get_or_create_file_handle_for_path): Ditto, and hold the lock the + whole time. + (reindex_file_handle_for_path): Steal the old entry to avoid + buildup of stale handles. + (free_file_handle_for_path): Remove. + (vfs_getattr): Unref the handle when we're done with it. + (vfs_rename): Ditto. + (vfs_unlink): Ditto. + (vfs_truncate): Ditto. + (vfs_open): Don't ref the obtained handle; it's done in the helper. + (vfs_create): Ditto. + (vfs_release): Let file_handle_unref() free the handle if + appropriate. Note that the old logic here was inverted, meaning we'd + try to free the handle if the ref count was non-zero. + (vfs_init): The hash table no longer owns the path key strings - + the file handle does. + +2008-05-22 Hans Petter Jansson + + A more complete fix for GNOME bug #531516. + + * client/gvfsfusedaemon.c (subthread_main): Send SIGHUP to the + main thread just before subthread exits. + (dbus_filter_func): When gvfsd goes away, exit the subthread's + main loop instead of immediately sending SIGHUP to parent thread. + Do the same when the session bus goes away. + (shutdown_on_idle): Remove, no longer needed. + (shutdown_signal): Remove, no longer needed. + (vfs_init): Tell dbus to not exit when session bus goes down. + Don't catch signals anymore, since Fuse does this for us. + +2008-05-22 Hans Petter Jansson + + * client/gvfsfusedaemon.c (shutown_on_idle) + (shutdown_signal) + (vfs_init): When the process receives one of the HUP, TERM or + INT signals, shut down gracefully. Fixes GNOME bug #531516. + +2008-05-11 Hans Petter Jansson + + * client/gvfsfusedaemon.c: Fix erroneous copyright header and + provide a better description of the source file. + +2008-05-09 Federico Mena Quintero + + Merged from trunk: + + http://bugzilla.gnome.org/show_bug.cgi?id=532375 - Fix strdup() / + g_free() confusion. + + * hal/hal-device.c (hal_device_new_from_udi_and_properties): + g_strdup() the UDI. We can't just steal it, since it comes from + libhal, which uses strdup() (and we do g_free() in our finalizer). + + * hal/hal-pool.c (hal_pool_new): Free the actual device strings here. + +2008-04-22 Benjamin Otte + + * */*.[ch]: get rid of modelines + The modelines were inconsistent and caused issues when used in + different editors. + +2008-04-21 Sebastien Bacher + + * daemon/gvfsbackendftp.c: (do_enumerate_directory): + remove trailing '\r', that workarounds a parser issue causing + some filenames to not be listed (#524880) + +2008-04-21 Matthias Clasen + + * client/gdaemonvfs.c: + * hal/hal-pool.c: Set exit-on-disconnect to FALSE on private + dbus connections to prevent unexpected exits. (#528785) + +2008-04-21 David Zeuthen + + * client/gvfsfusedaemon.c: Fix some reference issues, see + http://mail.gnome.org/archives/gvfs-list/2008-April/msg00017.html + +2008-04-20 David Zeuthen + + * daemon/gvfsbackendarchive.c: some minor fixes (#528950) + +2008-04-16 David Zeuthen + + * hal/ghalvolumemonitor.c: (should_mount_be_ignored), + (should_volume_be_ignored), (update_mounts): + + Avoid having GVolume and GMount objects for mounts for which the + mount point will make g_unix_mount_guess_should_display() return + FALSE. This fixes a problem where e.g. live cd installers mounts + some file system somewhere (e.g. a /boot partition at + /mnt/installer_boot). + +2008-04-16 Matthias Clasen + + Bug 526793 – unmount hangs with some backends + + * daemon/gvfsbackendgphoto2.c: Set exit-on-disconnect to FALSE + on the private dbus connection to prevent unexpected exit + before the job is done. + +2008-04-16 Christian Kellner + + * daemon/gvfsbackenddav.c: + Set mount prefix on the mount_spec (again). Fixes #528218 + +2008-04-16 Christian Kellner + + * daemon/gvfsbackendhttp.c: + Add logging for soup so we can get easy network traces even + if we are doing https. + +2008-04-15 Matthias Clasen + + Bug 526454 – too early use of dbus session bus + + * client/gdaemonvfs.c (g_io_module_load): Refuse to load if + there is no session bus. + +2008-04-14 Matthias Clasen + + * client/gvfsfusedaemon.c: You cannot store pointers in integers. + Fixes a crash on 64bit systems. + +2008-04-14 Matthias Clasen + + * common/gmounttracker.c (g_mount_tracker_finalize): Only free + lock if it is non-NULL. Pointed out by Denis Leroy. + +2008-04-08 Christian Kellner + + * configure.ac: Post release version bump + +=== gvfs 0.2.3 === + +2008-04-08 Christian Kellner + + * NEWS: Prepare for release. + * daemon/Makefile.am: Fix for release + 2008-04-05 Christian Kellner * client/httpuri.c: @@ -90,6 +248,8 @@ === gvfs 0.2.2 === +2008-05-09 Federico Mena Quintero :ChangeLog + 2008-03-28 Alexander Larsson * daemon/Makefile.am (gvfsd_smb_SOURCES): diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/client/gdaemonvfs.c /tmp/ASS6fTo3QN/gvfs-0.2.4/client/gdaemonvfs.c --- gvfs-0.2.3/client/gdaemonvfs.c 2008-04-08 03:27:44.000000000 +0200 +++ gvfs-0.2.4/client/gdaemonvfs.c 2008-05-26 23:54:41.000000000 +0200 @@ -298,6 +298,8 @@ vfs->wrapped_vfs = g_vfs_get_local (); + dbus_connection_set_exit_on_disconnect (vfs->async_bus, FALSE); + _g_dbus_connection_integrate_with_main (vfs->async_bus); modules = g_io_modules_load_all_in_directory (GVFS_MODULE_DIR); @@ -950,6 +952,13 @@ void g_io_module_load (GIOModule *module) { + /* This is so that system daemons can use gio + * without spawning private dbus instances. + * See bug 526454. + */ + if (g_getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL) + return; + g_daemon_vfs_register_type (G_TYPE_MODULE (module)); g_daemon_volume_monitor_register_types (G_TYPE_MODULE (module)); diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/client/gvfsfusedaemon.c /tmp/ASS6fTo3QN/gvfs-0.2.4/client/gvfsfusedaemon.c --- gvfs-0.2.3/client/gvfsfusedaemon.c 2008-04-08 03:27:44.000000000 +0200 +++ gvfs-0.2.4/client/gvfsfusedaemon.c 2008-05-26 23:54:41.000000000 +0200 @@ -1,7 +1,8 @@ /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* GIO - GLib Input, Output and Streaming Library + +/* gvfsfusedaemon.c - FUSE file system mapping daemon for GVFS * - * Copyright (C) 2006-2007 Red Hat, Inc. + * Copyright (C) 2007-2008 Hans Petter Jansson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,10 +19,9 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * - * Author: Alexander Larsson + * Author: Hans Petter Jansson */ - #include #include @@ -55,8 +55,8 @@ #define DEBUG_ENABLED 0 -#define GET_FILE_HANDLE(fi) (GUINT_TO_POINTER ((guint) (fi)->fh)) -#define SET_FILE_HANDLE(fi, fh) ((fi)->fh = (guint64) GPOINTER_TO_UINT (fh)) +#define GET_FILE_HANDLE(fi) ((gpointer) (fi)->fh) +#define SET_FILE_HANDLE(fi, fh) ((fi)->fh = (guint64) (fh)) typedef struct { time_t creation_time; @@ -71,7 +71,10 @@ } FileOp; typedef struct { + gint refcount; + GMutex *mutex; + gchar *path; FileOp op; gpointer stream; gint length; @@ -183,18 +186,45 @@ } static FileHandle * -file_handle_new (void) +file_handle_new (const gchar *path) { FileHandle *file_handle; file_handle = g_new0 (FileHandle, 1); + file_handle->refcount = 1; file_handle->mutex = g_mutex_new (); file_handle->op = FILE_OP_NONE; + file_handle->path = g_strdup (path); + + return file_handle; +} +static FileHandle * +file_handle_ref (FileHandle *file_handle) +{ + g_atomic_int_inc (&file_handle->refcount); return file_handle; } static void +file_handle_unref (FileHandle *file_handle) +{ + if (g_atomic_int_dec_and_test (&file_handle->refcount)) + { + g_static_mutex_lock (&global_mutex); + + /* Test again, since e.g. get_file_handle_for_path() might have + * snatched the global mutex and revived the file handle between + * g_atomic_int_dec_and_test() and us obtaining the lock. */ + + if (g_atomic_int_get (&file_handle->refcount) == 0) + g_hash_table_remove (global_fh_table, file_handle->path); + + g_static_mutex_unlock (&global_mutex); + } +} + +static void file_handle_close_stream (FileHandle *file_handle) { debug_print ("file_handle_close_stream\n"); @@ -220,11 +250,13 @@ } } +/* Called on hash table removal */ static void file_handle_free (FileHandle *file_handle) { file_handle_close_stream (file_handle); g_mutex_free (file_handle->mutex); + g_free (file_handle->path); g_free (file_handle); } @@ -234,7 +266,11 @@ FileHandle *fh; g_static_mutex_lock (&global_mutex); + fh = g_hash_table_lookup (global_fh_table, path); + if (fh) + file_handle_ref (fh); + g_static_mutex_unlock (&global_mutex); return fh; @@ -245,15 +281,21 @@ { FileHandle *fh; - fh = get_file_handle_for_path (path); - if (!fh) - { - fh = file_handle_new (); + g_static_mutex_lock (&global_mutex); - g_static_mutex_lock (&global_mutex); - g_hash_table_insert (global_fh_table, g_strdup (path), fh); - g_static_mutex_unlock (&global_mutex); + fh = g_hash_table_lookup (global_fh_table, path); + + if (fh) + { + file_handle_ref (fh); } + else + { + fh = file_handle_new (path); + g_hash_table_insert (global_fh_table, fh->path, fh); + } + + g_static_mutex_unlock (&global_mutex); return fh; } @@ -271,30 +313,15 @@ (gpointer *) &fh)) goto out; - g_free (old_path_internal); - g_hash_table_insert (global_fh_table, g_strdup (new_path), fh); + g_free (fh->path); + fh->path = g_strdup (new_path); + g_hash_table_steal (global_fh_table, old_path); + g_hash_table_insert (global_fh_table, fh->path, fh); out: g_static_mutex_unlock (&global_mutex); } -static gboolean -free_file_handle_for_path (const gchar *path) -{ - FileHandle *fh; - - fh = get_file_handle_for_path (path); - if (fh) - { - g_static_mutex_lock (&global_mutex); - g_hash_table_remove (global_fh_table, path); - g_static_mutex_unlock (&global_mutex); - return TRUE; - } - - return FALSE; -} - static MountRecord * mount_record_new (GMount *mount) { @@ -795,7 +822,10 @@ } if (fh) - g_mutex_unlock (fh->mutex); + { + g_mutex_unlock (fh->mutex); + file_handle_unref (fh); + } debug_print ("vfs_getattr: -> %s\n", strerror (-result)); @@ -933,6 +963,8 @@ result = setup_output_stream (file, fh); else result = setup_input_stream (file, fh); + + /* The added reference to the file handle is released in vfs_release() */ } else if (file_type == G_FILE_TYPE_DIRECTORY) { @@ -1019,6 +1051,8 @@ fh->stream = file_output_stream; fh->op = FILE_OP_WRITE; + + /* The added reference to the file handle is released in vfs_release() */ } else { @@ -1047,7 +1081,7 @@ debug_print ("vfs_release: %s\n", path); if (fh) - free_file_handle_for_path (path); + file_handle_unref (fh); return 0; } @@ -1479,6 +1513,7 @@ if (fh) { g_mutex_unlock (fh->mutex); + file_handle_unref (fh); } if (result == -EISDIR) @@ -1530,6 +1565,7 @@ if (fh) { g_mutex_unlock (fh->mutex); + file_handle_unref (fh); } if (error) @@ -1748,7 +1784,10 @@ } if (fh) - g_mutex_unlock (fh->mutex); + { + g_mutex_unlock (fh->mutex); + file_handle_unref (fh); + } g_object_unref (file); } @@ -1998,6 +2037,9 @@ g_object_unref (volume_monitor); volume_monitor = NULL; + /* Tell the main thread to unmount. Using kill() is necessary according to FUSE maintainers. */ + kill (getpid (), SIGHUP); + return NULL; } @@ -2025,14 +2067,20 @@ *new_owner == 0) { /* The daemon died, unmount */ - kill (getpid(), SIGHUP); + g_main_loop_quit (subthread_main_loop); } } + else if (dbus_message_is_signal (message, + DBUS_INTERFACE_LOCAL, + "Disconnected")) + { + /* Session bus died, unmount */ + g_main_loop_quit (subthread_main_loop); + } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } - static gpointer vfs_init (struct fuse_conn_info *conn) { @@ -2046,7 +2094,7 @@ mount_list_mutex = g_mutex_new (); global_fh_table = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, (GDestroyNotify) file_handle_free); + NULL, (GDestroyNotify) file_handle_free); dbus_error_init (&error); @@ -2059,6 +2107,8 @@ return NULL; } + dbus_connection_set_exit_on_disconnect (dbus_conn, FALSE); + _g_dbus_connection_integrate_with_main (dbus_conn); dbus_bus_add_match (dbus_conn, diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/common/gmounttracker.c /tmp/ASS6fTo3QN/gvfs-0.2.4/common/gmounttracker.c --- gvfs-0.2.3/common/gmounttracker.c 2008-04-08 03:27:43.000000000 +0200 +++ gvfs-0.2.4/common/gmounttracker.c 2008-04-16 13:28:56.000000000 +0200 @@ -236,7 +236,8 @@ tracker = G_MOUNT_TRACKER (object); - g_mutex_free (tracker->lock); + if (tracker->lock) + g_mutex_free (tracker->lock); g_list_foreach (tracker->mounts, (GFunc)g_mount_info_unref, NULL); diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/configure.ac /tmp/ASS6fTo3QN/gvfs-0.2.4/configure.ac --- gvfs-0.2.3/configure.ac 2008-04-08 03:27:45.000000000 +0200 +++ gvfs-0.2.4/configure.ac 2008-05-26 23:54:32.000000000 +0200 @@ -1,6 +1,6 @@ AC_INIT(client/gdaemonvfs.h) -AM_INIT_AUTOMAKE(gvfs, 0.2.3) +AM_INIT_AUTOMAKE(gvfs, 0.2.4) AM_CONFIG_HEADER(config.h) AM_SANITY_CHECK diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/daemon/gvfsbackendarchive.c /tmp/ASS6fTo3QN/gvfs-0.2.4/daemon/gvfsbackendarchive.c --- gvfs-0.2.3/daemon/gvfsbackendarchive.c 2008-04-08 03:27:43.000000000 +0200 +++ gvfs-0.2.4/daemon/gvfsbackendarchive.c 2008-05-26 23:54:41.000000000 +0200 @@ -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 -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/daemon/gvfsbackenddav.c /tmp/ASS6fTo3QN/gvfs-0.2.4/daemon/gvfsbackenddav.c --- gvfs-0.2.3/daemon/gvfsbackenddav.c 2008-04-08 03:27:43.000000000 +0200 +++ gvfs-0.2.4/daemon/gvfsbackenddav.c 2008-05-26 23:54:32.000000000 +0200 @@ -1409,6 +1409,8 @@ g_free (port); } + g_mount_spec_set_mount_prefix (spec, uri->path); + return spec; } diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/daemon/gvfsbackendftp.c /tmp/ASS6fTo3QN/gvfs-0.2.4/daemon/gvfsbackendftp.c --- gvfs-0.2.3/daemon/gvfsbackendftp.c 2008-04-08 03:27:43.000000000 +0200 +++ gvfs-0.2.4/daemon/gvfsbackendftp.c 2008-05-26 23:54:41.000000000 +0200 @@ -1782,6 +1782,8 @@ if (got_boundary) { name[bytes_read - 1] = 0; + if (bytes_read >= 2 && name[bytes_read - 2] == '\r') + name[bytes_read - 2] = 0; DEBUG ("--- %s\n", name); list = g_list_prepend (list, g_strdup (name)); bytes_read = 0; diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/daemon/gvfsbackendgphoto2.c /tmp/ASS6fTo3QN/gvfs-0.2.4/daemon/gvfsbackendgphoto2.c --- gvfs-0.2.3/daemon/gvfsbackendgphoto2.c 2008-04-08 03:27:43.000000000 +0200 +++ gvfs-0.2.4/daemon/gvfsbackendgphoto2.c 2008-05-26 23:54:41.000000000 +0200 @@ -1394,6 +1394,8 @@ return; } + dbus_connection_set_exit_on_disconnect (gphoto2_backend->dbus_connection, FALSE); + gphoto2_backend->hal_ctx = libhal_ctx_new (); if (gphoto2_backend->hal_ctx == NULL) { diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/daemon/gvfsbackendhttp.c /tmp/ASS6fTo3QN/gvfs-0.2.4/daemon/gvfsbackendhttp.c --- gvfs-0.2.3/daemon/gvfsbackendhttp.c 2008-04-08 03:27:43.000000000 +0200 +++ gvfs-0.2.4/daemon/gvfsbackendhttp.c 2008-05-26 23:54:32.000000000 +0200 @@ -75,9 +75,13 @@ (*G_OBJECT_CLASS (g_vfs_backend_http_parent_class)->finalize) (object); } +#define DEBUG_MAX_BODY_SIZE (100 * 1024 * 1024) + static void g_vfs_backend_http_init (GVfsBackendHttp *backend) { + const char *debug; + g_vfs_backend_set_user_visible (G_VFS_BACKEND (backend), FALSE); backend->session = soup_session_sync_new_with_options ("user-agent", @@ -87,6 +91,28 @@ backend->session_async = soup_session_async_new_with_options ("user-agent", "gvfs/" VERSION, NULL); + + /* Logging */ + debug = g_getenv ("GVFS_HTTP_DEBUG"); + if (debug) + { + SoupLogger *logger; + SoupLoggerLogLevel level; + + if (g_ascii_strcasecmp (debug, "all") || + g_ascii_strcasecmp (debug, "body")) + level = SOUP_LOGGER_LOG_BODY; + else if (g_ascii_strcasecmp (debug, "header")) + level = SOUP_LOGGER_LOG_HEADERS; + else + level = SOUP_LOGGER_LOG_MINIMAL; + + logger = soup_logger_new (level, DEBUG_MAX_BODY_SIZE); + soup_logger_attach (logger, backend->session); + soup_logger_attach (logger, backend->session_async); + g_object_unref (logger); + } + } /* ************************************************************************* */ diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/debian/changelog /tmp/ASS6fTo3QN/gvfs-0.2.4/debian/changelog --- gvfs-0.2.3/debian/changelog 2008-05-27 11:52:02.000000000 +0200 +++ gvfs-0.2.4/debian/changelog 2008-05-27 11:52:02.000000000 +0200 @@ -1,3 +1,23 @@ +gvfs (0.2.4-0ubuntu1) hardy-proposed; urgency=low + + * New upstream version: + - Fix fuse locking and file handle life-cycle issues that were + causing frequent crashes. + - Unmount fuse mounts on logout (lp: #212789) + - Ftp: various fixes + - gphoto: various fixes + - Add ability to control http debuging through GVFS_HTTP_DEBUG env variable + * debian/patches/90_from_svn_fix_unlock_crasher.patch, + debian/patches/91_from_redhat_fix_fuse_64bit_issue.patch, + debian/patches/92_from_upstream_only_show_allowed_mounts.patch, + debian/patches/93_from_svn_fix_ftp_parsing_issue.patch, + debian/patches/94_from_svn_fix_referencing_issues.patch: + - those changed are in the new version + * debian/patches/90_from_svn_runtime_samba_debug.patch: + - svn change to allow to set the samba debug at runtime + + -- Sebastien Bacher Tue, 27 May 2008 10:57:13 +0200 + gvfs (0.2.3-0ubuntu5) hardy-proposed; urgency=low * debian/patches/94_from_svn_fix_referencing_issues.patch: diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/debian/patches/90_from_svn_fix_unlock_crasher.patch /tmp/ASS6fTo3QN/gvfs-0.2.4/debian/patches/90_from_svn_fix_unlock_crasher.patch --- gvfs-0.2.3/debian/patches/90_from_svn_fix_unlock_crasher.patch 2008-05-27 11:52:02.000000000 +0200 +++ gvfs-0.2.4/debian/patches/90_from_svn_fix_unlock_crasher.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ ---- trunk/common/gmounttracker.c 2008/04/13 07:19:06 1732 -+++ trunk/common/gmounttracker.c 2008/04/14 04:39:39 1733 -@@ -236,7 +236,8 @@ - - tracker = G_MOUNT_TRACKER (object); - -- g_mutex_free (tracker->lock); -+ if (tracker->lock) -+ g_mutex_free (tracker->lock); - - g_list_foreach (tracker->mounts, - (GFunc)g_mount_info_unref, NULL); diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/debian/patches/90_from_svn_runtime_samba_debug.patch /tmp/ASS6fTo3QN/gvfs-0.2.4/debian/patches/90_from_svn_runtime_samba_debug.patch --- gvfs-0.2.3/debian/patches/90_from_svn_runtime_samba_debug.patch 1970-01-01 01:00:00.000000000 +0100 +++ gvfs-0.2.4/debian/patches/90_from_svn_runtime_samba_debug.patch 2008-05-27 11:52:02.000000000 +0200 @@ -0,0 +1,26 @@ +--- trunk/daemon/gvfsbackendsmb.c 2008/05/21 08:58:52 1772 ++++ trunk/daemon/gvfsbackendsmb.c 2008/05/21 09:03:57 1773 +@@ -457,6 +457,8 @@ + char *uri; + int res; + char *display_name; ++ const char *debug; ++ int debug_val; + GMountSpec *smb_mount_spec; + smbc_stat_fn smbc_stat; + +@@ -470,7 +472,13 @@ + } + smbc_setOptionUserData (smb_context, backend); + +- smbc_setDebug (smb_context, 0); ++ debug = g_getenv ("GVFS_SMB_DEBUG"); ++ if (debug) ++ debug_val = atoi (debug); ++ else ++ debug_val = 0; ++ ++ smbc_setDebug (smb_context, debug_val); + smbc_setFunctionAuthDataWithContext (smb_context, auth_callback); + + smbc_setFunctionAddCachedServer (smb_context, add_cached_server); diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/debian/patches/91_from_redhat_fix_fuse_64bit_issue.patch /tmp/ASS6fTo3QN/gvfs-0.2.4/debian/patches/91_from_redhat_fix_fuse_64bit_issue.patch --- gvfs-0.2.3/debian/patches/91_from_redhat_fix_fuse_64bit_issue.patch 2008-05-27 11:52:02.000000000 +0200 +++ gvfs-0.2.4/debian/patches/91_from_redhat_fix_fuse_64bit_issue.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -diff -up gvfs-0.2.3/client/gvfsfusedaemon.c.64clean gvfs-0.2.3/client/gvfsfusedaemon.c ---- gvfs-0.2.3/client/gvfsfusedaemon.c.64clean 2008-04-11 23:00:42.000000000 -0400 -+++ gvfs-0.2.3/client/gvfsfusedaemon.c 2008-04-11 23:01:17.000000000 -0400 -@@ -55,8 +55,8 @@ - - #define DEBUG_ENABLED 0 - --#define GET_FILE_HANDLE(fi) (GUINT_TO_POINTER ((guint) (fi)->fh)) --#define SET_FILE_HANDLE(fi, fh) ((fi)->fh = (guint64) GPOINTER_TO_UINT (fh)) -+#define GET_FILE_HANDLE(fi) ((gpointer) (fi)->fh) -+#define SET_FILE_HANDLE(fi, fh) ((fi)->fh = (guint64) (fh)) - - typedef struct { - time_t creation_time; - diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/debian/patches/92_from_upstream_only_show_allowed_mounts.patch /tmp/ASS6fTo3QN/gvfs-0.2.4/debian/patches/92_from_upstream_only_show_allowed_mounts.patch --- gvfs-0.2.3/debian/patches/92_from_upstream_only_show_allowed_mounts.patch 2008-05-27 11:52:02.000000000 +0200 +++ gvfs-0.2.4/debian/patches/92_from_upstream_only_show_allowed_mounts.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,89 +0,0 @@ -#2008-04-16 David Zeuthen -# -# * hal/ghalvolumemonitor.c: (should_mount_be_ignored), -# (should_volume_be_ignored), (update_mounts): -# -# Avoid having GVolume and GMount objects for mounts for which the -# mount point will make g_unix_mount_guess_should_display() return -# FALSE. This fixes a problem where e.g. live cd installers mounts -# some file system somewhere (e.g. a /boot partition at -# /mnt/installer_boot). -# -Index: hal/ghalvolumemonitor.c -=================================================================== ---- hal/ghalvolumemonitor.c (revision 1736) -+++ hal/ghalvolumemonitor.c (working copy) -@@ -845,6 +845,32 @@ - } - - static gboolean -+should_mount_be_ignored (HalPool *pool, HalDevice *d) -+{ -+ const char *device_mount_point; -+ -+ device_mount_point = hal_device_get_property_string (d, "volume.mount_point"); -+ if (device_mount_point != NULL && strlen (device_mount_point) > 0) -+ { -+ GUnixMountEntry *mount_entry; -+ -+ /*g_warning ("device_mount_point = '%s'", device_mount_point);*/ -+ -+ mount_entry = g_unix_mount_at (device_mount_point, NULL); -+ if (mount_entry != NULL) { -+ if (!g_unix_mount_guess_should_display (mount_entry)) -+ { -+ g_unix_mount_free (mount_entry); -+ return TRUE; -+ } -+ g_unix_mount_free (mount_entry); -+ } -+ } -+ -+ return FALSE; -+} -+ -+static gboolean - should_volume_be_ignored (HalPool *pool, HalDevice *d, GList *fstab_mount_points) - { - gboolean volume_ignore; -@@ -893,6 +919,9 @@ - if (mount_point != NULL && !_g_unix_mount_point_guess_should_display (mount_point)) - return TRUE; - -+ if (hal_device_get_property_bool (d, "volume.is_mounted")) -+ return should_mount_be_ignored (pool, d); -+ - return FALSE; - } - -@@ -1207,13 +1236,29 @@ - { - GList *new_mounts; - GList *removed, *added; -- GList *l; -+ GList *l, *ll; - GHalMount *mount; - GHalVolume *volume; - const char *device_path; - const char *mount_path; - - new_mounts = g_unix_mounts_get (NULL); -+ -+ /* remove mounts we want to ignore - we do it here so we get to reevaluate -+ * on the next update whether they should still be ignored -+ */ -+ for (l = new_mounts; l != NULL; l = ll) -+ { -+ GUnixMountEntry *mount_entry = l->data; -+ ll = l->next; -+ -+ /* keep in sync with should_mount_be_ignored() */ -+ if (!g_unix_mount_guess_should_display (mount_entry)) -+ { -+ g_unix_mount_free (mount_entry); -+ new_mounts = g_list_delete_link (new_mounts, l); -+ } -+ } - - new_mounts = g_list_sort (new_mounts, (GCompareFunc) g_unix_mount_compare); - diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/debian/patches/93_from_svn_fix_ftp_parsing_issue.patch /tmp/ASS6fTo3QN/gvfs-0.2.4/debian/patches/93_from_svn_fix_ftp_parsing_issue.patch --- gvfs-0.2.3/debian/patches/93_from_svn_fix_ftp_parsing_issue.patch 2008-05-27 11:52:02.000000000 +0200 +++ gvfs-0.2.4/debian/patches/93_from_svn_fix_ftp_parsing_issue.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -Index: daemon/gvfsbackendftp.c -=================================================================== ---- daemon/gvfsbackendftp.c (révision 1754) -+++ daemon/gvfsbackendftp.c (révision 1755) -@@ -1782,6 +1782,8 @@ - if (got_boundary) - { - name[bytes_read - 1] = 0; -+ if (bytes_read >= 2 && name[bytes_read - 2] == '\r') -+ name[bytes_read - 2] = 0; - DEBUG ("--- %s\n", name); - list = g_list_prepend (list, g_strdup (name)); - bytes_read = 0; diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/debian/patches/94_from_svn_fix_referencing_issues.patch /tmp/ASS6fTo3QN/gvfs-0.2.4/debian/patches/94_from_svn_fix_referencing_issues.patch --- gvfs-0.2.3/debian/patches/94_from_svn_fix_referencing_issues.patch 2008-05-27 11:52:02.000000000 +0200 +++ gvfs-0.2.4/debian/patches/94_from_svn_fix_referencing_issues.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,94 +0,0 @@ ---- branches/gnome-2-22/client/gvfsfusedaemon.c 2008/04/21 14:03:17 1749 -+++ branches/gnome-2-22/client/gvfsfusedaemon.c 2008/04/21 14:04:12 1750 -@@ -71,6 +71,8 @@ - } FileOp; - - typedef struct { -+ gint refcount; -+ - GMutex *mutex; - FileOp op; - gpointer stream; -@@ -188,12 +190,26 @@ - FileHandle *file_handle; - - file_handle = g_new0 (FileHandle, 1); -+ file_handle->refcount = 1; - file_handle->mutex = g_mutex_new (); - file_handle->op = FILE_OP_NONE; - - return file_handle; - } - -+static FileHandle * -+file_handle_ref (FileHandle *file_handle) -+{ -+ g_atomic_int_inc (&file_handle->refcount); -+ return file_handle; -+} -+ -+static gboolean -+file_handle_unref (FileHandle *file_handle) -+{ -+ return g_atomic_int_dec_and_test (&file_handle->refcount); -+} -+ - static void - file_handle_close_stream (FileHandle *file_handle) - { -@@ -278,21 +294,19 @@ - g_static_mutex_unlock (&global_mutex); - } - --static gboolean -+static void - free_file_handle_for_path (const gchar *path) - { - FileHandle *fh; - -- fh = get_file_handle_for_path (path); -+ g_static_mutex_lock (&global_mutex); -+ fh = g_hash_table_lookup (global_fh_table, path); - if (fh) - { -- g_static_mutex_lock (&global_mutex); -- g_hash_table_remove (global_fh_table, path); -- g_static_mutex_unlock (&global_mutex); -- return TRUE; -+ if (file_handle_unref (fh)) -+ g_hash_table_remove (global_fh_table, path); - } -- -- return FALSE; -+ g_static_mutex_unlock (&global_mutex); - } - - static MountRecord * -@@ -923,6 +937,7 @@ - - /* File exists */ - -+ file_handle_ref (fh); - SET_FILE_HANDLE (fi, fh); - - debug_print ("vfs_open: flags=%o\n", fi->flags); -@@ -1013,6 +1028,7 @@ - - /* Success */ - -+ file_handle_ref (fh); - 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 -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/hal/ghalvolumemonitor.c /tmp/ASS6fTo3QN/gvfs-0.2.4/hal/ghalvolumemonitor.c --- gvfs-0.2.3/hal/ghalvolumemonitor.c 2008-04-08 03:27:43.000000000 +0200 +++ gvfs-0.2.4/hal/ghalvolumemonitor.c 2008-05-26 23:54:41.000000000 +0200 @@ -845,6 +845,32 @@ } static gboolean +should_mount_be_ignored (HalPool *pool, HalDevice *d) +{ + const char *device_mount_point; + + device_mount_point = hal_device_get_property_string (d, "volume.mount_point"); + if (device_mount_point != NULL && strlen (device_mount_point) > 0) + { + GUnixMountEntry *mount_entry; + + /*g_warning ("device_mount_point = '%s'", device_mount_point);*/ + + mount_entry = g_unix_mount_at (device_mount_point, NULL); + if (mount_entry != NULL) { + if (!g_unix_mount_guess_should_display (mount_entry)) + { + g_unix_mount_free (mount_entry); + return TRUE; + } + g_unix_mount_free (mount_entry); + } + } + + return FALSE; +} + +static gboolean should_volume_be_ignored (HalPool *pool, HalDevice *d, GList *fstab_mount_points) { gboolean volume_ignore; @@ -893,6 +919,9 @@ if (mount_point != NULL && !_g_unix_mount_point_guess_should_display (mount_point)) return TRUE; + if (hal_device_get_property_bool (d, "volume.is_mounted")) + return should_mount_be_ignored (pool, d); + return FALSE; } @@ -1207,13 +1236,29 @@ { GList *new_mounts; GList *removed, *added; - GList *l; + GList *l, *ll; GHalMount *mount; GHalVolume *volume; const char *device_path; const char *mount_path; new_mounts = g_unix_mounts_get (NULL); + + /* remove mounts we want to ignore - we do it here so we get to reevaluate + * on the next update whether they should still be ignored + */ + for (l = new_mounts; l != NULL; l = ll) + { + GUnixMountEntry *mount_entry = l->data; + ll = l->next; + + /* keep in sync with should_mount_be_ignored() */ + if (!g_unix_mount_guess_should_display (mount_entry)) + { + g_unix_mount_free (mount_entry); + new_mounts = g_list_delete_link (new_mounts, l); + } + } new_mounts = g_list_sort (new_mounts, (GCompareFunc) g_unix_mount_compare); diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/hal/hal-device.c /tmp/ASS6fTo3QN/gvfs-0.2.4/hal/hal-device.c --- gvfs-0.2.3/hal/hal-device.c 2008-04-08 03:27:43.000000000 +0200 +++ gvfs-0.2.4/hal/hal-device.c 2008-05-26 23:54:41.000000000 +0200 @@ -245,7 +245,7 @@ HalDevice *device; device = HAL_DEVICE (g_object_new (HAL_TYPE_DEVICE, NULL)); - device->priv->udi = udi; + device->priv->udi = g_strdup (udi); device->priv->hal_ctx = hal_ctx; device->priv->properties = properties; return device; diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/hal/hal-pool.c /tmp/ASS6fTo3QN/gvfs-0.2.4/hal/hal-pool.c --- gvfs-0.2.3/hal/hal-pool.c 2008-04-08 03:27:43.000000000 +0200 +++ gvfs-0.2.4/hal/hal-pool.c 2008-05-26 23:54:41.000000000 +0200 @@ -308,6 +308,8 @@ goto out; } + dbus_connection_set_exit_on_disconnect (dbus_connection, FALSE); + hal_ctx = libhal_ctx_new (); if (hal_ctx == NULL) { @@ -359,9 +361,8 @@ { for (i = 0; i < num_devices; i++) hal_pool_add_device_by_udi_and_properties (pool, devices[i], properties[i], FALSE); - /* _add_device_by_udi_and_properties steals the given parameters */ - free (devices); - free (properties); + libhal_free_string_array (devices); + free (properties); /* hal_pool_add_device_by_udi_and_properties steals the given properties */ goto out; } #endif diff -Nru --exclude configure --exclude Makefile.in --exclude po --exclude ltmain.sh --exclude aclocal.m4 --exclude 'config.*' --exclude 'intltool*' /tmp/C0AOg5hYaV/gvfs-0.2.3/NEWS /tmp/ASS6fTo3QN/gvfs-0.2.4/NEWS --- gvfs-0.2.3/NEWS 2008-04-08 03:47:02.000000000 +0200 +++ gvfs-0.2.4/NEWS 2008-05-27 01:03:00.000000000 +0200 @@ -1,3 +1,12 @@ +Major changes in 0.2.4: +* Fix fuse locking and file handle life-cycle issues that + were causing frequent crashes. +* Unmount fuse mounts on logout +* Ftp: various fixes +* gphoto: various fixes +* Add ability to control http debuging through GVFS_HTTP_DEBUG + env variable + Major changes in 0.2.3: * WebDAV: implement set_display_name * WebDAV fixes