summaryrefslogtreecommitdiff
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* recent: Prevent crash when recent file changedOndrej Holy2017-12-151-2/+3
| | | | | | If recent file is changed and directory monitor doesn't exists, the recent backend crashes. Check the monitor first before emitting event in order to prevent this crashes.
* trash: Fix trash::orig-path for relative pathsOndrej Holy2017-12-133-13/+12
| | | | | | | | | The trash::orig-path attribute calucaltion expects that the trash is only one dir (i.e. .Trash, .Trash-$UID) and it fails for relative paths in case it is not (i.e. .Trash/$UID). Let's propagate the topdir and fix relative path handling... https://bugzilla.gnome.org/show_bug.cgi?id=789328
* backend: Fix querying of thumbnail::failed attributeOndrej Holy2017-12-081-2/+4
| | | | | | | | | The thumbnail::failed would previously only be set if thumbnail::path was included in the query, so querying for just thumbnail::failed would return no results. This fixes the behaviour of "gio info -a thumbnail::failed URI". https://bugzilla.gnome.org/show_bug.cgi?id=791325
* mtp: Allow toggling libmtp debug outputOndrej Holy2017-11-291-0/+17
| | | | | | | libmtp provides LIBMTP_DEBUG environment variable already, but with binary flags. Let's introduce GVFS_MTP_DEBUG environment variable as has other backends to toggle libmtp debug output with string values. Possible values are "all", "data", "usb", or "ptp".
* afp: Port GVfsAfpVolume to GTaskOndrej Holy2017-11-281-622/+485
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* afp: Port GVfsAfpConnection to GTaskOndrej Holy2017-11-281-145/+71
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* afp: Port GVfsAfpServer to GTaskOndrej Holy2017-11-281-94/+49
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* afp: Port GVfsBackendAfpBrowse to GTaskOndrej Holy2017-11-281-27/+17
| | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* afp: Prevent comparsion between signed and unsignedOndrej Holy2017-11-281-2/+2
| | | | | | | | Swap gssize and gsize data types in order to prevent comparisons and other operations between signed and unsigned types, which might lead to troubles. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* daemon: Port GVfsBackend to GTaskOndrej Holy2017-11-285-149/+142
| | | | | | | | | | | | GSimpleAsyncResult is deprecated in favour of GTask and should be replaced. This patch also introduce g_vfs_backend_register_mount_finish() and g_vfs_backend_unregister_mount_finish() functions to make the code nicer. Based on patch from Dan Winship. https://bugzilla.gnome.org/show_bug.cgi?id=747412
* mtp: Handle read-past-EOF in GetPartialObject(64) ourselvesPhilip Langdale2017-11-191-0/+16
| | | | | | | | | | | | | | | | | | Up until very recently, the Android MTP driver did not do bounds checking on reads past EOF, leading to undefined behaviour, which includes hanging the transfer on some devices. According to Google engineers, this is fixed in the kernels used by the Pixel and Pixel 2 (and this has been verified in testing), but that basically means that every other Android device in existence has this bug, and is unlikely to ever be fixed. So, we need to enforce POSIX semantics ourselves and truncate reads past EOF. libmtp has implemented a check, but we should validate as well so that we have working behaviour without requiring a libmtp update. https://bugzilla.gnome.org/show_bug.cgi?id=784477
* build: Use ITS rules for polkit in mesonIñigo Martínez2017-11-131-0/+1
| | | | | | | | | | In a previous change polkit ITS rules were included to be used when merging translations with gettext. However, the use of this files is missing when using meson. This patch restores the use of those files. https://bugzilla.gnome.org/show_bug.cgi?id=786149
* build: Make SystemdService entry conditionalIñigo Martínez2017-11-071-9/+18
| | | | | | | | | | | | When systemd user units installation is disabled, SystemdService entry should also not be present on D-Bus service files. This patch adds a common D-Bus service file template allowing, an homogeneus D-Bus service file generation and also a SystemService entry conditioned to the systemd user units installation option. https://bugzilla.gnome.org/show_bug.cgi?id=786149
* build: Add an option for gcryptIñigo Martínez2017-11-071-1/+1
| | | | | | | | Add an option to make gcrypt conditional allowing to disable it if desired. This patch also makes the existence of libgcrypt-config program mandatory if the gcrypt option is enabled. https://bugzilla.gnome.org/show_bug.cgi?id=786149
* build: Improve installation on system pathsIñigo Martínez2017-10-311-3/+3
| | | | | | | | | | | | 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
* mtp: Remove redundant ifdefsOndrej Holy2017-10-311-4/+0
| | | | | | HAVE_GUDEV guards are redundant, because gudev is hard requirement. https://bugzilla.gnome.org/show_bug.cgi?id=786149
* build: Reorder meson options and update descriptionOndrej Holy2017-10-311-3/+3
| | | | | | | | 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-314-0/+644
| | | | | | | | 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
* sftp: Add support for setting timestampsMax Maisel2017-09-291-20/+119
| | | | | | | | | | | | | | | Implement set time::modified and time::access in function try_set_attribute. The SFTP protocol limitation that atime and mtime must be set simultaneously is overcome by stating the file and perform a read-modify-write operation. Therefore the new callback function set_attribute_stat_reply is added. Furthermore time::modifed and time::access are added to try_query_settable_attributes. This patch makes 'rsync -t' and 'touch' utilities work over gvfsd-sftp. https://bugzilla.gnome.org/show_bug.cgi?id=527339
* dav: Prevent usage of uninitialized variableOndrej Holy2017-09-291-2/+1
| | | | | | | | | | More warnings are printed when building thanks to meson port. The mounting loop may be breaked before is_webdav variable is defined. Let's move the initialization to another place in order to prevent usage of uninitialized variable and the following warning: warning: ‘is_webdav’ may be used uninitialized in this function https://bugzilla.gnome.org/show_bug.cgi?id=786149
* dav: Prevent usage of uninitialized variableOndrej Holy2017-09-291-0/+1
| | | | | | | | | More warnings are printed when building thanks to meson port. The bytes_avail variable is guarded by have_bytes_avail, so it should not be used unitialized, but let's initialize it for sure in order to prevent the following warning: warning: ‘bytes_avail’ may be used uninitialized in this function https://bugzilla.gnome.org/show_bug.cgi?id=786149
* afp: Prevent usage of uninitialized variableOndrej Holy2017-09-291-3/+3
| | | | | | | | | | More warnings are printed when building thanks to meson port. The code contains goto command which skips initialization of server_name variable. Let's move the initialization to another place in order to prevent usage of uninitialized variable and the following warning: warning: ‘server_name’ may be used uninitialized in this function https://bugzilla.gnome.org/show_bug.cgi?id=786149
* afc: More debug, for a changeBastien Nocera2017-09-191-1/+12
|
* daemon: Avoid overflowing when querying for filesystem infoMichael Terry2017-08-211-1/+1
| | | | | | | 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
* channel: Set sockets as nonblocking to prevent deadlocks when copyingOndrej Holy2017-08-181-1/+5
| | | | | | | | | | | | The channel socket pair is not set as nonblocking currently, which may cause deadlocks in some cases (e.g. in-mount copy over read-write fallback), because g_output_stream_write_async may block. This issue appears after increasing max size of buffer in read channel: https://bugzilla.gnome.org/show_bug.cgi?id=773826 Set channel sockets as nonblocking to be sure that _async methods don't block. https://bugzilla.gnome.org/show_bug.cgi?id=785391
* google: Report FS total size and free spaceMichael Terry2017-08-151-0/+53
| | | | | | | If libgdata 0.17.9 is available, use its new metadata API to query filesystem size and free space and report it back. https://bugzilla.gnome.org/show_bug.cgi?id=785870
* afc: Leak mutex when force unmountingOndrej Holy2017-08-151-1/+2
| | | | | | | | The afc daemon sometimes aborts on g_mutex_clear when force unmounting. Leak the mutex in order to avoid the aborts. The daemon will hopefully finish successfully then... https://bugzilla.gnome.org/show_bug.cgi?id=775514
* google: Add comment for mutexOndrej Holy2017-08-141-1/+1
| | | | | | | It is not obvious that the mutex guards cache for multi-threaded access. Let's add an comment. https://bugzilla.gnome.org/show_bug.cgi?id=785870
* admin: Require mounting for each client explicitlyOndrej Holy2017-08-043-9/+54
| | | | | | | | | | | | | | | | | | | | | | The admin backend is pretty special, because it can't use GMountOperation for authorization and polkit prompt is shown for each client. This leads to unwanted behavior because the admin prompt might be shown unexpectedly (e.g. when obtaining info for recently used files). Let's require mounting explicitly for each client. So each client gets G_IO_ERROR_NOT_MOUNTED if it hasn't called g_file_mountable_mount before. It works nicely for most of the apps which I tested (e.g. with Nautilus, GEdit, Totem, Evince, GIMP, LibreOffice). However, this requires changes for some applications, which expects that the file is already mounted (e.g. EOG). Unfortunatelly, it breaks utils like "gio list" because it fails with "The specified location is not mounted" error and "gio mount admin:///" doesn't help, because it has different PID. This isn't ideal, but it is better than the unexpected password prompts... https://bugzilla.gnome.org/show_bug.cgi?id=771285
* dav: Fix DAV implementation stripping spacesColin Leroy2017-07-241-2/+2
| | | | | | | | This patch fixes DAV stripping leading and trailing spaces from server responses. This fixes access to DAV files and directories which names start or end with a space. https://bugzilla.gnome.org/show_bug.cgi?id=785123
* Do not sent user invisible mounts if not neededOndrej Holy2017-06-063-8/+39
| | | | | | | | | | | 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
* build: Do not install polkit rules if admin backend is disabledLaurent Bigonville2017-05-111-1/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=774100
* mtp: Remove avoidance of file push for >4GB files on AndroidPhilip Langdale2017-05-081-12/+0
| | | | | | | | | | | | | | | | | | We added an avoidance of using the push mechanism for >4GB files on Android due to observed behaviour in Android 5.x where this was incredibly slow. By avoiding it we did a fallback to the partial object API which was faster than the buggy API but slower than the push API when it works correctly. This problem was fixed in Android 6.0 and remains fixed today. There is no way to detect the android version on the device, so we're stuck either always using the workaround or not using it at all. Given that Android is now two major versions past the bug and USB 3.x connectivity is more common, it becomes unreasonable to inflict the inferior performance on all the non-buggy devices. It's time to move on. https://bugzilla.gnome.org/show_bug.cgi?id=736495
* google: Do not ignore errors when rebuilding cacheOndrej Holy2017-04-211-11/+5
| | | | | | | | If file cache is not loaded properly (e.g. because of cancellation), it may lead to various problems (e.g. incomplete enumeration). Let's return error in such case and rebuild the cache next time... https://bugzilla.gnome.org/show_bug.cgi?id=781252
* recent: Emit G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGEDOndrej Holy2017-04-131-1/+1
| | | | | | G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED should be emitted if G_FILE_ATTRIBUTE_RECENT_MODIFIED is updated, but it isn't. Let's change it.
* recent: Port from GtkRecentManager to GBookmarkFileOndrej Holy2017-04-122-57/+152
| | | | | | | | | GVfs dependency on GTK+ causes various issues. It is only needed by the recent backend, which is based on GtkRecentManager. GtkRecentManager is just wrapper for GBookmarkFile. Let's port the backend to use GBookmarkFile and remove the unwanted GTK+ dependency. https://bugzilla.gnome.org/show_bug.cgi?id=773300
* sftp: Handle SecurID password promptOndrej Holy2017-04-101-1/+2
| | | | | | | | | SFTP backend parses output from SSH client and expects several predefined password prompts. Unfortunately, SecurID (pam_securid.so) is not handled yet and the mount operation timeouts with the following error: "Timed out when logging in". Let's handle also SecurID prompt (i.e. "Enter PASSCODE"). https://bugzilla.redhat.com/show_bug.cgi?id=1440256
* google: Fix reported file sizeOndrej Holy2017-03-231-4/+16
| | | | | | | | | Ligdata recently added API to obtain a real file size. Use gdata_documents_entry_get_file_size if libgdata 0.17.7 is available instead of gdata_documents_entry_get_quota_used, which returns 0 in some cases (e.g. shared files). https://bugzilla.gnome.org/show_bug.cgi?id=773053
* sftp: Prevent potential crash in case of parsing errorOndrej Holy2017-03-231-4/+5
| | | | | | | Free may be called on statically allocated memory in case of parsing error. Let's do not touch the output parameter at all in case of failure. This issue was revealed by coverity scan.
* google: Prevent potential crashes if resolve_dir failsOndrej Holy2017-03-231-1/+2
| | | | | | | Initialize pointers properly in order to avoid usage of unitialized, or already freed memory. This issues were revealed by coverity scan.
* admin: Fix strtol error checkOndrej Holy2017-03-231-2/+2
| | | | | | | | The result from strtol is stored in uid_t and then checked for LONG_MAX and LONG_MIN, however, uid_t doesn't have to be long. Let's check just the errno value, it should be enough. This issue was revealed by coverity scan.
* gphoto2: Fix x-content-types setupOndrej Holy2017-03-231-7/+2
| | | | | | | | 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.
* smb: Fix a warningRoss Lagerwall2017-02-261-0/+1
| | | | Fix a warning due to no previous prototype for create_smb_uri.
* daemon: Print client pid in debug outputOndrej Holy2017-02-131-2/+9
| | | | | It is pretty difficult to get client pid currently when debugging. Let's print them from invocation handler.
* recent: Set G_FILE_ATTRIBUTE_RECENT_MODIFED attributeOndrej Holy2017-02-131-0/+12
| | | | | | | | | | G_FILE_ATTRIBUTE_TIME_ACCESS is used for sorting currently, however, it causes troubles, because some daemons (i.e. dropbox) access files and updates its timestamps itself. This attribute propagates time when the metadata was last changed, which is what we need for sorting in client applications. https://bugzilla.gnome.org/show_bug.cgi?id=777507
* Fix translator commentsPiotr Drąg2017-01-282-5/+5
| | | | They need to be exactly one line above a string to show up in .po files.
* cdda: Disconnect uevent handler immediatelyOndrej Holy2017-01-261-1/+5
| | | | | | | | | Uevent handler with "remove" action may be called multiple times, which causes that g_vfs_backend_force_unmount is called several times, which may lead to segfault. Disconnect the uevent handler immediately after g_vfs_backend_force_unmount call. https://bugzilla.gnome.org/show_bug.cgi?id=777794
* gphoto2: Disconnect uevent handler immediatelyOndrej Holy2017-01-261-1/+16
| | | | | | | | | Uevent handler with "remove" action may be called multiple times, which causes that g_vfs_backend_force_unmount is called several times, which may lead to segfault. Disconnect the uevent handler immediately after g_vfs_backend_force_unmount call. https://bugzilla.gnome.org/show_bug.cgi?id=777794
* mtp: Disconnect uevent handler immediatelyOndrej Holy2017-01-262-6/+6
| | | | | | | | | Uevent handler with "remove" action may be called multiple times, which causes that g_vfs_backend_force_unmount is called several times, which may lead to segfault. Disconnect the uevent handler immediately after g_vfs_backend_force_unmount call. https://bugzilla.gnome.org/show_bug.cgi?id=777794
* backend: Hold reference during force unmountOndrej Holy2017-01-261-2/+3
| | | | | | | | g_vfs_backend_force_unmount may be called multiple times, or in parallel with regular unmount operation. Hold backend reference during the whole force unmount procedure in order to avoid unwanted segfaults. https://bugzilla.gnome.org/show_bug.cgi?id=777794