summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* daemon: Create socket dir from gvfsd daemonOndrej Holy2021-04-152-0/+7
| | | | | | | | | | | Recently, GVfs switched from abstract sockets to named sockets. The socket dir is currently created by the individual daemons immediately before starting DBus server. If gvfsd-admin is started at first, the socket dir is owned by root user and thus it isn't accesible for other daemons and clients. Let's create the socket dir early from the gvfsd daemon to ensure correct ownership. https://gitlab.gnome.org/GNOME/gvfs/-/issues/552
* client: Add support for zone identifiers in IPv6 addressesOndrej Holy2020-06-301-10/+1
| | | | | | | | | | | | | | | | | 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
* dnssd: Prevent crashes after releasing resolverOndrej Holy2020-01-271-2/+6
| | | | | | | | | | | | | | | | | | | | The following error often happens when mounting dav+sd share (e.g. created over gnome-user-media) and the mount operation fails for some reason: dbus[47482]: arguments to dbus_connection_unref() were incorrect, assertion "connection->generation == _dbus_current_generation" failed in file ../../dbus/dbus-connection.c line 2823. This is normally a bug in some application using the D-Bus library. This is because avahi is not thread-safe and our resolver doesn't use mutexes. But it seems to me that mutexes are not necessarily needed if everything would work as expected. Unfortunately, changes made by commit 3384af8 causes that start_avahi_resolver is being called multiple times by mistake, which also calls avahi_service_resolver_new multiple times. Consequently, it may crash when resolver is beeing freed too early as there might still be unexpected pending operations using avahi client. Fixes: GNOME/gvfs#449
* dnssd: guard avahi_client_free to prevent freeing NULLTobias Mueller2019-11-271-1/+4
| | | | | | | This should not happen, but somehow the global_client ends up being NULL. In daemon/gvfsbackenddnssd.c the call to avahi_client_free in the finalize function is similarly guarded.
* common: Add interface property for GVfsDnsSdResolverOndrej Holy2019-10-112-0/+53
| | | | | | GVfsDnsSdResolver doesn't store interface for the resolved service, however, we need this for link-local address support. Let's add the missing bits for it.
* gmountsource: Fix deadlocks in synchronous APIwip/oholy/gmountsource-deadlockOndrej Holy2019-04-091-39/+29
| | | | | | | | | | | | Synchronous GMountSource API is implemented using the asynchronous API with help of mutexes and conditions. But it seems that it is not guaranteed that GAsyncReadyCallback is called on another thread and thus this solution may cause deadlocks consequently. Let's rather use solution based on custom mainloop to prevent potential deadlocks. Alternatively, we could use synchronous API generated by gdbus-codegen to implement this functionality, but the solution with custom mainloop seems to be less error-prone. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/383
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-211-1/+1
| | | | | | | | | 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: Remove gdbus codegen workaroundIñigo Martínez2019-01-211-10/+6
| | | | | | | | | | | When gvfs was ported to meson `gdbus-codegen` was not able to generate the source and header files independently, and this caused issues on highly parallelized build. To avoid this issue a workaround was placed by using an external script. However, recently glib and meson acquired support for generating source and header files independently, so the workaround has been removed.
* build: Add trailing commasIñigo Martínez2019-01-211-15/+15
| | | | | | | 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-15/+15
| | | | This reverts commit f4ee93b06cfc4d9f727f9174e40d08097a25d571.
* Revert "build: Remove gdbus codegen workaround"Ondrej Holy2019-01-071-6/+10
| | | | This reverts commit 32bde011b2522d302d72506884866bd809ef5bda.
* Revert "build: Do not use prefix on directory variables"Ondrej Holy2019-01-071-1/+1
| | | | This reverts commit db31059d1b7b11b597b03064329fb1e8899b11f2.
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-041-1/+1
| | | | | | | | | 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: Remove gdbus codegen workaroundIñigo Martínez2019-01-041-10/+6
| | | | | | | | | | | When gvfs was ported to meson `gdbus-codegen` was not able to generate the source and header files independently, and this caused issues on highly parallelized build. To avoid this issue a workaround was placed by using an external script. However, recently glib and meson acquired support for generating source and header files independently, so the workaround has been removed.
* build: Add trailing commasIñigo Martínez2019-01-041-15/+15
| | | | | | | 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
* common: Prevent crashes on invalid autorun fileOndrej Holy2018-10-261-1/+1
| | | | | | | | GRegex expects valid UTF-8 input by default and libpcre may crash if it is not valid. GRegex is used to parse autorun file, which doesn't have to be always valid. Let's use G_REGEX_RAW to prevent the crashes. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/344
* build: Remove autotoolsIñigo Martínez2018-04-061-95/+0
| | | | | | | To avoid the burden of maintaining multiple build systems, this patch removes autotools support. https://bugzilla.gnome.org/show_bug.cgi?id=786149
* build: Revise dependenciesIñigo Martínez2018-04-031-13/+33
| | | | | | | | | | | | | | | 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: Apply a workaround for D-Bus code generationIñigo Martínez2018-03-261-6/+12
| | | | | | | | | | | | | | | | | meson uses `gdbus-codegen` for D-Bus code generation. However, both files are generated implicitly, so meson is not able to know how many files are generated, so it does generate only one opaque target that represents the two files. A new script has been created only to call `gdbus-codegen` and simulate the generation of the source code and header as different targets. Please see: https://bugzilla.gnome.org/show_bug.cgi?id=791015 https://github.com/mesonbuild/meson/pull/2930 https://bugzilla.gnome.org/show_bug.cgi?id=794365
* build: Reorder meson options and update descriptionOndrej Holy2017-10-311-2/+2
| | | | | | | | meson_options.txt is hard to read. Let's create sorted groups of options and unify the description. Also change some option names to match correspoding backend names. https://bugzilla.gnome.org/show_bug.cgi?id=786149
* build: Port to meson build systemIñigo Martínez2017-10-312-1/+103
| | | | | | | | 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
* Do not sent user invisible mounts if not neededOndrej Holy2017-06-063-7/+45
| | | | | | | | | | | 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: Use g_cond_wait in a loopOndrej Holy2017-05-231-5/+8
| | | | | The documentation says that g_cond_wait() must always be used in a loop, but it isn't in some cases. Let's fix it.
* common: Port GVfsMountInfo to GTaskOndrej Holy2017-03-281-198/+100
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* common: Fix potential crash caused by missing g_strdupOndrej Holy2017-03-281-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=747412
* common: Fix memory leakOndrej Holy2017-03-281-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=747412
* gphoto2: Fix x-content-types setupOndrej Holy2017-03-232-0/+13
| | | | | | | | Commit 60f96c8 broke x-content-types setup, because is_media_player is always FALSE. Let's introduce g_vfs_backend_set_x_content_types helper and set x-content-types properly. This issue was revealed by coverity scan.
* Fix compilationOndrej Holy2017-01-101-1/+1
| | | | | | | | Commit 8f86396 has been pushed recently, but long time after review and another change was made in the meantime, which causes compilation failures currently. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* Remove some leftover dead codeChristian Kellner2017-01-091-4/+1
| | | | | | | Porting from GSimpleAsyncResult to GTask resulted in a tiny amount of dead code. Remove that. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* client: Escape ":[]" chars in host if it is not IPv6Ondrej Holy2016-12-122-0/+22
| | | | | | | | | | | The "[]:" chars are omitted currently when encoding uri, because they are valid for IPv6. This causes problems in some cases, e.g. output from g_file_get_uri(g_file_new_for_uri("dav+sd://foo%3Abar._webdav._tcp.local")) is "dav+sd://foo:bar._webdav._tcp.local/", which is obviously wrong. Add gvfs_is_ipv6 in order to detect IPv6 addresses and encode also "[]:" chars in other cases. Use gvfs_is_ipv6 to detect IPv6 also in some backends. https://bugzilla.gnome.org/show_bug.cgi?id=772849
* dnssd: Return error instead of abortOndrej Holy2016-12-121-0/+8
| | | | | | | | gvfsd-dnssd aborts currently if invalid encoded triple is provided and g_vfs_dns_sd_resolver_resolve is called. Return error instead of abort. https://bugzilla.gnome.org/show_bug.cgi?id=772849
* gmountsource: Return "aborted" flag consistentlyOndrej Holy2016-11-011-2/+2
| | | | | | | | | | | | | "aborted" flag is not returned consistently from the following functions if the async reply containes an error: g_mount_source_show_processes, g_mount_source_ask_question, and g_mount_source_ask_password. Set "aborted" always on TRUE if an error occurs. This change should not affect current functionality, because the usual workflow is the following: if (!g_mount_source_ask_password (..., &aborted, ...) || aborted) ... https://bugzilla.gnome.org/show_bug.cgi?id=747412
* common: Port GMountSource to GTaskOndrej Holy2016-11-011-101/+96
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* common: Port GVfsDnsSdResolver to GTaskOndrej Holy2016-10-261-54/+40
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* Drop hal volume monitor and fallback code in gphoto2 and cdda backendMichael Biebl2016-10-193-590/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=770671
* Use Unicode in translatable stringsPiotr Drąg2016-10-033-8/+8
| | | | | | See https://developer.gnome.org/hig/stable/typography.html https://bugzilla.gnome.org/show_bug.cgi?id=772219
* common: Handle mount_prefix by g_mount_spec_setOndrej Holy2016-08-291-0/+7
| | | | | | | | | | | | mount_prefix is set to the value "/export" if you e.g. call the following: gvfs-mount nfs://localhost/export Unfortunatelly, it is not possible to execute backend manually with a concrete mount_prefix. Handle key "prefix" as mount_prefix, so you can now execute backend manually with prefix, e.g.: /usr/libexec/gvfsd-nfs host=localhost prefix=/export https://bugzilla.gnome.org/show_bug.cgi?id=770545
* common: Check BDMV folder before libblueray usageOndrej Holy2016-06-221-0/+11
| | | | | | | | | | | | | You can see the following errors from libblueray if you insert non-blueray disk: disc.c:350: error opening file BDMV/index.bdmv disc.c:350: error opening file BDMV/BACKUP/index.bdmv Unfortunately bd_set_debug_mask is not part of public API, so we have no control over the output. Let's do not use any libblueray API functions if BDMV dir does not exists to avoid such errors. https://bugzilla.gnome.org/show_bug.cgi?id=767909
* daemon: Allow toggling debug output with SIGUSR2Ross Lagerwall2016-01-182-0/+43
| | | | | | | | | | | | With dbus hooked up to systemd, it can be useful to toggle debug output on/off for a running daemon. Respond to SIGUSR2 by toggling debug output. E.g. to toggle and then watch debug output on a running sftp mount: $ pkill -USR2 gvfsd-sftp $ journalctl -f https://bugzilla.gnome.org/show_bug.cgi?id=740660
* mtp: Use phone icon for MTP devicesOndrej Holy2015-12-111-2/+2
| | | | | | | Majority of MTP devices are mobile phones nowadays. Use "phone" icon for them instead of "multimedia-player" icon to reflect this trend. https://bugzilla.gnome.org/show_bug.cgi?id=759042
* Accept XDG_RUNTIME_DIR/bus as a valid D-Bus session/user busSimon McVittie2015-10-262-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* common: Fix possible crash with blank disksBastien Nocera2015-06-161-0/+8
| | | | | | Never call bd_open() with an empty path. https://bugzilla.gnome.org/show_bug.cgi?id=749093
* client: Suppress errors if daemon part is missingOndrej Holy2015-06-081-1/+1
| | | | | | | | | | | | We want to split gvfs package on client and daemon part due to app sandboxing. Return FALSE from vfs_is_active if there aren't any supported uri schemes (i.e. deamon part is missing). It will cause things to work just like if the gvfs client part was never installed. Replace some warnings/errors by g_debug to suppress errors when registering gio modules and daemon part is missing. https://bugzilla.gnome.org/show_bug.cgi?id=750401
* build: Remove libbluray dependencyOndrej Holy2015-05-291-2/+1
| | | | | | Commit 6cbe00d removed gvfsmountinfo.c from common shared library, however libbluray dependency wasn't removed. Remove the dependency by this patch.
* Fix build error when using HAL backendTing-Wei Lan2015-04-023-0/+590
| | | | | | gvfsdbusutils.[ch] are renamed to gvfshalutils.[ch] to prevent confusion. https://bugzilla.gnome.org/show_bug.cgi?id=722411
* dnssd: Run GSimpleAsyncResult completion in idleRoss Lagerwall2015-03-141-4/+4
| | | | | | | | | | | | g_simple_async_result_complete should only be used from the thread on which the callback should be invoked. Also, the gvfs job threads do not have their own GMainContexts which causes an assertion failure [1] when invoking g_simple_async_result_complete. Instead, use g_simple_async_result_complete_in_idle(). [1] (process:11772): GLib-CRITICAL **: g_main_context_push_thread_default: assertion 'acquired_context' failed https://bugzilla.gnome.org/show_bug.cgi?id=629345
* dnssd: Remove recursive main loopRoss Lagerwall2015-03-141-15/+16
| | | | | | | Don't run a recursive main loop on a separate thread with a shared GMainContext. https://bugzilla.gnome.org/show_bug.cgi?id=629345
* dnssd: Prevent crash when resolving serviceRoss Lagerwall2015-03-141-39/+19
| | | | | | | | | | | | | | | AvahiClient appears to require that avahi_service_resolver_new is invoked from the same thread to which its poll function is bound otherwise it can crash with a callback running while avahi_service_resolver_new is still busy. To fix this, always run avahi_service_resolver_new from the main loop. To simplify the code, any errors from the function are ignored for now. This crash could be reproduced 100% of the time by trying to mount dav+sd (via gnome-user-share) in a single-CPU VM. https://bugzilla.gnome.org/show_bug.cgi?id=629345
* common: Increase mount timeout to 30 minutesRoss Lagerwall2015-03-112-6/+7
| | | | | | | | | Although it is probably unnecessary, wait up to 30 minutes for a mount to complete. This allows plenty of time to wait for a password dialog. It also makes it more consistent with many of the other operations which use a timeout of 30 minutes. https://bugzilla.gnome.org/show_bug.cgi?id=594500
* daemon: Move random string generation into shared libRoss Lagerwall2015-02-093-0/+73
| | | | | | | Random string generation is used in a few different places, so share the implementation. https://bugzilla.gnome.org/show_bug.cgi?id=738967