summaryrefslogtreecommitdiff
path: root/daemon
Commit message (Collapse)AuthorAgeFilesLines
* admin: Handle --help even if not under pkexecOndrej Holy2019-04-301-12/+12
| | | | | Error is shown if `gvfsd-admin --help` is started without pkexec. Change order of the input checks and print help in this case as well.
* admin: Prevent core dumps when daemon is manually startedOndrej Holy2019-04-301-2/+9
| | | | | | | | Use `g_printerr ()` instead of `g_error ()` in order to prevent core dumps when starting the gvfsd-admin daemon manually without pkexec, or with wrong commandline arguments. Fixes: https://gitlab.gnome.org/GNOME/gvfs/issues/395
* admin: Fix minor memory leakOndrej Holy2019-04-301-1/+1
| | | | | GOptionContext is not released after `g_option_context_new ()` call. Let's use `g_option_context_free ()` to fix this minor memory leak.
* afc: Remove assumptions about length of device UUIDPhilip Langdale2019-04-291-11/+5
| | | | | | | | | | | Modern Apple devices have UUIDs that are not 40 digits long, as used to be the case. Accordingly, a recent change in libimobiledevice removed any assumptions around the UUID length, and we should do the same in the afc backend. Without this change, we see a symptom where the volume monitor and backend disagree on the expected mount root. I have tested this on a 2018 iPad pro (iPad8,3) which has a 24 digit UUID.
* fuse: Adapt gvfsd-fuse to use fuse 3.xXi Ruoyao2019-04-041-3/+1
| | | | | | | | | | 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
* afp: Fix afp backend crash when no username suppliedMayank Sharma2019-03-281-0/+6
| | | | | | | | A missing NULL check in g_vfs_afp_command_put_pascal caused crashes (seg faults) when no username was given. Crashes happened irrespective of Password was given or not. https://gitlab.gnome.org/GNOME/gvfs/issues/298
* daemon: Use "No such file or directory" consistentlyMayank Sharma2019-03-211-1/+1
| | | | | | | GVfs uses different forms of "No such file or directory", e.g. "No such file or directory in target path". Hence, unify them. https://gitlab.gnome.org/GNOME/gvfs/issues/170
* daemon: Use "Backups not supported" consistentlyMayank Sharma2019-03-213-5/+5
| | | | | | | | | GVfs uses different forms of "Backups not supported" string, e.g. "Backups are not yet supported.", "backups not supported" and "backups not supported yet". Let's use "Backups not supported" consistently. https://gitlab.gnome.org/GNOME/gvfs/issues/170
* daemon: Use "Operation not supported" consistentlyMayank Sharma2019-03-2145-85/+85
| | | | | | | | | GVfs uses different forms of "Operation not supported" string, e.g. "Operation unsupported", "Operation not supported by backend". Let's use "Operation not supported" consistently as this is also used in GLib. https://gitlab.gnome.org/GNOME/gvfs/issues/170
* sftp: Improve debug output of ssh cmdlineOndrej Holy2019-02-261-3/+9
| | | | | | | | | | | Currently, the debug output of ssh cmdline looks like: sftp: spawn_ssh: sftp: /usr/bin/ssh sftp: -oForwardX11 no sftp: -oForwardAgent no sftp: -oPermitLocalCommand no sftp: -oClearAllForwardings yes sftp: -oProtocol 2 sftp: -oNoHostAuthenticationForLocalhost yes sftp: -p sftp: 22222 sftp: -s sftp: 10.220.47.158 sftp: sftp sftp: This is because we add prefixes for each g_debug, which makes this unreadable. Let's concatenate the strings before printing over g_debug.
* smb: Update comments and debug outputs for mount operationOndrej Holy2019-02-181-6/+9
| | | | | Update obsolete comments and misleading debug output to make the mount procedure more obvious.
* smb: Do not show password prompt when using winbind ccacheOndrej Holy2019-02-181-0/+8
| | | | | | | | | | | Recent samba releases seems invoke auth_callback even when using cached winbind credentials. It shows password prompt to user, which is unexpected. Add one more iteration in the mount procedure just for ccache. This will unfortunately make one fail attempt if the winbind ccache is not configured, but I don't see better way to fix this. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/369
* smb: Enable winbind ccache explicitelyOndrej Holy2019-02-181-0/+1
| | | | | The winbind ccache is enabled by default currently, but let's enable it explicitely to be obvious.
* sftp: Always use port 22 if not specifiedOndrej Holy2019-02-041-7/+5
| | | | | | | | | | | Currently, the default port - specified in mount file - is removed from uri on client side, but it is not used by backend explicitely. It is not a problem until the default port is changed in sshd_config and somebody wants to connect to the server using the default port from mount file. Let's use the port 22 explicitely, similarly as other backends do (i.e. ftp, afc, afp). Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/129
* build: Make use of dictionaries to gain readibilityIñigo Martínez2019-01-211-72/+31
| | | | | | | | | | | | | | | | The set of daemons is a large list of executables to be built. To ease its build an array of arrays was created, but this harms readibility. This has been improved by the use of the new dictionary types[0] and the possibility of using a dictionary as a parameter in target objects[1]. The individual dependencies have been moved directly to the new dictionary because it remains clear their meaning. [0] http://mesonbuild.com/Release-notes-for-0-47-0.html#new-builtin-object-type-dictionary [1] http://mesonbuild.com/Release-notes-for-0-49-0.html#can-specify-keyword-arguments-with-a-dictionary
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-211-5/+5
| | | | | | | | | 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-7/+5
| | | | | | | | | | 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-3/+3
| | | | | | | 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-211-5/+5
| | | | | | | | | 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-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-212-58/+58
| | | | | | | 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
* admin: Update message in .policyOndrej Holy2019-01-141-1/+1
| | | | | | Update message for org.gtk.vfs.file-operations-helper action in polkit org.gtk.vfs.file-operations.rules file to be obvious that it is used when starting gvfsd-admin.
* admin: Add comments to .policy fileOndrej Holy2019-01-141-0/+2
| | | | | Add comments to polkit org.gtk.vfs.file-operations.policy file explaining the purpose of the different actions.
* admin: Add comment to .rules fileOndrej Holy2019-01-141-0/+5
| | | | | | Add comment to polkit org.gtk.vfs.file-operations.rules file explaining the rule which allows starting gvfsd-admin without password for users belonging to wheel group.
* admin: Prevent access if any authentication agent isn't availableOndrej Holy2019-01-141-2/+1
| | | | | | | | | | | | | | | | | | The backend currently allows to access and modify files without prompting for password if any polkit authentication agent isn't available. This seems isn't usually problem, because polkit agents are integral parts of graphical environments / linux distributions. The agents can't be simply disabled without root permissions and are automatically respawned. However, this might be a problem in some non-standard cases. This affects only users which belong to wheel group (i.e. those who are already allowed to use sudo). It doesn't allow privilege escalation for users, who don't belong to that group. Let's return permission denied error also when the subject can't be authorized by any polkit agent to prevent this behavior. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/355
* mtp: Don't retry reading an event after failurePhilip Langdale2019-01-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This issue has been sitting around for ages without us understanding what's going on. We finally got a repro scenario which showed that it happens when another program steals the MTP device out from under us, so that all MTP calls will start failing. In this case it's clear that it's futile to keep trying to retry reading the event after a failure. I originally wrote the code to retry the read because I expected any error to be transitory, but if the error is persistent, it's not good behaviour - even if the memory leak was fixed (as you'd still be busy-waiting in a tight loop). So, given the situation, and the fact that I'm not aware of any occurence of transitory event read failures, let's just say that if an event read fails, we'll give up and the event is lost. Note that I'm still not aware of the exact situation where the problem was first observed (the reporters did not talk about the use of VM software stealing devices) and so fixing this may still result in them seeing a situation where they can't access the device due to whatever the underlying cause is. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/347
* Revert "build: Add trailing commas"Ondrej Holy2019-01-072-58/+58
| | | | This reverts commit f4ee93b06cfc4d9f727f9174e40d08097a25d571.
* Revert "build: Use / instead of join_paths"Ondrej Holy2019-01-071-4/+4
| | | | This reverts commit 9523d8e09e0088c8cd58ace494d47cc3083151fc.
* Revert "build: Fix the use of pkg-config file variables"Ondrej Holy2019-01-071-5/+5
| | | | This reverts commit 22e9f7721b891b17cd726f1bf92b15a35be34d22.
* Revert "build: Fix the parameter order in configure_file"Ondrej Holy2019-01-071-3/+3
| | | | This reverts commit 12f4c5a98e1b4a1a0b5fba45439dab74d12519bb.
* Revert "build: Use generators placeholders"Ondrej Holy2019-01-071-5/+7
| | | | This reverts commit dc34f1be6a3c1fa6d5615ad5d647003e7ce3196f.
* Revert "build: Do not use prefix on directory variables"Ondrej Holy2019-01-071-5/+5
| | | | This reverts commit db31059d1b7b11b597b03064329fb1e8899b11f2.
* Revert "build: Make use of dictionaries to gain readibility"Ondrej Holy2019-01-071-31/+72
| | | | This reverts commit a60d8c0987914213f2e69f760b15500a10c3adb4.
* build: Make use of dictionaries to gain readibilityIñigo Martínez2019-01-041-72/+31
| | | | | | | | | | | | | | | | The set of daemons is a large list of executables to be built. To ease its build an array of arrays was created, but this harms readibility. This has been improved by the use of the new dictionary types[0] and the possibility of using a dictionary as a parameter in target objects[1]. The individual dependencies have been moved directly to the new dictionary because it remains clear their meaning. [0] http://mesonbuild.com/Release-notes-for-0-47-0.html#new-builtin-object-type-dictionary [1] http://mesonbuild.com/Release-notes-for-0-49-0.html#can-specify-keyword-arguments-with-a-dictionary
* build: Do not use prefix on directory variablesIñigo Martínez2019-01-041-5/+5
| | | | | | | | | 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-7/+5
| | | | | | | | | | 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-3/+3
| | | | | | | 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-041-5/+5
| | | | | | | | | 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-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-042-58/+58
| | | | | | | 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
* keyring: Prefer the most recent itemOndrej Holy2019-01-041-0/+4
| | | | | | | | | | | | | | | | | | If keyring contains more entries for one host, the first one is always used. However, this is not always the best one. Imagine the situation that the username was changed on the server for some reason and the previous username is invalid. When user connects using the new username, a new entry is added to the keyring. However, next time the old username is automatically used when mounting using the hostname only, which leads to login failures and the user has to specify its password each time... Prefer the most recent item from keyring if they are equal in specificity in order to prevent such issues. It would be best to remove the invalid entry automatically from the keyring, but it is not safe to remove it just in case of login failure, because it might be just some network outage, or so... https://gitlab.gnome.org/GNOME/gvfs/issues/352
* afp: Try to find credentials even if user is not specifiedOndrej Holy2019-01-041-16/+16
| | | | | | | | | | | Currently, when you try to mount AFP share and don't specify username in the URI, the g_vfs_keyring_lookup_password() call is skipped and thus you have to specify the credentials manually even if "Remember Password Forever" was used last time. This is wrong and other backends in the same situation tries to use the stored credentials. This is especially annoying for locations which are propagated over DNS-SD. Let's change this. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/352
* dav: Try authenticate again even if 403 was returnedOndrej Holy2019-01-041-2/+29
| | | | | | | | | | | | Some servers e.g. davs://webdav.mc.gmx.net returns 403 status code instead of 401 in case of invalid credentials. This causes that libsoup fails immediately after the first login attempt, which is especially problem in case of the wrong credentials stored in the keyring. A user doesn't have any chance to manually specify correct credentials. Clear the credentials cache and force libsoup to call the authentication callback again... Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/351
* daemon: Prevent spawning new daemons if outgoing operation existsOndrej Holy2018-11-191-0/+26
| | | | | | | | | | | | | | | | A new daemon is always spawned if MountLocation method (or LookupMount for automounted) is called and the respective mount isn't registered yet. This is not usually an issue, because the redundant daemons are consequently terminated. However, this is a problem if mount operations hang for some reason. This may happen e.g. with trash backend due to stale NFS mounts. Consequently, new and new daemons are spawned which may lead to system failures due to lack of system resources. See the following downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1632960 Let's fix that behavior simply by preventing spawning of new daemons if respective outgoing mount operations exist. https://gitlab.gnome.org/GNOME/gvfs/merge_requests/19
* google: Handle child of volatile also as volatileOndrej Holy2018-09-211-39/+19
| | | | | | Files in volatile folder should be also marked as volatile. Volatile handling is a bit simplified as a part of this patch also.
* google: Use cache for enumeration alsoOndrej Holy2018-09-211-16/+46
| | | | | | | The reworked cache hasn't been used for enumeration results and also for missing files checks, which always caused rebuilding cache. Let's save timestamps also for enumerations and use it to prevent redundant cache rebuilds.
* google: Rework cache for better performanceOndrej Holy2018-09-211-238/+166
| | | | | | | | | | | The backend is totally unusable if you have too many files on your Drive. This happens because the backend preloads the whole Drive's metadata. Let's build the cache incrementaly per folders. As a result, the backend works smoothly regardless of the total number of Drive files, because the total number of transmitted data is significantly reduced. On the other hand, more requests is done to Drive, but the Drive quotas seem big enough.
* google: Remove file just from concrete parentOndrej Holy2018-09-211-4/+33
| | | | | | Files with multiple parents are currently removed from all parents. This is unexpected and may cause data loss, because it is not obvious that it is one file. Let's remove the file just from requested folder.
* google: Add support for files with multiple parentsOndrej Holy2018-09-211-220/+168
| | | | | | | | | One entry can have multiple parents. You can create such entry on the web in a pretty simple way, e.g. Ctrl + Drag&Drop. Such entries are currently shown only on one place in the backend. Also the backend rely on get_parent_id() and get_entry_path() functions which are tottaly wrong. Let's introduce get_parent_ids() and resolve entry_path only from given filename.
* google: Ignore entries without parentsOndrej Holy2018-09-211-17/+1
| | | | | | Entries without parents are not shown on the web and there isn't any reason to list them here. Such entries belongs to some web services and we have no control over them.