newbie wants to compile SCP into his own application

aplumb at westpac.com.au aplumb at westpac.com.au
Mon Feb 24 12:19:39 EST 2003


OK, I'll look into using sftp instead.... do you (or anyone else) have
sample code for integrating sftp ?


Andrew.




                                                                                                                     
                    Ben Lindstrom                                                                                    
                    <mouring at etoh.evil        To:     aplumb at westpac.com.au                                          
                    admin.org>                cc:     openssh-unix-dev at mindrot.org                                   
                                              Subject:     Re: newbie wants to compile SCP into his own application  
                    20/02/2003 10:07                                                                                 
                                                                                                                     
                                                                                                                     





First off I suggest you look at sftp rather than scp.  There are less
integration issues and I believe you'll be more happy with the results.

Second, you just can just add scp.c and libopenbsd-compat.a into your code
and think you don't have nay more external dependances.  Just keep in mind
scp forks to call ssh (same is true with sftp).

But in general, sftp code is much friendlier for integrating since it was
designed for that reason.  scp (for how wonderful it is) is really a hack
on a hack on a hack.=)

- Ben



On Thu, 20 Feb 2003 aplumb at westpac.com.au wrote:

> Hi all,
>
> I have seen in the OpenSSH source that the scp executable is built by
> compiling scp.c and linking with libopenbsd-compat.a and libssh.a.
(Correct
> me here if I'm wrong)
>
> My question is, can I make this a module in my own application by using
the
> scp.c source and ilnking the libraries mentioned above ? The reason is, I
> want to perform an SCP from my application, but I don't want to execute
the
> external command line utility "scp". I want to be able to get a return
> value to indicate success or failure and handle this in my app.
>
> Thanks,
>
> Andrew Plumb.
>






More information about the openssh-unix-dev mailing list