diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2021-10-24 21:24:23 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2021-10-24 21:24:23 +0000 |
commit | acc343614063e6fcbfd2871022b325f7f58f01cf (patch) | |
tree | 116317e06df569f5951d37b46db5c27b2326b826 /usr.sbin/rpki-client/main.c | |
parent | 45b1bea4b11d2420bea5874f47944b05075dd1b0 (diff) |
For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef.
ok millert
Diffstat (limited to 'usr.sbin/rpki-client/main.c')
-rw-r--r-- | usr.sbin/rpki-client/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c index 460a895490e..f83a4bad05f 100644 --- a/usr.sbin/rpki-client/main.c +++ b/usr.sbin/rpki-client/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.153 2021/10/24 16:59:14 claudio Exp $ */ +/* $OpenBSD: main.c,v 1.154 2021/10/24 21:24:19 deraadt Exp $ */ /* * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org> * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> @@ -783,9 +783,9 @@ main(int argc, char *argv[]) goto usage; } - if ((cachefd = open(cachedir, O_RDONLY | O_DIRECTORY, 0)) == -1) + if ((cachefd = open(cachedir, O_RDONLY | O_DIRECTORY)) == -1) err(1, "cache directory %s", cachedir); - if ((outdirfd = open(outputdir, O_RDONLY | O_DIRECTORY, 0)) == -1) + if ((outdirfd = open(outputdir, O_RDONLY | O_DIRECTORY)) == -1) err(1, "output directory %s", outputdir); check_fs_size(cachefd, cachedir); |