[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing an SFTP Server Using lobs she


On Tuesday, 20 June 2017 00:00:06 CEST Stef Bon wrote:
> 2017-06-19 23:26 GMT+02:00 skerbsf@xxxxxxxxx <skerbsf@xxxxxxxxx>:
> > Andreas,
> > Thanks for the response!  I believe this is exactly what I am looking for.
> > Still getting the feel for the API.
> > 
> > Still not sure what to do exactly. The first message I get back is
> > SSH_FXP_REALPATH.  I believe this is the initial directory that the user
> > is
> > to be placed in?  Here is what I have added (without error handling for
> > better readability):
> > 
> > while (1)
> > {
> > 
> >     msg = sftp_get_client_message();
> >     type = sftp_client_message_get_type();
> >     
> >     if (type == SSH_FXP_REALPATH)
> 
> It's possible to handle every incoming type of message this way, but
> better in my opinion is
> to use an array with 256 size of callbacks for every type. You need
> 256 cause the type is defined
> as a single byte.
> Futher you can assign valid callbacks for the known types
> (SSH_FXP_INIT - SSH_FXP_UNBLOCK etc)
> and a default cb for the rest, which sends a "SSH_FX_OP_UNSUPPORTED".

The better way would be to reimplement the sftp-server using callbacks like 
the rest of the ssh server we have. Then all you have to do is to define the 
callblacks.


	Andreas


-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx

Follow-Ups:
Re: Writing an SFTP Server Using lobs sheStef Bon <stefbon@xxxxxxxxx>
References:
Writing an SFTP Server Using lobs she"skerbsf@xxxxxxxxx" <skerbsf@xxxxxxxxx>
Re: Writing an SFTP Server Using lobs she"skerbsf@xxxxxxxxx" <skerbsf@xxxxxxxxx>
Re: Writing an SFTP Server Using lobs sheStef Bon <stefbon@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org