From fe62ed0d48b8cf7e4af9b029276f38a35ae87363 Mon Sep 17 00:00:00 2001 From: sin Date: Tue, 18 Feb 2014 16:49:41 +0000 Subject: [PATCH] Preserve permissions when copying files --- util/cp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cp.c b/util/cp.c index 840a72a..9aa637d 100644 --- a/util/cp.c +++ b/util/cp.c @@ -66,9 +66,9 @@ cp(const char *s1, const char *s2) eprintf("fopen %s:", s2); concat(f1, s1, f2, s2); + fchmod(fileno(f2), st.st_mode); fclose(f2); fclose(f1); return 0; } -