From 22d6c36800f2ade82e030b9f1321c19cb5ce2db9 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Wed, 5 Feb 2014 22:29:22 +0100 Subject: [PATCH] Revert f2c2687ca6c6c7e25c9a547227027ab28eb4fc16 Fix bug #142 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. --- src/scp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scp.c b/src/scp.c index a245402a..0208ddc5 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),"%.4d",mode); + snprintf(buffer,sizeof(buffer),"%.4o",mode); return strdup(buffer); }