v2 connection logging vs v1

Will Day willday at rom.oit.gatech.edu
Wed Aug 9 09:00:32 EST 2000


When connecting with v1, the server logs a message when I exit my login
shell:
   Closing connection to 130.207.167.32

However, when connecting with v2, it only ever logs:
   Connection closed by remote host.

Tracing through the code, it appears that instead of breaking in
serverloop.c:server_loop2() at:

   if (had_channel && !channel_still_open()) {
      debug("!channel_still_open.");
      break;
   }

and returning to sshd.c:main() and logging the nice message, it continues
to process_input(), gets a len==0 from the read(), and does:

   verbose("Connection closed by remote host.");
   fatal_cleanup();

Comparing the v1 server_loop and the v2 server_loop2, the v1 loop appears
to have significantly more checks for breaking the loop:

   if (((fdout_eof && fderr_eof) ||
       (child_terminated && child_has_selected)) &&
       !packet_have_data_to_write() &&
       (buffer_len(&stdout_buffer) == 0) &&
            (buffer_len(&stderr_buffer) == 0)) {
           if (!channel_still_open())
                   break;

as well as other useful logging information, like:

   debug("End of interactive session; stdin %ld, stdout (read %ld, sent %ld), stderr %ld bytes.",
              stdin_bytes, fdout_bytes, stdout_bytes, stderr_bytes);

which aren't in the v2 server_loop2.

I'd suggest a patch here, but I don't know enough about the code nor
protocols to know how much these v1 conventions can be applied to v2.  

It sure would be nice to have a v2 connection log the same information a v1
connection does, though.

-- 
Will Day     <PGP mail preferred>     OIT / O&E / Technical Support
willday at rom.oit.gatech.edu            Georgia Tech, Atlanta 30332-0715
  -> Opinions expressed are mine alone and do not reflect OIT policy <-
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    Benjamin Franklin, Pennsylvania Assembly, Nov. 11, 1755
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 360 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20000808/afa38e72/attachment.bin 


More information about the openssh-unix-dev mailing list