tAdjust permissions depending on action - dedup - deduplicating backup program
(HTM) git clone git://git.z3bra.org/dedup.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 6ef656f41685cb55c4e982d08cfebc79bd1bc83e
(DIR) parent 9ff8b1f2c9ac45e6b1f3184278a1faa1c0362e9f
(HTM) Author: sin <sin@2f30.org>
Date: Wed, 21 Mar 2018 14:11:31 +0000
Adjust permissions depending on action
Diffstat:
M dedup.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/dedup.c b/dedup.c
t@@ -537,7 +537,10 @@ main(int argc, char *argv[])
}
if (argc == 1) {
- fd = open(argv[0], O_RDWR | O_CREAT, 0600);
+ if (id)
+ fd = open(argv[0], O_RDWR | O_CREAT, 0600);
+ else
+ fd = open(argv[0], O_RDONLY);
if (fd == -1)
err(1, "open %s", argv[0]);
}