sshfs icon indicating copy to clipboard operation
sshfs copied to clipboard

Fix silently ignoring STATUS response after READ

Open gralpli opened this issue 5 years ago • 4 comments

This attempts to fix #224, but is incomplete yet. Open questions:

  • [ ] Does res need to be set in the immediately following else-if-branch and in the last else-branch as well? I guess not, because the case when chunk->sio.error equals MY_EOF is explicitly guarded a couple lines above.

  • [ ] Do I need such a MY_EOF guard for the line that I added?

  • [ ] When encountering an I/O error, SFTP reports a SSH_FX_FAILURE which, by the function sftp_error_to_errno, is mapped to an EPERM. This leads to us getting an “Operation not permitted” over sshfs instead of an I/O error. Can EPERM be replaced by EIO?

My addition of the word else is purely for stylistic reasons and does not change the control flow.

gralpli avatar Jan 09 '21 22:01 gralpli

Thanks for the patch! I'm afraid I do not know the answers to your questions. The best I can do is to study the code carefully myself and try to figure this out, so this review might take a while. Any help is appreciated.

Once thing that comes to mind is that we probably need to check how real permissions errors are reported - we wouldn't want to get EIO if permissions are incorrect.

Nikratio avatar Jan 10 '21 11:01 Nikratio

Is this ready for review? I understand from the original message that there are still open questions, but it's not clear to me if you're still working on them (or other issues) or if you're waiting for someone to review this.

Nikratio avatar Sep 24 '21 12:09 Nikratio

This is my first pull request where I’m actually fixing something and I don’t know how confident I need to be to release it. As far as I remember, this fixes the bug. But I can’t estimate all the implications that this code change has.

So I’d say yes, this is ready for review. The open questions are questions that a reviewer would need to answer to check if the code is correct.

gralpli avatar Apr 01 '22 06:04 gralpli

First step is to make sure the tests in the CI still pass, currently they are failing. That means either your code has a bug or the test has a bug - but in both cases it needs to be fixed.

Nikratio avatar Apr 01 '22 07:04 Nikratio