From 06b8084b2cf9308fe0cbbcdde0741a881b7609fb Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Mon, 23 Jan 2012 05:30:00 +0000 Subject: Ensure that when -F is passed, existing files are truncated properly. Signed-off-by: Robin H. Johnson --- src/rc/checkpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c index 0aee4465..86623d94 100644 --- a/src/rc/checkpath.c +++ b/src/rc/checkpath.c @@ -61,7 +61,7 @@ do_check(char *path, uid_t uid, gid_t gid, mode_t mode, inode_t type, bool trunc struct stat st; int fd, flags; - if (stat(path, &st)) { + if (stat(path, &st) || trunc) { if (type == inode_file) { einfo("%s: creating file", path); if (!mode) /* 664 */ -- cgit v1.2.3