summaryrefslogtreecommitdiff
path: root/client
Commit message (Collapse)AuthorAgeFilesLines
* client: Prevent socket leaks if socket dir is inaccessibleOndrej Holy2021-04-151-13/+75
| | | | | | | | | | | | | GVfs fallbacks to session bus if it is not possible to establish peer-to-peer connection (e.g. inside Flatpak sandbox). However, the DBus server is not terminated and the socket is leaked. The named sockets are counted as open files, so it can easily lead to "Too many open files" errors. Let's fallback to the session bus immediately if the socket dir is not accessible to prevent the leaks. This should fix the most common case, when the sockets are leaked. Fixes: https://gitlab.gnome.org/GNOME/gvfs/-/issues/542
* client: Skip session bus fallback if operation was cancelledOndrej Holy2020-12-184-3/+27
| | | | | | | | Recently added warnings when peer-to-peer connection fails (commit 60ca0cea) makes visible old bug that the session bus fallback is tried regardless of the fact that the operation was cancelled. Let's stop the operation immediately when G_IO_ERROR_CANCELLED is returned and don't print the warnings in this case.
* client: Add fallback to session bus also for synchronous APIOndrej Holy2020-12-083-11/+30
| | | | | | Asynchronous API fallbacks to session bus when peer-to-peer connection fails, however, synchronous API fails in the same case. Let's add fallback to session bus also for the synchronous case.
* client: Show warning when peer-to-peer connection failedOndrej Holy2020-12-084-8/+33
| | | | | | | When peer-to-peer connection fails, the session bus is silently used instead by the asynchronous API. Let's add warnings to make it more obvious and mention that --filesystem=xdg-run/gvfsd is probably missing.
* gvfsiconloadable: Fallback to session bus when peer-to-peer failsOndrej Holy2020-12-081-13/+45
| | | | | | g_vfs_icon_load_async fails if peer-to-peer connection can't be establised. Let's add fallback to session bus as it is implemented already on other places.
* trash: Do not fail when G_FILE_COPY_NO_FALLBACK_FOR_MOVE is usedwip/oholy/trash-performanceOndrej Holy2020-09-241-8/+0
| | | | | | | | | | | | | | Restoring files from the trash folder is slow in Nautilus as it attempts to do it recursively. This is because G_IO_ERROR_NOT_SUPPORTED is returned from g_file_move when G_FILE_COPY_NO_FALLBACK_FOR_MOVE flag is used. The error is returned from client-side for pull/push operations after commit 2e765449 as in the most cases the copy-and-delete approach is really used there. But the problem is that it is not in all cases, like in the trash backend case, where the native move operation is used in fact. Let's handle the G_FILE_COPY_NO_FALLBACK_FOR_MOVE flag directly in the backends, but not in the trash backend. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1589
* build: Link libgvfscommon to libmetadataIñigo Martínez2020-08-111-1/+0
| | | | | | | | `gvfsd-metadata` uses the `gvfs_randomize_string` function by including `gvfsutils.h` header file from `libgvfscommon`. However, the library is not linked, only the directory is included. This has been fixed by linking `libgvfscommon` to `libmetadata`.
* client: Add support for zone identifiers in IPv6 addressesOndrej Holy2020-06-301-1/+15
| | | | | | | | | | | | | | | | | The IPv6 addresses with zone identifiers are refused by GVfs currently. THis is because of g_uri_unescape_segment failure as RFC 4007 allows bare % sign to be used as separator. Although, RFC 6874 tries to fix that by the %25 separator, however, at the same time, it suggests that the bare % sign should still be accepted in user interfaces. But this would make this too complex and lead to various problems (e.g. it would not be clear what separator should be used for g_file_get_uri function). So I intentionally don't plan to support what is suggested by RFC 6874 for now, which effectively means that zone identifiers with non-ASCII chars won't be supported. Let's skip the g_uri_unescape_segment function for IPv6 address and also fix the gvfs_is_ipv6 function in order to accept the zone identifiers... Fixes: https://gitlab.gnome.org/GNOME/gvfs/-/issues/483
* fuse: Reopen file and skip to desired offset if seek is not supportedOndrej Holy2020-01-291-0/+8
| | | | | | | | | | The fuse daemon can fail when client attempts to seek backwards and seek is not supported by the concrete backend. There is fallback for forward seeks using `g_input_stream_skip`. Let's reopen the file and use the same approach also for backwards seeks. This is pretty ugly to reopen the file but similar approach is used already to emulate read/write mode. Fixes: https://gitlab.gnome.org/GNOME/gvfs/issues/441
* fuse: Prevent abortions if modified time is not setOndrej Holy2020-01-141-3/+7
| | | | | | If `G_FILE_ATTRIBUTE_TIME_MODIFIED` is not set for some reason, the fuse daemon aborts as it expects that it is always set. Let's use g_file_info_has_attribute to prevent the crashes.
* gdbus: Add workaround for deadlocks when cancelling jobsOndrej Holy2019-11-111-4/+25
| | | | | | | | | | | | | | | GVfs calls gvfs_dbus_daemon_proxy_new() in cancelled signal handler which internally needs CONNECTION_LOCK(connection). The lock can be unfortunately held by gdbus worker thread which can call g_cancellable_disconnect(). This obviously leads to deadlocks. I don't see any reason why we have to block g_cancellable_disconnect() because of gvfs_dbus_daemon_proxy_new() resp. gvfs_dbus_daemon_call_cancel(). Let's call it over idle source to not block the cancelled signal handler in order to prevent the deadlocks. It would be better to fix this issue directly in gdbus codes, however, it is not fully clear to me, what is a proper way to fix this. https://gitlab.gnome.org/GNOME/glib/issues/1023
* fuse: Remove usage of deprecated GTimeValOndrej Holy2019-09-201-8/+5
| | | | | GTimeVal is deprecated. Let's remove it in order to prevent the deprecation warnings.
* fuse: cleanup {read,write}_stream functionsPeter Keresztes Schmidt2019-08-081-51/+23
| | | | | | Remove unnecessary while loop since g_input_stream_read_all and g_output_stream_write_all guarantee that all data is read/written when exiting successfully.
* fuse: Remove max_write limitPeter Keresztes Schmidt2019-08-081-4/+0
| | | | | | | | | | Since we moved to fuse 3 big_writes are enabled by default. There is no need to manually specify max_write anymore since the set value is actually smaller than the libfuse default. Let libfuse figure out the right value. This increses the transfer speed from 31MiB/s to 43MiB/s between my system and a SMB share.
* fuse: Define RENAME_* macros when they are not definedTing-Wei Lan2019-07-101-0/+8
| | | | | | These macros exist in Linux headers, but they don't exist on FreeBSD. Since fuse library always uses the same values regardless of the platform, we just define them ourselves when they aren't defined.
* fuse: Adapt gvfsd-fuse to use fuse 3.xXi Ruoyao2019-04-041-33/+81
| | | | | | | | | | Gvfsd-fuse required the old 2.x versions of fuse. Fuse developers encourage developers to transition to the actively developed libfuse 3.x. This change adapt gvfsd-fuse to build with fuse 3.x. Note that fuse is no longer compatible with fuse 2.x. It now requires fuse 3.0.0 or later to build. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/323
* client: Fix mount info cache invalidationOndrej Holy2019-03-042-28/+30
| | | | | | | | | | | | | Mount info cache invalidation is not handled properly and thus client can get "Cache invalid, retry (internally handled)" internal error, which should not be passed to the client. This can happen if mount was unmounted and another mount for the some location is mounted. This is now more common with introducing stable URIs for MTP backend. G_VFS_ERROR_RETRY error handling was probably lost as a consequence of GDBus port by commit 622a5c0d. Let's retry the operation internally again if G_VFS_ERROR_RETRY is returned. https://gitlab.gnome.org/GNOME/gvfs/merge_requests/30
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-211-2/+2
| | | | | | | | | 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-3/+3
| | | | | | | | | 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-3/+3
| | | | | | | 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-11/+11
| | | | | | | 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-11/+11
| | | | This reverts commit f4ee93b06cfc4d9f727f9174e40d08097a25d571.
* Revert "build: Use / instead of join_paths"Ondrej Holy2019-01-071-3/+3
| | | | This reverts commit 9523d8e09e0088c8cd58ace494d47cc3083151fc.
* Revert "build: Fix the use of pkg-config file variables"Ondrej Holy2019-01-071-3/+3
| | | | This reverts commit 22e9f7721b891b17cd726f1bf92b15a35be34d22.
* Revert "build: Do not use prefix on directory variables"Ondrej Holy2019-01-071-2/+2
| | | | This reverts commit db31059d1b7b11b597b03064329fb1e8899b11f2.
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-041-2/+2
| | | | | | | | | 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-3/+3
| | | | | | | | | 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-3/+3
| | | | | | | 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-11/+11
| | | | | | | 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
* 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
* build: Remove autotoolsIñigo Martínez2018-04-062-103/+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-032-2/+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-9/+14
| | | | | | | | | | | | | | | 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
* build: Improve installation on system pathsIñigo Martínez2017-10-311-3/+2
| | | | | | | | | | | | Instead of being hardcoded, D-Bus, systemd and GIO modules paths can be checked by using the information in their correspondant pkg-config files. This patch uses the information on pkg-config files by default, and also allows the user to provide this information to avoid overwriting system files. https://bugzilla.gnome.org/show_bug.cgi?id=786149
* build: Port to meson build systemIñigo Martínez2017-10-313-0/+109
| | | | | | | | 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
* daemon: Avoid overflowing when querying for filesystem infoMichael Terry2017-08-211-1/+4
| | | | | | | Filesystem sizes can be large and in danger of overflowing. Guard against that possibility in the dav and fuse FS query code. https://bugzilla.gnome.org/show_bug.cgi?id=786177
* gdaemonfile: Fix g_file_equal for different mount_prefixOndrej Holy2017-08-211-2/+6
| | | | | | | | | | g_daemon_file_equal() always return FALSE for files with different mount_prefix even though the files can be equal. It happen when comparing two files from different origins, e.g. g_mount_get_root() and g_file_new_for_uri(). Let's do the same which is done in _prefix_matches and _get_relative_path in order to fix this issue. https://bugzilla.gnome.org/show_bug.cgi?id=786217
* gdaemonfile: Fix relative path handlingOndrej Holy2017-08-211-53/+15
| | | | | | | | | | | | | | | | | | g_daemon_file_get_relative_path() fails for files with different mount_prefix and always return NULL. It happen when comparing two files from different origins, e.g. g_mount_get_root() and g_file_new_for_uri(). On the other hand, g_daemon_file_prefix_matches() can succeed in cases, where paths don't have the same prefixes, because it just compares mount_prefix of a parent with a path of a descendant, but a path of the parent is ignored. The code concatenates mount_prefix with a path, so the comparison never succeeds if mount_prefix is set, because mount_prefix is already part of the path in GDaemonFile. Let's ignore mount_prefix when comparing and always compare the paths, so we can significantly simplify the code. https://bugzilla.gnome.org/show_bug.cgi?id=786217
* client: Fix crash when calculating a relative pathMichael Terry2017-08-211-1/+1
| | | | | | Fix an if condition that resulted in trying to strdup(0x1). https://bugzilla.gnome.org/show_bug.cgi?id=786217
* gdaemonfileenumerator: Marginally simplify the codeDebarshi Ray2017-08-071-4/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=747412
* gdaemonfileenumerator: Fix crashes in synchronous enumerator codeOndrej Holy2017-07-241-2/+6
| | | | | | | | | | | | Commit 2eae108 ported the code to GTask and slightly changed processing. The changes trigger the following criticals and cause crashes of some applications (e.g. Firefox, Thunderbird). GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Return TRUE from signal handlers in order to prevent further processing of the invocations, which cause the mentioned issues. https://bugzilla.gnome.org/show_bug.cgi?id=784953
* client: Port GDaemonFileEnumerator to GTaskOndrej Holy2017-06-141-95/+95
| | | | | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. "changed" signal is added in order to allow splitting _sync and _async code paths to use GTask as user_data for _async functionality. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* Do not sent user invisible mounts if not neededOndrej Holy2017-06-061-16/+10
| | | | | | | | | | | g_volume_monitor_get() might be really slow if there is too many mounts, because the list of the mounts is send over D-Bus. It can simply happen due to user invisible mounts, e.g. http. User invisible mounts are ignored by the volume monitor, so it is useless to send them over D-Bus. Improve the D-Bus API and don't send the user invisible mounts if it is not needed. https://bugzilla.gnome.org/show_bug.cgi?id=775600
* client: Remove obsolete GSimpleAsyncResult helpersOndrej Holy2017-03-282-38/+0
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* fuse: Prevent potential crash if file handle is not setOndrej Holy2017-03-231-1/+1
| | | | | | File handle may be NULL, so it has to be checked before dereferencing. This issue was revealed by coverity scan.
* client: Ignore everything after first colon in userinfoOndrej Holy2017-02-131-2/+17
| | | | | | | | | | Use of the format "user:password" in the userinfo field is deprecated and applications should not render as clear text any data after the first colon as per rfc3986. Passwords have never been handled in userinfo fields by GVfs, however, they are still part of the usernames, which is wrong. Let's ignore such data in userinfo fileds. https://bugzilla.gnome.org/show_bug.cgi?id=628430
* client: Port GDaemonFileOutputStream to GTaskOndrej Holy2017-02-071-201/+95
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* client: Do not leak GDBusConnection referenceOndrej Holy2017-02-072-0/+2
| | | | | | | | | async_construct_proxy() calls g_object_ref() on connection, because the connection is unrefed by async_call_finish(). The returned connection might be NULL in some cases and g_bus_get() is called instead. However, g_bus_get_finish() is "transfer full" and thus one reference is leaked. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* client: Propagate error from create_mount_tracker_proxyOndrej Holy2017-01-261-9/+10
| | | | | | Prevent GDaemonFile methods failures without error being set. https://bugzilla.gnome.org/show_bug.cgi?id=777737
* client: Do not modify caller's errorsOndrej Holy2017-01-243-3/+2
| | | | | | | Caller's errors are modified by g_dbus_error_strip_remote_error. Strip the dbus error in the caller directly. https://bugzilla.gnome.org/show_bug.cgi?id=747412