Nick Zitzmann | 2 Apr 2007 22:46

Re: Patch to send arbitrary SFTP commands


On Apr 1, 2007, at 3:42 PM, Daniel Stenberg wrote:

> I addressed all these issues, and made the code a lot more compact  
> with less multiple identical code sections and exact parsing of  
> commands (by including the separating space in the string comparison).
>
> I also made it use the curl-style of indenting all over.
>
> I didn't however actually try this on a live server, so I would be  
> very happy if you or someone else could try the attached patch and  
> verify that it still works, or if I broke something, please fix it  
> and re-submit and updated version.

Thank you for the changes. I didn't try anything other than rm, which  
is the only command I needed at the time, which is why I missed the  
rmdir problem.

About the following code:

   while (item) {
     if (item->data) {
       char *path1 = NULL;
       char *path2 = NULL;

Is that acceptable? I didn't think code like that would compile under  
GCC 2.95 and older compilers. I never saw anything like that  
elsewhere in the CURL code, but maybe I didn't look hard enough...

I corrected a crash bug in parameter parsing (if a parameter was  
missing then the program crashed instead of returning an error). See  
corrected patch attached. Other than that, I tested all commands and  
they all worked as expected.

Nick Zitzmann
<http://www.chronosnet.com/>
Attachment (sftp_quote-4.patch): application/octet-stream, 12 KiB


Gmane