summaryrefslogtreecommitdiff
path: root/monitor
Commit message (Collapse)AuthorAgeFilesLines
* goa: Prevent automounts when resuming from suspensionOndrej Holy2022-07-011-2/+0
| | | | | | | | | | | | When on WiFi, the NextCloud account is automatically mounted after resuming from suspension. This is because the `Account.AttentionNeeded` property changes its value and GOA volume monitor calls mount operation in that case. It is not obvious to me why this code is here. Also this is maybe bug on GOA side. But anyway, other backends simply just unmount when something changes, but don't mount again automatically. I suppose we should do the same here as well to avoid these unwanted automounts. Fixes: https://gitlab.gnome.org/GNOME/gvfs/-/issues/634
* build: Use dictionary for easier unpackIñigo Martínez2021-10-251-10/+10
| | | | | | | | | Dictionaries can be used to ease `foreach` statements due to their natural unpacking system[0]. This system has been used to ease some loops. [0] https://mesonbuild.com/Syntax.html#foreach-with-a-dictionary
* Add PartOf= to all systemd unitsHenri Chain2021-10-015-0/+5
| | | | | | | | | | | | | The `PartOf` directive sets up a one-way dependency between `graphical-session.target` and our services, so that when `graphical-session.target` is stopped or restarted, our services also get stopped or restarted. This ensures that gvfs daemons that were started in the context of a GUI login session (through dbus activation) do not continue to run after the user has logged out. See `systemd.unit(5)` for more info.
* Move systemd services to session sliceHenri Chain2021-10-015-0/+5
| | | | | | | | | | | | | | | | This puts all gvfs systemd services (which are all dbus-activated through `SystemdService=`) inside of the `session` slice that was introduced in v249 (https://github.com/systemd/systemd/pull/16603) and described in https://systemd.io/DESKTOP_ENVIRONMENTS/ and `systemd.special(7)` This allows sysadmins or OS integrators to assign higher-priority `systemd.resource-control(5)` on `session.slice` and have it propagate down to important session services such as gvfs, so that the gvfs daemons receive sufficient priority for resource allocations to keep the session running smoothly under load. Note that it still works on older systemd (the slice, which is just a cgroup inner directory, is created on demand)
* udisks2: Report unmount progress after showing blocking processesDamjan Jovanovic2021-03-191-11/+3
| | | | | | | | | | | | | | | The "show-unmount-progress" signal isn't emitted when unmounting is successful while the "show-processes" dialog is open. The "aborted" signal is sent to close the dialog, not to indicate an error, and shouldn't be taken into consideration when deciding whether to emit "show-unmount-progress". Further details on the bug report. Get gvfs_udisks2_unmount_notify_stop() to send "show-unmount-progress" whether there was a prior "aborted" or not. Closes https://gitlab.gnome.org/GNOME/gvfs/-/issues/546
* Drop use of volatile qualifierOndrej Holy2021-02-122-2/+2
| | | | | | | GVfs build with --werror fails currently because of glib!1719. Let's drop the volatile qualifier as it doesn't help with atomicity anyway. Relates: https://gitlab.gnome.org/GNOME/glib/-/issues/600
* Use shorter strings for prompt dialog titlesJonas Dreßler2021-01-151-4/+5
| | | | | | | | | | | | | The layout of the modal dialogs in gnome-shell changed [1] and the title now is larger and uses the style of a headline. Make sure all titles remain fully visible and use shorter strings for those. Also unify the generic "Enter password" strings a bit to make work easier for translators and use this string for most cases: "Authentication Required\nEnter password for “%s”:" [1] https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343
* udisks2: Replace custom code by g_unix_mount_point_atOndrej Holy2020-08-051-32/+1
| | | | | The newly introduced g_unix_mount_point_at can be used to replace custom code.
* udisks2: Fix leaks of drive icons/descriptionOndrej Holy2020-03-061-0/+3
| | | | | | | | Drive icons/description are leaked currently when also media icon/description is available. Let's add missing `g_clear_object` resp. `g_free` calls to fix those leaks. https://gitlab.gnome.org/GNOME/gvfs/issues/452
* udisks2: Fix leak when updating fstab volumesOndrej Holy2020-03-061-1/+1
| | | | | | | | `g_list_remove_link` is used when filtering out mountpoints, but the GList element is not consequently freed. Let's use `g_list_delete_link` to not leak that element. https://gitlab.gnome.org/GNOME/gvfs/issues/452
* goa: Add support for certificate promptsOndrej Holy2020-01-291-2/+96
| | | | | | | | | | Since commit f5ee590e, it is not possible to access Nextcloud/ownCloud shares with self-signed (or invalid) certificates. This is because the mount operation is handled by GOA volume monitor and the prompt to accept certificate is not shown. Let's update the volume monitor to handle just passwords and show the prompt to the client. Fixes: https://gitlab.gnome.org/GNOME/gvfs/issues/251
* afc: Use g_debug() instead of g_print() for log outputSam Thursfield2019-08-082-4/+4
| | | | | | | Daemons shouldn't be printing directly to stdout, but should be using the normal GLib logging system. The messages output by this daemon will not show by default, but setting `G_MESSAGES_DEBUG=GVFS-AFC` in the environment will cause them to appear.
* udisks2: Change display name for crypto_unknown devicessegfault2019-07-251-4/+14
| | | | | | | | | | | | The udisks id_type crypto_unknown is used for devices which are possibly encrypted. In udisks, this uncertainty is conveyed to the user by using the long name "Possibly encrypted", and the short name "Encrypted?". GVfs used to display all devices with id_usage == "crypto" as "Encrypted". This commit instead uses the string "Possibly Encrypted" if id_type == "crypto_unknown".
* build: Remove `rpath` parameterIñigo Martínez2019-07-195-5/+0
| | | | | | | | Target executables used as monitors do not depend on `libgvfscommon` or `libgvfsdaemon`, which are `gvfs` libraries installed outside of the default library directory. Due to this reason, they don't need to set `rpath` parameter.
* 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: Add dependency on gsettings-desktop-schemasOndrej Holy2019-07-111-0/+1
| | | | | | | | Lockdown settings provided by gsettings-desktop-schemas are used in the code, however, gsettings-desktop-schemas dependency is missing, which can lead to "Settings schema 'org.gnome.desktop.lockdown' does not contain a key named 'disable-writing-to-devices'" errors. Let's add the dependency to prevent such errors.
* udisks2: Handle lockdown option to disable writingOndrej Holy2019-07-113-0/+43
| | | | | | Handle the new mount-removable-storage-devices-as-read-only option of org.gnome.desktop.lockdown schema and mount removable devices as read-only if enabled.
* 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: Use dictionaries in configuration_data objectsIñigo Martínez2019-05-161-4/+5
| | | | | | | | | | Since 0.49.0[0], a dictionary could be used as a replacement for each key/value pair as if `set` method was called for each of them. Almost all of the `configuration_data` objects have been changed to use a dictionary. [0] http://mesonbuild.com/Reference-manual.html#configuration_data
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-217-9/+9
| | | | | | | | | 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: Use generators placeholdersIñigo Martínez2019-01-211-1/+1
| | | | | | | | | | Functions derived from generators as `configure_file`, `custom_target` and `i18n.merge_file` can use placeholders like `@BASENAME@` that removes the extension from the input filename string. The output string has been replaced by this placeholder that allows in some cases the use of less variables.
* build: Fix the parameter order in configure_fileIñigo Martínez2019-01-211-2/+2
| | | | | | | The `install` and `install_dir` parameters must be the last parameters in the `configure_file` function. The paremeters have been reordered to fix this issue.
* build: Fix the use of pkg-config file variablesIñigo Martínez2019-01-217-10/+10
| | | | | | | | | 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-212-4/+4
| | | | | | | 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-217-32/+32
| | | | | | | 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: Make monitors build commands commonIñigo Martínez2019-01-216-196/+61
| | | | | | | | | | | | | | All the available monitors install a set of files: volume monitor files, DBus service files, etc... These build commands are mostly common and only file names change, which are built using a given pattern. These build commands have been replaced by only one set of build commands that adapt to monitors needs by changing their name and simplifies the entire process. These changes also help installing `GOA` and `MTP` necessary test files.
* Revert "build: Make monitors build commands common"Ondrej Holy2019-01-076-61/+196
| | | | This reverts commit c25bc351bb2605e57bc9a6d9250c9d4748c3d9e0.
* Revert "build: Add trailing commas"Ondrej Holy2019-01-077-32/+32
| | | | This reverts commit f4ee93b06cfc4d9f727f9174e40d08097a25d571.
* Revert "build: Use / instead of join_paths"Ondrej Holy2019-01-072-4/+4
| | | | This reverts commit 9523d8e09e0088c8cd58ace494d47cc3083151fc.
* Revert "build: Fix the use of pkg-config file variables"Ondrej Holy2019-01-077-10/+10
| | | | This reverts commit 22e9f7721b891b17cd726f1bf92b15a35be34d22.
* Revert "build: Fix the parameter order in configure_file"Ondrej Holy2019-01-071-2/+2
| | | | This reverts commit 12f4c5a98e1b4a1a0b5fba45439dab74d12519bb.
* Revert "build: Use generators placeholders"Ondrej Holy2019-01-071-1/+1
| | | | This reverts commit dc34f1be6a3c1fa6d5615ad5d647003e7ce3196f.
* Revert "build: Do not use prefix on directory variables"Ondrej Holy2019-01-077-9/+9
| | | | This reverts commit db31059d1b7b11b597b03064329fb1e8899b11f2.
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-047-9/+9
| | | | | | | | | 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: Use generators placeholdersIñigo Martínez2019-01-041-1/+1
| | | | | | | | | | Functions derived from generators as `configure_file`, `custom_target` and `i18n.merge_file` can use placeholders like `@BASENAME@` that removes the extension from the input filename string. The output string has been replaced by this placeholder that allows in some cases the use of less variables.
* build: Fix the parameter order in configure_fileIñigo Martínez2019-01-041-2/+2
| | | | | | | The `install` and `install_dir` parameters must be the last parameters in the `configure_file` function. The paremeters have been reordered to fix this issue.
* build: Fix the use of pkg-config file variablesIñigo Martínez2019-01-047-10/+10
| | | | | | | | | 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-042-4/+4
| | | | | | | 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-047-32/+32
| | | | | | | 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: Make monitors build commands commonIñigo Martínez2019-01-046-196/+61
| | | | | | | | | | | | | | All the available monitors install a set of files: volume monitor files, DBus service files, etc... These build commands are mostly common and only file names change, which are built using a given pattern. These build commands have been replaced by only one set of build commands that adapt to monitors needs by changing their name and simplifies the entire process. These changes also help installing `GOA` and `MTP` necessary test files.
* build: Use g_unix_mount_get_root_path conditionallyOndrej Holy2018-12-071-3/+15
| | | | | GLib hasn't been released with g_unix_mount_get_root_path support yet, so let's add macros to use this functionality only if available.
* udisks2: Improve handling of mounts which doesn't point into fs rootOndrej Holy2018-12-071-3/+14
| | | | | | | | | | | | | UDisks2 handling of mounts which doesn't point into fs root (created over bind operation, or btrfs subvolumes) is not optimal, see: https://github.com/storaged-project/udisks/issues/478 Also GIO API doesn't expect that one GVolume can have multiple mountpoints. Thus don't try to match UDisksBlock with mount which doesn't point into fs root and create standalone GVfsUDisks2Mount for it (or use GVfsUDisks2Volume corresponding with fstab entry). https://gitlab.gnome.org/GNOME/gvfs/issues/330
* udisks2: Do not ignore mounts without volumesOndrej Holy2018-12-071-6/+0
| | | | | | | | | | | | | | | gvfs_udisks2_mount_new returns NULL if volume is not specified and mount is considered as internal by g_unix_mount_is_system_internal. This prevents mount creation in certain cases even if x-gvfs-show is manually specified. Mounts are already filtered out by should_include_mounts, so I don't see much reason for additional check. It is true that should_include_mount doesn't use g_unix_mount_is_system_internal, but just g_unix_is_mount_path_system_internal, however, we can change this in future if needed. https://gitlab.gnome.org/GNOME/gvfs/issues/330
* udisks2: Restore support of comment=x-gvfs-* optionOndrej Holy2018-12-032-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Beginning the commit 959db3e0, mtab-based mount options are prioritized prior to the fstab options. However, "comment" option is not propagated to mtab and thus mounts with "comment=x-gvfs-show" can be ignored, but volumes can be still shown for them and vice versa. Consequently, mount operation fails with the following: "Mount is denied because the NTFS volume is already exclusively opened. The volume may be already mounted, or another software may use it which could be identified for example by the help of the 'fuser' command." Just a note, that "comment=x-gvfs-*" is wrong as per the docs and it should be "comment=gvfs-*" instead. However, it seems that the people started using this after commit 37d4bf32 as workaround on distributions with old util-linux versions, where plain "x-gvfs-*" option caused the following error: "Unrecognized mount option "x-gvfs-show" or missing value" The workaround using "comment=x-gvfs-*" option worked so far just only thanks to the "bug" in gvfs_udisks2_utils_lookup_fstab_options_value() function, which doesn't care about the prefix of the mount option. Let's prioritize fstab options before mtab-based mount options to fix this regression. It is maybe less reliable because the assignment of the corresponding fstab entry is arguable, but the rest of the volume monitor code relies on it anyway. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/348
* gphoto2: Fix mounting for devices with special chars in ID_SERIALOndrej Holy2018-09-241-4/+7
| | | | | | | ID_SERIAL string is not URI-escaped before use, but unfortunately, it may contain special characters (e.g. colons) and consequently it is not possible to mount affected devices over activation_root. Let's URI-escape the ID_SERIAL string before use as URI to fix that issue.
* mtp: Fix mounting for devices with special chars in ID_SERIALOndrej Holy2018-09-241-2/+4
| | | | | | | | | ID_SERIAL string is not URI-escaped before use, but unfortunately, it may contain special characters (e.g. colons) and consequently it is not possible to mount affected devices over activation_root. Let's URI-escape the ID_SERIAL string before use as URI to fix that issue. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/338
* Add a new volume class `loop`segfault2018-09-041-1/+33
| | | | ... to be able to list loop devices in the GTK+ places sidebar.
* udisks2: Use loop backing file as description for unlocksegfault2018-08-151-8/+12
| | | | | For encrypted loop devices, the backing file name is a better description than the device file name (/dev/loopX).
* 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