aboutsummaryrefslogtreecommitdiff
path: root/examples/libssh_scp.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/libssh_scp.c')
-rw-r--r--examples/libssh_scp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/libssh_scp.c b/examples/libssh_scp.c
index 83e60b53..c3dc1d62 100644
--- a/examples/libssh_scp.c
+++ b/examples/libssh_scp.c
@@ -182,7 +182,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive){
fd=fileno(src->file);
fstat(fd,&s);
size=s.st_size;
- mode=s.st_mode;
+ mode = s.st_mode & S_IFMT;
filename=ssh_basename(src->path);
} else {
size=0;
@@ -207,7 +207,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive){
}
if(dest->is_ssh){
- r=ssh_scp_push_file(dest->scp,src->path,size,0644);
+ r=ssh_scp_push_file(dest->scp,src->path, size, mode);
// snprintf(buffer,sizeof(buffer),"C0644 %d %s\n",size,src->path);
if(r==SSH_ERROR){
fprintf(stderr,"error: %s\n",ssh_get_error(dest->session));