1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-29 13:01:13 +03:00
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.
This commit is contained in:
Aris Adamantiadis
2014-02-05 22:29:22 +01:00
parent c28ad814d0
commit 22d6c36800

View File

@ -814,7 +814,7 @@ int ssh_scp_integer_mode(const char *mode){
*/ */
char *ssh_scp_string_mode(int mode){ char *ssh_scp_string_mode(int mode){
char buffer[16]; char buffer[16];
snprintf(buffer,sizeof(buffer),"%.4d",mode); snprintf(buffer,sizeof(buffer),"%.4o",mode);
return strdup(buffer); return strdup(buffer);
} }