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 dca415a38e
commit da5fa4ef66

View File

@@ -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);
}