[Bug 1365] New: sftp exits immediately after connection (fgets EAGAIN)

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Tue Sep 18 22:27:26 EST 2007


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.


More information about the openssh-bugs mailing list