Bug 186947 - Dolphin can not copy files over sftp
Summary: Dolphin can not copy files over sftp
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: SVN
Platform: OpenSUSE Unspecified
: NOR normal (vote)
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-12 11:56 UTC by Ruchir Brahmbhatt
Modified: 2009-09-19 10:49 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ruchir Brahmbhatt 2009-03-12 11:56:30 UTC
Version:           1.2.1 (using KDE 4.2.1)
Installed from:    SuSE RPMs

Steps to reproduce:
1. Select and copy a file from any directory in dolphin. 
2. Open new tab in dolphin.
3. Change url to sftp://<ip address>
4. Enter username and password of remote host.
5. Paste copied file.

Expected result:
File should be copied and we should be able to see it in dolphin.

Actual result:
It shows file copy progress but we can't see the file after copy is finished. If we try to paste file again, it asks to overwrite but regardless it is never actually copied. After copying with scp command I could see the file.

Additional information:
All operations were performed using root user.
Comment 1 Ruchir Brahmbhatt 2009-06-29 11:55:30 UTC
Reproducible in 4.2.90.
Comment 2 Andreas Schneider 2009-09-08 17:09:44 UTC
kio_sftp has been rewritten using libssh in trunk KDE 4.4. I've tested it and it works just fine. openSUSE has backported the fix to KDE 4.3. available in the build service. Could please confirm that the bug is fixed.
Comment 3 Ruchir Brahmbhatt 2009-09-15 10:58:50 UTC
Still not working. I tested dolphin from both factory and oss repos but none can copy files over sftp.
Comment 4 Andreas Schneider 2009-09-15 11:11:27 UTC
Do you have the rights to copy a file to the directory on the remote server?
What kind of file is it?
How big is the file?
Does the copy start but not finish?
What ssh/sftp server is running?

Please be more precise, I don't have a crystal ball.

http://www.catb.org/~esr/faqs/smart-questions.html#beprecise
Comment 5 Ruchir Brahmbhatt 2009-09-15 11:18:49 UTC
I'm logged in to my system as normal user but I login with root to sftp.
It's a small text file.
File is 3.3KiB big
Copy starts and finish(as per the notifications) how ever I don't see the file in dolphin as well as console(logged in to same system from konsole for verifying). Also when I try to copy again, it shows warning that file already exists!!!
Target system if fedora11 with openssh.
Hope this gives enough information.
Comment 6 Andreas Schneider 2009-09-15 11:51:40 UTC
Ok, I can reproduce it. It looks like there is a bug in redirection. It looks like dolphin doesn't recognize the redirection. The file is copied to / on the server.

kio_sftp(17173) kdemain: *** Starting kio_sftp  
kio_sftp(17173) sftpProtocol::sftpProtocol: pid =  17173 
kio_sftp(17173) sftpProtocol::setHost: setHost():  "root" @ "milliways.cynapses.org" : 0 
kio_sftp(17173) sftpProtocol::setHost: setHost(): mPort= 22                              
kio_sftp(17173) sftpProtocol::stat: KUrl("sftp://root@milliways.cynapses.org")           
kio_sftp(17173) sftpProtocol::openConnection: username= "root" , host= "milliways.cynapses.org" , port= 22 
kio_sftp(17173) sftpProtocol::openConnection: checking cache: info.username =  "root" , info.url =  "sftp://root@milliways.cynapses.org:22"
kio_sftp(17173) sftpProtocol::openConnection: Creating the SSH options
kio_sftp(17173) sftpProtocol::openConnection: Creating the SSH session
kio_sftp(17173) sftpProtocol::openConnection: Trying to connect to the SSH server
kio_sftp(17173) sftpProtocol::openConnection: Getting the SSH server hash
kio_sftp(17173) sftpProtocol::openConnection: Checking if the SSH server is known
kio_sftp(17173) sftpProtocol::openConnection: Trying to authenticate with the server
kio_sftp(17173) sftpProtocol::openConnection: Trying to authenticate public key
kio_sftp(17173) sftpProtocol::openConnection: Trying to request the sftp session
kio_sftp(17173) sftpProtocol::openConnection: Trying to initialize the sftp session
kio_sftp(17173) sftpProtocol::openConnection: Caching info.username =  "root" , info.url =  "sftp://root@milliways.cynapses.org:22"
kio_sftp(17173) sftpProtocol::canonicalizePath: Path to canonicalize:  "."
kio_sftp(17173) sftpProtocol::canonicalizePath: Canonicalized path:  "/root"
kio_sftp(17173) sftpProtocol::stat: redirecting to  "sftp://root@milliways.cynapses.org/root"
kio_sftp(17173) sftpProtocol::stat: KUrl("sftp://root@milliways.cynapses.org/root")
kio_sftp(17173) sftpProtocol::listDir: list directory:  KUrl("sftp://root@milliways.cynapses.org")
kio_sftp(17173) sftpProtocol::canonicalizePath: Path to canonicalize:  "."
kio_sftp(17173) sftpProtocol::canonicalizePath: Canonicalized path:  "/root"
kio_sftp(17173) sftpProtocol::listDir: redirecting to  "sftp://root@milliways.cynapses.org/root"
kio_sftp(17173) sftpProtocol::listDir: list directory:  KUrl("sftp://root@milliways.cynapses.org/root")
kio_sftp(17173) sftpProtocol::listDir: readdir:  "/root" , details:  "2"
kio_sftp(17173) sftpProtocol::stat: KUrl("sftp://root@milliways.cynapses.org")
kio_sftp(17173) sftpProtocol::canonicalizePath: Path to canonicalize:  "."
kio_sftp(17173) sftpProtocol::canonicalizePath: Canonicalized path:  "/root"
kio_sftp(17173) sftpProtocol::stat: redirecting to  "sftp://root@milliways.cynapses.org/root"
kio_sftp(17173) sftpProtocol::stat: KUrl("sftp://root@milliways.cynapses.org/root")
kio_sftp(17173) sftpProtocol::put: put():  KUrl("sftp://root@milliways.cynapses.org/file.txt")  , permissions =  "420" , overwrite =  0 , resume =  0
kio_sftp(17173) sftpProtocol::put: Appending .part extension to  "/file.txt"
kio_sftp(17173) sftpProtocol::put: Trying to open:  "/file.txt.part" , mode= "420"
Comment 7 Andreas Schneider 2009-09-15 12:02:28 UTC
David, is this a bug in dolphin/konqueror or am I doing something wrong in kio_sftp?

listDir() and stat() redirect to a canonicalized path if the stat() or listDir() fails.

sftp://user@host to -> sftp://user@host/homedir

The redirection works, you get the right content displayed and in the address bar of konqueror or dolphin the right url is displayed. If you copy a file to the redirected directory it tries to copy the file to /.

See the log in comment #6.
Comment 8 Andreas Schneider 2009-09-18 11:51:48 UTC
It works just fine using krusader. Will thinks that it could be a problem of dolphinpart.
Comment 9 David Faure 2009-09-18 19:09:21 UTC
Nice one. It works in iconview and not in listview (but only because of a side effect in the dropEvent code of each view). The bug is that m_controller->url() does not contain the new URL. Fix coming up soon.
Comment 10 David Faure 2009-09-18 20:00:27 UTC
SVN commit 1025419 by dfaure:

Update the controller's url upon redirection, otherwise pasting would paste into the old url.
BUG: 186947


 M  +5 -0      dolphincontroller.cpp  
 M  +7 -1      dolphincontroller.h  
 M  +8 -2      dolphinview.cpp  
 M  +6 -0      dolphinview.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1025419
Comment 11 Peter Penz 2009-09-19 10:49:40 UTC
Thanks David, I was not aware that this might be a Dolphin issue.