aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/copy_file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index eb9cb1a16..7e5d11e67 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -147,6 +147,7 @@ copy_file(const char *src_name, const char *dst_name,
}
dst_file = fopen(dst_name, "w");
+ chmod(dst_name, srcStatBuf.st_mode);
if (dst_file == NULL) {
if (!quiet_flag) {
perror_msg("%s", dst_name);