From a80e765420338bc9cad1d7bd71cc1722135274da Mon Sep 17 00:00:00 2001 From: visa Date: Wed, 2 Feb 2022 13:22:10 +0000 Subject: [PATCH] Add missing mode argument to open(2) with O_CREAT. --- usr.sbin/installboot/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/installboot/util.c b/usr.sbin/installboot/util.c index ba5ee2f0e9c..0ffd5e742f9 100644 --- a/usr.sbin/installboot/util.c +++ b/usr.sbin/installboot/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.14 2019/07/03 03:24:03 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.15 2022/02/02 13:22:10 visa Exp $ */ /* * Copyright (c) 2014 Joel Sing @@ -52,7 +52,7 @@ filecopy(const char *srcfile, const char *dstfile) } sz = sb.st_size; - dfd = open(dstfile, O_WRONLY|O_CREAT); + dfd = open(dstfile, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); if (dfd == -1) { warn("open %s", dstfile); return (-1); -- 2.20.1