diff options
author | Ondrej Holy <oholy@redhat.com> | 2022-04-11 10:54:04 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2022-05-05 08:05:54 +0000 |
commit | 5c016a2abfdd27eb2210a69f584a1242b87ab704 (patch) | |
tree | 6823f556ea12fcc0e970079a732ccb058902430a /daemon | |
parent | f1b599da1141e97bf701ed0f79d0a06c26c53df8 (diff) | |
download | gvfs-5c016a2abfdd27eb2210a69f584a1242b87ab704.tar.gz |
smb: Ignore EINVAL for kerberos/ccache login
With samba 4.16.0, mount operation fails with the "Invalid Argument" error
when kerberos/ccache is misconfigured. Ignore this error, so user get a chance
to login using the password...
Fixes: https://gitlab.gnome.org/GNOME/gvfs/-/issues/611
(cherry picked from commit 747c7f6ea6c8b6a7ccd008bb47996ba7eb169bcc)
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gvfsbackendsmb.c | 8 | ||||
-rw-r--r-- | daemon/gvfsbackendsmbbrowse.c | 10 |
2 files changed, 15 insertions, 3 deletions
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c index 33d1a209..776b67bc 100644 --- a/daemon/gvfsbackendsmb.c +++ b/daemon/gvfsbackendsmb.c @@ -513,7 +513,13 @@ do_mount (GVfsBackend *backend, if (res == 0) break; - if (op_backend->mount_cancelled || (errsv != EACCES && errsv != EPERM)) + if (errsv == EINVAL && op_backend->mount_try <= 1 && op_backend->user == NULL) + { + /* EINVAL is "expected" when kerberos/ccache is misconfigured, see: + * https://gitlab.gnome.org/GNOME/gvfs/-/issues/611 + */ + } + else if (op_backend->mount_cancelled || (errsv != EACCES && errsv != EPERM)) { g_debug ("do_mount - (errno != EPERM && errno != EACCES), cancelled = %d, breaking\n", op_backend->mount_cancelled); break; diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c index 57bae9db..7e8facfb 100644 --- a/daemon/gvfsbackendsmbbrowse.c +++ b/daemon/gvfsbackendsmbbrowse.c @@ -967,8 +967,14 @@ do_mount (GVfsBackend *backend, uri, op_backend->mount_try, dir, op_backend->mount_cancelled, errsv, g_strerror (errsv)); - if (dir == NULL && - (op_backend->mount_cancelled || (errsv != EPERM && errsv != EACCES))) + if (errsv == EINVAL && op_backend->mount_try == 0 && op_backend->user == NULL) + { + /* EINVAL is "expected" when kerberos is misconfigured, see: + * https://gitlab.gnome.org/GNOME/gvfs/-/issues/611 + */ + } + else if (dir == NULL && + (op_backend->mount_cancelled || (errsv != EPERM && errsv != EACCES))) { g_debug ("do_mount - (errno != EPERM && errno != EACCES), cancelled = %d, breaking\n", op_backend->mount_cancelled); break; |