bugzilla-daemon at bugzilla.mindrot.org
2007-Sep-18 12:27 UTC
[Bug 1365] New: sftp exits immediately after connection (fgets EAGAIN)
http://bugzilla.mindrot.org/show_bug.cgi?id=1365
Summary: sftp exits immediately after connection (fgets EAGAIN)
Product: Portable OpenSSH
Version: 4.7p1
Platform: All
OS/Version: Linux
Status: NEW
Keywords: patch
Severity: normal
Priority: P2
Component: sftp
AssignedTo: bitbucket at mindrot.org
ReportedBy: roberto.foglietta at gmail.com
Created an attachment (id=1352)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=1352)
patch for 4.6p1 (but should work for 4.7p1 too)
sftp client was cross-compiled for a PPC board while sftp-server is
running onto an Ubuntu Linux / x86 arch.
After login sftp gets out immediately, however if I specify a batch
file it works. The amazing thing is.... 2>/dev/null resolve the issue!
Attach sftp.err.1.gz show strace of a sftp failed and sftp.err.2.gz
sftp 2>strace.log which successes. Problem is fgets returns EAGAIN but
this condition is not propely tested. Patch would fix.
This behavior has noticed in version 4.6p1 but sftp.c does not have
changed in 4.7p1
~ # sftp -S /usr/bin/dbclient -s /usr/lib/openssh/sftp-server
foglietr at 172.16.119.6
Connecting to 172.16.119.6...
WARNING: Ignoring unknown argument '-oForwardX11 no'
WARNING: Ignoring unknown argument '-oForwardAgent no'
WARNING: Ignoring unknown argument '-oPermitLocalCommand no'
WARNING: Ignoring unknown argument '-oClearAllForwardings yes'
WARNING: Ignoring unknown argument '-oProtocol 2'
foglietr at 172.16.119.6's password:
foglietr at 172.16.119.6's password:
foglietr at 172.16.119.6's password:
xset: unable to open display ""
xset: unable to open display ""
sftp>
~ #
~ # cat pippo
ls
ls
~ # sftp -b pippo -S /usr/bin/dbclient -s /usr/lib/openssh/sftp-server
foglietr at 172.16.119.6
WARNING: Ignoring unknown argument '-oForwardX11 no'
WARNING: Ignoring unknown argument '-oForwardAgent no'
WARNING: Ignoring unknown argument '-oPermitLocalCommand no'
WARNING: Ignoring unknown argument '-oClearAllForwardings yes'
WARNING: Ignoring unknown argument '-obatchmode yes'
WARNING: Ignoring unknown argument '-oProtocol 2'
foglietr at 172.16.119.6's password:
xset: unable to open display ""
xset: unable to open display ""
sftp> ls
[... ls print out ...]
sftp> ls
[... ls print out ...]
sftp>
~ #
--
Configure bugmail: http://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2007-Sep-18 12:29 UTC
[Bug 1365] sftp exits immediately after connection (fgets EAGAIN)
http://bugzilla.mindrot.org/show_bug.cgi?id=1365 --- Comment #1 from Roberto A. Foglietta <roberto.foglietta at gmail.com> 2007-09-18 22:29:01 --- Created an attachment (id=1353) --> (http://bugzilla.mindrot.org/attachment.cgi?id=1353) strace output of sftp immediately after connection exited -- Configure bugmail: http://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2007-Sep-18 12:30 UTC
[Bug 1365] sftp exits immediately after connection (fgets EAGAIN)
http://bugzilla.mindrot.org/show_bug.cgi?id=1365 --- Comment #2 from Roberto A. Foglietta <roberto.foglietta at gmail.com> 2007-09-18 22:30:05 --- Created an attachment (id=1354) --> (http://bugzilla.mindrot.org/attachment.cgi?id=1354) strace output collected with redirection of stderr (works) -- Configure bugmail: http://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2007-Sep-18 12:36 UTC
[Bug 1365] sftp exits immediately after connection (fgets EAGAIN)
http://bugzilla.mindrot.org/show_bug.cgi?id=1365 --- Comment #3 from Roberto A. Foglietta <roberto.foglietta at gmail.com> 2007-09-18 22:36:25 --- I forgot to say this bug has been noticed using sftp in conjunction with dropbear ssh but you should have seen it by the command line itself. -- Configure bugmail: http://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2007-Sep-18 12:42 UTC
[Bug 1365] sftp exits immediately after connection (fgets EAGAIN)
http://bugzilla.mindrot.org/show_bug.cgi?id=1365
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |djm at mindrot.org
--- Comment #4 from Damien Miller <djm at mindrot.org> 2007-09-18
22:42:29 ---
Can you replicate the problem running with OpenSSH ssh, or by bypassing
ssh entirely and having sftp talk directly to sftp-server? You can do
the latter using a commandline like the following:
sftp -P /usr/libexec/sftp-server blah
If I had to guess what the problem is, it would be that dropbear is
detecting a tty on stderr and putting /dev/tty into non-blocking mode
though it isn't clear why this should interfere with sftp, which is a
separate process.
--
Configure bugmail: http://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2007-Sep-18 13:07 UTC
[Bug 1365] sftp exits immediately after connection (fgets EAGAIN)
http://bugzilla.mindrot.org/show_bug.cgi?id=1365 --- Comment #5 from Roberto A. Foglietta <roberto.foglietta at gmail.com> 2007-09-18 23:07:15 --- (In reply to comment #4)> Can you replicate the problem running with OpenSSH ssh, or by bypassing > ssh entirely and having sftp talk directly to sftp-server?no as far as I can see.> You can do > the latter using a commandline like the following: > > sftp -P /usr/libexec/sftp-server blah~ # sftp -P /usr/libexec/sftp-server Attaching to /usr/libexec/sftp-server... sftp> ls pippo strace.log sftp> ~ # sftp -S /mnt/tmpfs/ssh.gzexe foglietr at 172.16.119.6 Connecting to 172.16.119.6... foglietr at 172.16.119.6's password: sftp> quit> > If I had to guess what the problem is, it would be that dropbear is > detecting a tty on stderr and putting /dev/tty into non-blocking mode > though it isn't clear why this should interfere with sftp, which is a > separate process. >anyway do you think this patch could hurt in sane enviroment? I used a usleep(10*1000) in order to not overload the system. -- Configure bugmail: http://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Jan-19 23:26 UTC
[Bug 1365] sftp exits immediately after connection (fgets EAGAIN)
https://bugzilla.mindrot.org/show_bug.cgi?id=1365
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WORKSFORME
--- Comment #6 from Damien Miller <djm at mindrot.org> 2008-01-20
10:26:42 ---
The patch just papers over the problem, which is probably in Dropbear
somewhere. I don't think this is a bug in OpenSSH, please reopen if you
can find evidence that it is.
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Apr-03 23:01 UTC
[Bug 1365] sftp exits immediately after connection (fgets EAGAIN)
https://bugzilla.mindrot.org/show_bug.cgi?id=1365
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #7 from Damien Miller <djm at mindrot.org> 2008-04-04
10:01:01 ---
Close resolved bugs after release.
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
Possibly Parallel Threads
- [Bug 2233] New: curve25519-sha256@libssh.org Signature Failures When 'sshd' Used with Dropbear Clients
- OpenSSH Always Hangs When Connecting to Remote
- Debian Stretch 9.6: openssh-server and old dropbear client don't work togheter
- [ANNOUNCE] xset 1.2.4
- [ANNOUNCE] xset 1.0.4