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

Re: [libssh - Bug #142] (New) scp broken in 0.6.0


Olivier,

Orion posted on the bugtracker that this particular commit breaks scp.
At the time when you proposed it, I was a little skeptic but let it go
through, as it was not easy to verify. Do you remember which problem
that patch fixed for you ?
Would it be possible that openssh accepts decimal or octal depending on
some factors ? (first digit being a zero or something else).

Thanks for figuring out, I wouldn't want to break your app by reverting
this commit.

Aris



Le 22/01/14 21:48, libssh-tickets@xxxxxxxxxx a écrit :
> Issue #142 has been reported by Orion Poplawski.
> 
> ----------------------------------------
> Bug #142: scp broken in 0.6.0
> https://red.libssh.org/issues/142
> 
> * Author: Orion Poplawski
> * Status: New
> * Priority: Urgent
> * Assignee: Aris Adamantiadis
> * Category: scp
> * Target version: 0.6.1
> ----------------------------------------
> This commit broke scp:
> 
> commit f2c2687ca6c6c7e25c9a547227027ab28eb4fc16
> Author: Oliver Stöneberg <oliverst@xxxxxxxxx>
> Date:   Fri Oct 18 14:58:04 2013 +0200
> 
>     scp: Fixed result of ssh_scp_string_mode() to get SCP working.
> 
>     Reviewed-by: Andreas Schneider <asn@xxxxxxxxxxxxxx>
> 
> diff --git a/src/scp.c b/src/scp.c
> index 6838a3c..db07aed 100644
> --- a/src/scp.c
> +++ b/src/scp.c
> @@ -814,7 +814,7 @@ int ssh_scp_integer_mode(const char *mode){
>   */
>  char *ssh_scp_string_mode(int mode){
>         char buffer[16];
> -       snprintf(buffer,sizeof(buffer),"%.4o",mode);
> +       snprintf(buffer,sizeof(buffer),"%.4d",mode);
>         return strdup(buffer);
>  }
> 
> 
> The mode does need to be an octal numeric string.  Mode 0600 now gets sent on the wire as 0384, triggering a "scp: protocol error: bad mode" response, and an "scp status code 1d not valid" message from libssh.
> 
> 
> 

Archive administrator: postmaster@lists.cynapses.org