aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-03 22:21:43 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-03 22:23:51 +0200
commitbea66b6476face16a810585c7cef8e359efb7d9a (patch)
treed91e2870f1596557c8982f420e8874f4f80c4352
parenta8111934d567aeee1973b6eddd6ee808192cdba8 (diff)
downloadlibssh-bea66b6476face16a810585c7cef8e359efb7d9a.tar.gz
libssh-bea66b6476face16a810585c7cef8e359efb7d9a.tar.xz
libssh-bea66b6476face16a810585c7cef8e359efb7d9a.zip
examples: Fix permissions of the file we copy.
Thanks to Baptiste Marchand. (cherry picked from commit 15ebbad146d980a33cd14e9fe4d99b4a7f69a46b)
-rw-r--r--examples/libssh_scp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/libssh_scp.c b/examples/libssh_scp.c
index c3dc1d62..5e3ba61e 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 & S_IFMT;
+ mode = s.st_mode & ~S_IFMT;
filename=ssh_basename(src->path);
} else {
size=0;