summaryrefslogtreecommitdiff
path: root/monitor/proxy
Commit message (Collapse)AuthorAgeFilesLines
* ProxyVolumeMonitor: Don't leak a GVfsDBusDaemonMatthew Leeds2019-07-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In g_proxy_volume_monitor_register() we create a GVfsDBusDaemon object (which is also of type GDBusProxy) but never free it. This causes there to be a dangling reference to the singleton GDBusConnection object used by the GDBusProxy for the rest of the lifetime of a process that uses a gvfs function such as g_file_new_for_path(). With the recent changes I made to GLib[1], that extra reference leads to a warning after a 30 second delay in g_test_dbus_down(). So this commit frees the GVfsDBusDaemon object after it has served its purpose in g_proxy_volume_monitor_register(), which fixes the test failure I'm seeing in another project. This is consistent with how we handle GDBusProxy objects in most of the rest of gvfs, but there are two places where they are leaked: 1. in g_proxy_volume_monitor_constructor(), but that object appears to be intended to live forever, so it's unclear what should be done there 2. in meta_tree_get_metadata_proxy(), but there the proxy is a static variable so it's unclear when it should be freed If you try to reproduce this leak, note that if gio takes its "lazy loading" code path in g_io_modules_scan_all_in_directory_with_scope(), this g_proxy_volume_monitor_register() function may not be executed. So I had to change an if condition so that we would always call g_type_module_use(). That lazy loading only happened when I built and installed gvfs myself rather than using the distribution's package. [1] https://gitlab.gnome.org/GNOME/glib/merge_requests/963
* build: Use path strings in include_directoriesIñigo Martínez2019-05-161-1/+1
| | | | | | | | | | Since meson 0.50.0, plain strings can be used rather than include directory objects[0]. Taking advantage of this feature, some include directory objects have been replaced. [0] http://mesonbuild.com/Release-notes-for-0-50-0.html#include_directories-accepts-a-string
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-211-3/+3
| | | | | | | | | Although usually directory variables are set by using the `prefix` directory, this might cause issues due to parameters that need relative directories. In order to ease the transition `prefix` directory has been stripped from directory variables and only has been appended when necessary.
* build: Fix the use of pkg-config file variablesIñigo Martínez2019-01-211-2/+2
| | | | | | | | | The names of the variables in meson corresponding to the variables obtained from the pkg-config files has been fixed by using a pattern. The pattern uses the dependency name as the prefix and the obtained variable as the suffix.
* build: Use / instead of join_pathsIñigo Martínez2019-01-211-1/+1
| | | | | | | Since meson 0.49, the `/` character can be used to join paths[0], so all the instances of `join_paths` have been replaced. [0] http://mesonbuild.com/Release-notes-for-0-49-0.html#joining-paths-with-
* build: Add trailing commasIñigo Martínez2019-01-211-9/+9
| | | | | | | Add missing trailing commas that avoids getting noise when another file/parameter is added and eases reviewing changes[0]. [0] https://gitlab.gnome.org/GNOME/dconf/merge_requests/11#note_291585
* Revert "build: Add trailing commas"Ondrej Holy2019-01-071-9/+9
| | | | This reverts commit f4ee93b06cfc4d9f727f9174e40d08097a25d571.
* Revert "build: Use / instead of join_paths"Ondrej Holy2019-01-071-1/+1
| | | | This reverts commit 9523d8e09e0088c8cd58ace494d47cc3083151fc.
* Revert "build: Fix the use of pkg-config file variables"Ondrej Holy2019-01-071-2/+2
| | | | This reverts commit 22e9f7721b891b17cd726f1bf92b15a35be34d22.
* Revert "build: Do not use prefix on directory variables"Ondrej Holy2019-01-071-3/+3
| | | | This reverts commit db31059d1b7b11b597b03064329fb1e8899b11f2.
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-041-3/+3
| | | | | | | | | Although usually directory variables are set by using the `prefix` directory, this might cause issues due to parameters that need relative directories. In order to ease the transition `prefix` directory has been stripped from directory variables and only has been appended when necessary.
* build: Fix the use of pkg-config file variablesIñigo Martínez2019-01-041-2/+2
| | | | | | | | | The names of the variables in meson corresponding to the variables obtained from the pkg-config files has been fixed by using a pattern. The pattern uses the dependency name as the prefix and the obtained variable as the suffix.
* build: Use / instead of join_pathsIñigo Martínez2019-01-041-1/+1
| | | | | | | Since meson 0.49, the `/` character can be used to join paths[0], so all the instances of `join_paths` have been replaced. [0] http://mesonbuild.com/Release-notes-for-0-49-0.html#joining-paths-with-
* build: Add trailing commasIñigo Martínez2019-01-041-9/+9
| | | | | | | Add missing trailing commas that avoids getting noise when another file/parameter is added and eases reviewing changes[0]. [0] https://gitlab.gnome.org/GNOME/dconf/merge_requests/11#note_291585
* meson: Fix typo in identificatorOndrej Holy2018-07-241-1/+1
| | | | | | | libgioremove_volume_monitor was used as identificator instead of libgioremote_volume_monitor. It is not problem, because the identificator is not used currently, but it might lead to further bugs.
* build: Add proper linker support checkIñigo Martínez2018-07-211-1/+1
| | | | | | | | Since meson 0.46[0], meson has added support for checking properly link flags support. `version-script` link flag check has been changed to take advantage of this support. [0] http://mesonbuild.com/Release-notes-for-0-46-0.html#new-functions-has_link_argument-and-friends
* monitor: Make MountOpReply2 interface expansiblewip/oholy/support-tcryptOndrej Holy2018-07-133-26/+51
| | | | | | | The newly introduced MountOpReply2 interface is not expansible and future changes would mean other complications. Let's make the interface expansible thanks to a{sv} expansion argument instead of adding new and new arguments and fallbacks...
* monitor: Remove unused variables from MountOpReplyDataOndrej Holy2018-07-131-9/+9
| | | | | The newly added MountOpReplyData contains variables which are not later used. Let's remove those unused variables.
* udisks2: Support TCRYPT devicessegfault2018-07-133-48/+161
| | | | | | | | Add support for unlocking TrueCrypt and VeraCrypt compatible (TCRYPT) volumes. Add a new MountOpReply2 method to the dbus interface, which handles the parameters required to unlock TCRYPT volumes.
* build: Remove autotoolsIñigo Martínez2018-04-061-90/+0
| | | | | | | To avoid the burden of maintaining multiple build systems, this patch removes autotools support. https://bugzilla.gnome.org/show_bug.cgi?id=786149
* Remove redundant gmodule.h includesOndrej Holy2018-04-031-1/+0
| | | | | | | | Our codes don't use GModule APIs directly, so there is no need for gmodule.h includes. GModule has been replaced by GIOModule in our codes long time ago. gmodule.h is included indirectly over gio.h anyway. https://bugzilla.gnome.org/show_bug.cgi?id=794365
* build: Revise dependenciesIñigo Martínez2018-04-031-3/+13
| | | | | | | | | | | | | | | gvfs is using a set of glib libraries (gio-2.0, gio-unix-2.0, glib, gobject-2.0) in almost all the created objects. However, these dependencies are not always necessary. gvfs' meson port also uses some internal dependencies formed by built libraries. This internal dependencies depend on other dependendecies as well. These both issues have been fixed by reviewing all the internal dependencies and built objects. https://bugzilla.gnome.org/show_bug.cgi?id=794365
* Add missing casts for g_object_refOndrej Holy2018-02-084-6/+6
| | | | | g_object_ref() currently propagates parameter type to its return value, so type casts needs to be added in order to prevent compiler warnings.
* proxy: Port GProxyDrive to GTaskOndrej Holy2017-11-281-225/+131
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* proxy: Port GProxyMount to GTaskOndrej Holy2017-11-281-69/+53
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* proxy: Port GProxyVolume to GTaskOndrej Holy2017-11-281-82/+49
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* build: Port to meson build systemIñigo Martínez2017-10-313-0/+75
| | | | | | | | meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools. https://bugzilla.gnome.org/show_bug.cgi?id=786149
* proxy: Fix shadow mount handling for equal pathsOndrej Holy2017-08-211-1/+2
| | | | | | | | | | | | Automatic shadow mount handling in some cases works currently only thanks to the bug in g_daemon_file_prefix_matches implementation, which I am going to fix. The problematic case is when activation_root is equal to mount_root (e.g. Nextcloud integration). The bug in _prefix_matches causes that it succeeds also if the paths are equal, but this is wrong as per the docs. Let's use also g_file_equal when looking for shadow mounts in order to fix this issue. https://bugzilla.gnome.org/show_bug.cgi?id=786217
* monitor: Mark error strings as translatableOndrej Holy2017-01-061-13/+13
| | | | | | | Error strings in gvfsproxyvolumemonitordaemon.c are not marked as translatable and thus it might be shown untranslated in UI, mark them. https://bugzilla.gnome.org/show_bug.cgi?id=776616
* monitor: Add g_drive_is_removable() supportOndrej Holy2016-05-202-1/+28
| | | | | | | | | | | | | | | Nautilus wants to show entries in the sidebar only for removable devices. It uses currently sort of conditions to determine which devices should be shown. Those condition fails in some cases unfortunatelly. Lets provide g_drive_is_removable() which uses udisks Removable property to determine which devices should be shown. It should return true for all drives with removable media, or flash media, or drives on usb and firewire buses. Add support for this property also in gvfs-mount tool. Bump GLib version accordingly. https://bugzilla.gnome.org/show_bug.cgi?id=765457
* Accept XDG_RUNTIME_DIR/bus as a valid D-Bus session/user busSimon McVittie2015-10-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. https://bugzilla.gnome.org/show_bug.cgi?id=756420
* proxy volume monitor: Properly handle failure to create a remote proxyDebarshi Ray2015-10-161-9/+6
| | | | | | | | | | | | We should finish constructing the innards of the object and not leave it in an inconsistent state when we hit an error. The other option would be to litter the rest of the code with NULL checks, but that would be ugly and prone to errors. We should also ensure that the reference counting stays consistent with the non-error paths. https://bugzilla.gnome.org/show_bug.cgi?id=755805
* proxy volume monitor: Guard access to the internal cachesDebarshi Ray2015-09-301-0/+8
| | | | | | | Accesses to the drives, volumes and mounts hash tables should be guarded by the proxy_vm mutex. https://bugzilla.gnome.org/show_bug.cgi?id=755805
* proxy volume monitor: Plug a memory leakMatthias Clasen2015-07-221-1/+4
| | | | | | | | valgrind pointed out a leak here, and indeed, g_mount_get_root() is documented as transfer full, so we should unref the GFile when we are done with it. https://bugzilla.gnome.org/show_bug.cgi?id=752689
* proxy volume monitor: Drop init warningOndrej Holy2015-03-191-1/+1
| | | | | | | | | | This caused make to fail e.g. in libgweather: (g-ir-compiler:11785): GVFS-RemoteVolumeMonitor-WARNING **: Error: The connection is closed kernel: traps: g-ir-compiler[4216] trap int3 ip:7f76f9fa2663 sp:7fff1e6a2d90 error:0 With gvfs-1.22.3 no error's https://bugzilla.gnome.org/show_bug.cgi?id=746398
* proxy volume monitor: Drop init warning if gvfs dbus service is not installedAlexander Larsson2015-02-201-1/+1
| | | | This caused make check to fail in gtk+
* build: Fix out of tree buildRoss Lagerwall2015-01-261-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=743551
* ProxyVolumeMonitor: Load list of installed remote monitors via dbusAlexander Larsson2015-01-261-1/+59
| | | | | | We used to just load the files from this, but that does not work in a sandboxed environment. For backwards compat we keep loading the old files if the dbus api is not implemented yet.
* Move proxy monitor implementation listing to commonAlexander Larsson2015-01-261-98/+12
| | | | | | | | Also add some to/from_dbus helpers. This is in preparation for moving the reading of the monitor files to the gvfs daemon, which is needed for the sandboxed case where the monitor files are not necessarily the same as the host installed ones.
* Do not call NULL callbacks in eject_wrapper_callback()Siteshwar Vashisht2015-01-161-1/+2
|
* proxy volume monitor: Fix invalid readRoss Lagerwall2014-04-101-2/+2
| | | | | | | | When g_bus_unwatch_name () is called, it frees the associated Client and so the name variable becomes invalid. So, ensure that nothing uses the name variable after this call. https://bugzilla.gnome.org/show_bug.cgi?id=710679
* gvfsproxyvolumemonitordaemon: Turn off debugColin Walters2013-11-031-1/+1
| | | | | | | | | | | | | | Now that dbus-activated session services have their stdout/stderr connected to the systemd journal (as of recent dbus), these debug messages now show up by default. The #define DEBUG_ENABLED was apparently turned on by accident in commit 8315eaf84e52c6a00a4905f1f6a73182db9e8015 - we can just turn it off again. (Why is this not just g_debug()? Who knows...) https://bugzilla.gnome.org/show_bug.cgi?id=711365
* GProxyVolume: extend the protocol so the volume monitor can force a call to ↵Giovanni Campagna2013-06-133-7/+28
| | | | | | | | | | | Mount Some volume monitors, like gnome-online-accounts, want their mount implementation to be called even though the volume has an activation root. Allow them to advertise so using the expansion fields of the volume DBus representation. https://bugzilla.gnome.org/show_bug.cgi?id=696279
* Use g_list_free_full() where applicableTomas Bzatek2013-01-172-36/+12
|
* proxy volume monitor: Remove unnecessary gotoTomas Bzatek2012-12-101-9/+2
| | | | | A matter of developer's taste, but since the function has been simplified a lot, no need to keep the goto around.
* proxy volume monitor: Don't leak the_volume_monitors hash tableTomas Bzatek2012-12-101-1/+2
| | | | | | | | | The the_volume_monitors hash table is a shared global instance, make sure to only initialize it once. Based on a patch by Tim Lunn <tim@feathertop.org> https://bugzilla.gnome.org/show_bug.cgi?id=689946
* proxy volume monitor: Clarify when mutex is hold on constructionTomas Bzatek2012-12-101-0/+1
| | | | | | Found by reviewing usage of the global lock, this place is not obvious whether is inside the lock or not. Let's add a simple comment to make it clear.
* proxy volume monitor: Get session bus on demandTomas Bzatek2012-11-013-37/+16
| | | | | | | | | | | Do not connect to session bus at module load, let proxies to get a bus when needed. No need to keep it active all the time. Proxies will return an error when a bus is unavailable. Also don't close the shared d-bus connection on module unload, let it be managed by proxies. https://bugzilla.gnome.org/show_bug.cgi?id=687074
* proxy volume monitor: Don't disable exit_on_close on session busTomas Bzatek2012-11-011-1/+0
| | | | | | | We're on shared session bus, let's exit when connection closes (usually tied to running desktop session). https://bugzilla.gnome.org/show_bug.cgi?id=687074
* Remove calls to g_type_init(), bump GLib required versionColin Walters2012-10-301-2/+0
| | | | | | See http://git.gnome.org/browse/glib/commit/?id=2002479c02fa6e468fc3f67ddc663657a52ebde8 https://bugzilla.gnome.org/show_bug.cgi?id=687236