Openssh sshd causing incoming scp to write 0 length file

This is a discussion on Openssh sshd causing incoming scp to write 0 length file within the OpenSSH Development forums, part of the Networking and Network Related category; I'm trying to trace through Openssh to figure out where in the code the sshd server (or whatever it ...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-16-2007
plu777@gmail.com
 
Posts: n/a
Default Openssh sshd causing incoming scp to write 0 length file

I'm trying to trace through Openssh to figure out where in the code
the sshd server
(or whatever it forks/execs) writes the file when a client runs scp to
copy a file to
the server. I have a situation where the destination file is created,
but with 0 length,
even thought the transferred file is non-0 in length. I see that sshd
(SSH2) uses
the efd (extended file descriptor?) to input the data and have know
that its type,
SSH2_MSG_CHANNEL_DATA = 94, is handled by the channel_input_data
handler. Channel_input_data puts the data on c->output using
buffer_append,
but have no idea which component picks up this data and delivers it to
the
code that (is supposed to) writes the file.

I'm running the SSH2 protocol (compat20). I see some code in
process_output
in serverloop.c that does writes for SSH1 (!compat20), but can't find
anything
similar for SSH2.

I'm working on an embedded target system, so debugging resources are
limited.
I've even tried to run sshd under gdb on my development system just to
get a
better grip on how the data is supposed to flow and what the intended
code
path should be. However, because of the forks/execs that sshd does
and the
timing limitations in the protocol, I can't figure out the code. If
someone can
give me hints on how to use gdb to "trace" through the code, then that
may
help a lot as well. Right now, I just have the debug[123]() printing
to try to
figure things out.

Thanks for all help.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:54 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0