Check if realpath succeeded when changing SFTP directory#2098
Check if realpath succeeded when changing SFTP directory#2098toml-bipsync wants to merge 1 commit intophpseclib:masterfrom
Conversation
|
I prefer the alternative method you mentioned - if you could update your PR that'd be great - thanks! I'm also curious... in those instances where realpath returns false and chdir returns true can you post the output of None of that changes the merit of your PR (which is sound). None-the-less I'm curious! |
c16b72a to
4ee55d1
Compare
|
@terrafrost done. Apologies I think I messed up my initial report. It's quite a hard issue to diagnose because of where the code is and the fact I can't replicate it locally at all. I'll write out the issue in case you have any insight. The code was basically: Note at first we weren't checking the return value of chdir. Yesterday I changed the code so we check the result of chdir() and pwd before the put(). It now reliably fails and getLastSFTPError() set to I can't run getServerIdentification() easily, but the servers are OpenSSH8.9 and Azure Blob Storage SFTP. |
|
I cherry picked this into the 1.0 branch and then merged that into the 2.0, 3.0 and master branches: |
I've been troubleshooting an interesting intermittent issue with SFTP, where sometimes realpath() would fail but chdir would return true. pwd would be false though so future commands would fail the precheck with 'Please close the channel (256) before trying to open it again'.
I've added a simple check, wasn't quite sure if that was the preferred way.
Happy to change it to
or whatever.