[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Writing an SFTP Server Using lobs she
[Thread Prev] | [Thread Next]
- Subject: Re: Writing an SFTP Server Using lobs she
- From: "skerbsf@xxxxxxxxx" <skerbsf@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 19 Jun 2017 21:26:02 +0000
- To: libssh@xxxxxxxxxx
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)
{
/* what do I do here?
* am I supposed to use msg->filename
* to change the directory?
*/
/* what message do I send back to
* the client on success? on failure?
* How do I respond?
* sftp_reply_status()?
* in order to set the type in the message
* I would think there should be a function
* like sftp_client_message_set_type()
*/
}
else if (type == ...)
{
}
}
Again thanks so much for your help! Still have a ways to go to understand
the feel of the library, but getting there.
On Mon, Jun 19, 2017 at 5:01 AM Andreas Schneider <asn@xxxxxxxxxxxxxx>
wrote:
> On Saturday, 17 June 2017 05:56:11 CEST skerbsf@xxxxxxxxx wrote:
> > sftp_server_new();
> > sftp_server_init();
> >
> >
> > Now once I have done the sftp_server_init() I am unsure what to do or
> where
> > to go from here. The API documentation doesn't give much help for sftp
> > servers. I would like to basically begin handling client requests at this
> > point (i.e. user types "put ..." or "ls -al").
> >
> > Are there any examples for this. The tutorial only really seems to show
> > what needs to be done when writing a client application.
> >
> > Thanks for any examples or help!
>
> Hi,
>
> the problem is that the sftp server should be rewritten to use callbacks
> like
> the rest of the server. We didn't have the time to do that yet. Help in
> that
> area is much appreciated.
>
>
> ou need to use messages to deal with sftp.
>
> sftp_get_client_message() is what you're looking for.
>
>
> Andreas
>
> --
> Andreas Schneider GPG-ID: CC014E3D
> www.cryptomilk.org asn@xxxxxxxxxxxxxx
>
>
| Re: Writing an SFTP Server Using lobs she | Stef Bon <stefbon@xxxxxxxxx> |
| Writing an SFTP Server Using lobs she | "skerbsf@xxxxxxxxx" <skerbsf@xxxxxxxxx> |
| Re: Writing an SFTP Server Using lobs she | Andreas Schneider <asn@xxxxxxxxxxxxxx> |