Bug 761 - sftp not exiting in batch mode
Summary: sftp not exiting in batch mode
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp (show other bugs)
Version: 3.6.1p2
Hardware: All AIX
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-18 11:14 AEDT by Mark Murray
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments
sshd_config file (18.29 KB, text/plain)
2003-11-18 14:21 AEDT, Tim Schauer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Murray 2003-11-18 11:14:57 AEDT
The root cause appears to be the way sshd parses it's configuration file and 
subsequently processes exit codes from subprocesses (such as sftp-server).  
When the sftp server exits , it passes either a signal or exit code back to 
sshd, and then sshd should in turn drop the connection.  sshd does not drop the 
connection.  However, when we switch LogLevel from INFO to DEBUG in 
sshd_config, when sftp exits, sshd now exits properly.  The only difference 
here, is the processing thread within sshd's subsystem shell.  We even verified 
different versions of the sftp-server subsystem, both with the same results.
Comment 1 Damien Miller 2003-11-18 12:44:34 AEDT
Can't replicate:

[djm@sakura djm]$ sftp -b testbatch localhost
Connecting to localhost...
root@localhost's password:
sftp> get /bin/ls /tmp/foo
Fetching /bin/ls to /tmp/foo
sftp> ls /tmp/foo
/tmp/foo
sftp> put /tmp/foo /tmp/bar
Uploading /tmp/foo to /tmp/bar
Uploading /tmp/foo to /tmp/bar
sftp> ls -l /tmp/bar
-rwxr-xr-x    0 0        0          178028 Nov 19 06:42 /tmp/bar
sftp>
sftp>
[djm@sakura djm]$ ps ax | grep sftp
 3917 p2  I+      0:00.01 grep sftp
[djm@sakura djm]$ cat testbatch
get /bin/ls /tmp/foo
ls /tmp/foo
put /tmp/foo /tmp/bar
ls -l /tmp/bar
 
Comment 2 Tim Schauer 2003-11-18 14:21:51 AEDT
Created attachment 502 [details]
sshd_config file

try changing the LogLevel from DEBUG3 to INFO or AUTH, it appears that sftp
doesn't exit (this test was conducted from a sun client to an AIX sftp-server.
Comment 3 Darren Tucker 2003-11-18 17:07:27 AEDT
Can't replicate either (AIX 5.2 ML1), with LogLevel either INFO or DEBUG3.  
Tried both a local and remote (Solaris 8) client.

What version and maintenance level of AIX do you have?  Can you replicate with 
both client and server on the AIX box?  For that matter, can you replicate with 
the current version of OpenSSH?  Can you attach (note: create attachment, not 
paste into comments) the debug output from sftp (eg "sftp -vvv -b testbatch 
localhost").

$ echo `uname` `oslevel -r`
AIX 5200-01
$ ssh -V
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090702f
 grep LogLevel /usr/local/etc/sshd_config
LogLevel INFO
$ sftp -b testbatch localhost
Connecting to localhost...
dtucker@localhost's password:
sftp> get /bin/ls /tmp/foo
sftp> ls /tmp/foo
/tmp/foo
sftp> put /tmp/foo /tmp/bar
Uploading /tmp/foo to /tmp/bar
sftp> ls -l /tmp/bar
-rwxr-xr-x    0 500      1           22488 Nov 19 11:00 /tmp/bar
sftp>
$ ps -eaf |grep sftp
 dtucker  2610 10118   1 11:00:27  pts/0  0:00 grep sftp
Comment 4 Darren Tucker 2003-12-23 00:25:44 AEDT
No followup = closed bug.
Comment 5 Damien Miller 2004-04-14 12:24:20 AEST
Mass change of RESOLVED bugs to CLOSED