summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2021-10-24 21:24:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2021-10-24 21:24:23 +0000
commitacc343614063e6fcbfd2871022b325f7f58f01cf (patch)
tree116317e06df569f5951d37b46db5c27b2326b826 /sys/arch
parent45b1bea4b11d2420bea5874f47944b05075dd1b0 (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 'sys/arch')
-rw-r--r--sys/arch/alpha/stand/headersize.c4
-rw-r--r--sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/alpha/stand/headersize.c b/sys/arch/alpha/stand/headersize.c
index 16ede3411d5..93ff855e1e7 100644
--- a/sys/arch/alpha/stand/headersize.c
+++ b/sys/arch/alpha/stand/headersize.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: headersize.c,v 1.10 2013/10/15 05:17:31 deraadt Exp $ */
+/* $OpenBSD: headersize.c,v 1.11 2021/10/24 21:24:22 deraadt Exp $ */
/* $NetBSD: headersize.c,v 1.5 1996/09/23 04:32:59 cgd Exp $ */
/*
@@ -59,7 +59,7 @@ main(argc, argv)
errx(1, "load addr argument (%s) not valid", argv[1]);
fname = argv[2];
- if ((fd = open(fname, O_RDONLY, 0)) == -1)
+ if ((fd = open(fname, O_RDONLY)) == -1)
err(1, "%s: open failed", fname);
if (read(fd, &buf, HDR_BUFSIZE) != HDR_BUFSIZE)
diff --git a/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c b/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
index 428be1693d3..042c34e1e83 100644
--- a/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
+++ b/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setnetbootinfo.c,v 1.4 2014/07/12 19:01:49 tedu Exp $ */
+/* $OpenBSD: setnetbootinfo.c,v 1.5 2021/10/24 21:24:22 deraadt Exp $ */
/* $NetBSD: setnetbootinfo.c,v 1.5 1997/04/06 08:41:37 cgd Exp $ */
/*
@@ -168,7 +168,7 @@ main(argc, argv)
if (verbose)
printf("opening %s...\n", netboot);
- if ((fd = open(netboot, O_RDONLY, 0)) == -1)
+ if ((fd = open(netboot, O_RDONLY)) == -1)
err(1, "open: %s", netboot);
if (fstat(fd, &sb) == -1)
err(1, "fstat: %s", netboot);