From 9f26763ec6139711944e43abd27245c2e67a83ac Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 18 May 2014 18:10:24 +0200 Subject: [PATCH] Opens the file read-only when setting the timestamp. --- cmdline/nano.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdline/nano.c b/cmdline/nano.c index d9299dc7..a387f2c6 100644 --- a/cmdline/nano.c +++ b/cmdline/nano.c @@ -63,7 +63,7 @@ void state_nano(struct snapraid_state* state) /* open it */ /* O_NOFOLLOW: do not follow links to ensure to open the real file */ - f = open(path, O_WRONLY | O_BINARY | O_NOFOLLOW); + f = open(path, O_RDONLY | O_BINARY | O_NOFOLLOW); if (f == -1) { /* LCOV_EXCL_START */ fprintf(stderr, "Error opening file '%s'. %s.\n", path, strerror(errno));