Skip to content
Commit 389c0d12 authored by Harald Sitter's avatar Harald Sitter 🐧
Browse files

[sftp] treat all errors as errors

Summary:
certain libssh versions sometimes give out bogus errors. namely SSH_FX_OK
can sometimes be the current err even after a function returned with an
"something errord" return value. when converting these bogus errors
to KIO errors we'd sometimes end up reporting NoError when in fact there
was an error, we just don't know what it was because err is incorrect.
this ultimately resulted in KIO ending up in infinite loops because a job
neither errors nor correctly finishes

a scenario where this happens a lot is using dolphin to enter an sftp dir,
then deleting that dir on the CLI. dolphin would keep on querying
`sftpProtocol::fileSystemFreeSpace` which would run into server errors get
correctly reported by libssh 0.6 but 99% of the time err is SSH_FX_OK which
then locks KIO into an infinite loop of asking for freespace and getting
no answer but also no error. once this happens sftp will be broken from
a user's perspective as opening a new tab/dolphin will not work because
the slave is locked in this infinite loop.

to prevent this and similar issues we'll not let toKIOError ever return
NoError. toKIOError is only called after errors actually happend, so
NoError is not ever correct even when technically mapping the SSH err to
KIO would be NoError. for KIO we need a definitive result, and the
definitive result is always an error.

Reviewers: broulik

Reviewed By: broulik

Subscribers: leszeklesner

Differential Revision: https://phabricator.kde.org/D15454
parent a1458714
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment