KIO-SFTP backport #279
Merged
blu.256
merged 3 commits from feat/kio-sftp-backport
into master
2 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feat/kio-sftp-backport'
Deleting a branch is permanent. It CANNOT be undone. Continue?
This PR is a backport of a version of the SFTP ioslave based on libssh.
This was based on the KDE2 port I mentioned in issue #276 and the actual KDE5 version of
kio-sftp
.Basic testing suggests it mostly works, but there are some issues. This list is not exhaustive:What works
What does not work
Opening symlinksfixed.Putting files, either by copying a local file or by creating one (results in a crash)fixed.Needs testing
Other issues
Random hangsprobably fixed.The password dialog pops up too many times.fixed.Great, good work. I was planning to work on this myself at some point, but you have been quicker :-)
If you work on solving the remaining issues, then I will have a look. Unless you prefer I first take a look at the existing code.
Btw, good to mentioned in the commit where we copy the backported code from and that it is available under GPL2 license.
5228777376
toe506638fda
2 years agoI'll finish with the remaining issues probably tomorrow.
no worries, ping me when this is ready for review and I will do so.
@MicheleC Looks like I finished much earlier than I expected. The issues were trivial after all.
I can say that the IOSlave seems fully functional at this point with the features I tested.
Special attention in testing should be paid to public key authentication (it's the first that the code tries anyway) because I'm not sure whether it works. I tried to imitate the code of the latest (KDE5) version for this auth method so it could work fine. Password authentication works normally.
f68d8c5887
toc360b08b7e
2 years agod21debe5af
to36965d7e5f
2 years agoUpd.: nevermind the TDEParts issue, I must have missed Slavek's TDEIO patch.
Please amend as per comment
extern "C"
{
int KDE_EXPORT kdemain( int argc, char **argv )
int kdemain( int argc, char **argv )
KDE_EXPORT is required to make sure the symbol is visible when building with hidden visibility enabled. Otherwise the tdeio slave can't be found and can't be loaded.
int KDE_EXPORT kdemain(
Seems to work fine, I could connect to a server on another computer on a local network and use the remote files with ease.
Seems to work fine here. The urls I tried did not have a username: a dialog opened asking for user/password and that is all that was needed.
Good job!
Might be a distribution issue then.
I use a static IP as url (like sftp://aaa.bbb.ccc.ddd), not sure if this makes any difference.
I suggest we merge it and ask those users who had problem to test out the new package. If the username-less URL becomes a problem, we will fix it as a separate issue. In any case existing sftp does not work in recent distro apparently, so no much to lose in it.
I agree. Anything to do before I squash and merge?
I plan to squash it all to one commit:
Replaced tdeio-sftp with backported version
Before you merge, one more thing.
I will comment in the code.
Actually the dialog just showed up, but it took a minute or two for it to open, while with username in URL it connects immendately.
Sorry, ignore previous comment. I was confused about something, but it is fine.
Squash into one commit sounds good. Make sure the message retains a link to the original source that we imported, again to state that it is GPL2 licensed.
Interesting. I noticed a 2-3 secs delay here, on local network.... maybe something you can try debugging, see if you can understand while it takes longer without specifying the user (unless it is the server side being slow...)
6a56948b41
toc1e434f1c6
2 years agoSquashed commit ready. Please have a look at the commit message.
I think I'll look into it after the merge.
Also, should this be backported or is it only for R14.1.0?
for reference, trying to connect here (sftp://itcsubmit.wustl.edu) shows the dialog in a couple of seconds.
That is a good question. The code is quite different, so in theory it should go into R14.1.0 only. But given that tdeio_sftp does not work in R14.0.12 with recent distros, IMO it makes sense to backport this to R14.0.x too. @SlavekB what do you think?
Looks good
Indeed, so it might be dependent on the SSH/SFTP server after all.
It does not make any change API/ABI, so there nothing that would fundamentally block the backport to R14.0.x. It is clear that it is definitely solving the problem, so it seems to be a good idea to do backport.
Regarding squash into single commit: There could be useful to leave the initial backport as one commit and subsequent fixes and improvements as another commit. But I have no objection if you want to leave it as one commit.
I did not test functionality, but there are some unexpected changes that relate to translations. It seems that something should be done with it.
##### create translation templates ##############
tde_l10n_create_template( "tdeio_sftp" )
Why is the generation of translation templates removed? Obviously, in the source code some texts are suitable for translation – there are calls
i18n()
.SOURCE sftp.protocol
DESTINATION ${SERVICES_INSTALL_DIR}
PO_DIR tdeioslave-desktops
#PO_DIR tdeioslave-desktops
Why is the use of translations for the
tdeioslave-desktops
template removed here?moving=true
Icon=ftp
Description=A tdeioslave for sftp
Description=A new tdeioslave for sftp
It looks like an unnecessary change of description.
Sounds good 👍
c1e434f1c6
to376c445647
2 years ago376c445647
to61a15f23e3
2 years ago61a15f23e3
toeec5c5e764
2 years ago@SlavekB Translations and ioslave description should be OK now. I split it all into two commits too.
@MicheleC Identation on line 73 fixed ;-)
WIP: KIO-SFTP backportto KIO-SFTP backport 2 years agoeec5c5e764
toc58023a394
2 years agoI have now looked at the versions of
libssh
in older Debian and it seems that 0.7.x does not contain CMake files => there will probably be better to detect library usingpkg-config
instead offind_package
.c58023a394
tof6385f2b50
2 years agoLike this?
Changing the way of detection libssh is good. Unfortunately, it turned out that there would be necessary other modifications to ensure compatibility with libssh on all supported distributions (Xenial - 0.6.3, Stretch - 0.7.3).
I think about two options:
What is your opinion?
If it does not require too much effort, I think option 1 would be preferable.
Will do.
8f091690b1
to0bbb1684a0
2 years ago@SlavekB can you please test the latest changes?
0bbb1684a0
tob3f53c3910
2 years agoThere seems to be the last two calls that need to treat for the libssh API < 0.7.90. See comments below.
/* get the hash */
ssh_key serverKey;
#if LIBSSH_VERSION_INT < SSH_VERSION_INT(0, 7, 0)
if (ssh_get_publickey(mSession, &serverKey) < 0) {
It seems that this change in the API (
ssh_get_server_publickey
) actually occurred with 0.7.90 (like 0.8.0~pre), while in 0.7.x the branch remains valid original callssh_get_publickey
.<< mHost << "? " << mConnected << endl;
/* write the known_hosts file */
kdDebug(TDEIO_SFTP_DB) << "Adding server to known_hosts file." << endl;
if (ssh_session_update_known_hosts(mSession) != SSH_OK) {
For libssh API older than 0.7.90 you need to use
ssh_write_knownhost
instead ofssh_session_update_known_hosts
.b3f53c3910
to462db8b954
2 years agoTo move forward, I have made changes related to compatibility for older versions of libssh, which I mentioned in the previous revise. Therefore, it is now ready to do rebase and we can go to merging.
Tested builds with older and also with current libssh and everything looks ready for merge.
462db8b954
tod6db1a583c
2 years agod6db1a583c
into master 2 years agoMerged and backported for R14.0.13.
Great, well done @blu.256!
Reviewers
d6db1a583c
.