summaryrefslogtreecommitdiff
path: root/usr.sbin/ldomd/ldomd.c
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 /usr.sbin/ldomd/ldomd.c
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 'usr.sbin/ldomd/ldomd.c')
-rw-r--r--usr.sbin/ldomd/ldomd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ldomd/ldomd.c b/usr.sbin/ldomd/ldomd.c
index 50f41c1631b..0a853e29be6 100644
--- a/usr.sbin/ldomd/ldomd.c
+++ b/usr.sbin/ldomd/ldomd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldomd.c,v 1.10 2019/11/28 18:40:42 kn Exp $ */
+/* $OpenBSD: ldomd.c,v 1.11 2021/10/24 21:24:18 deraadt Exp $ */
/*
* Copyright (c) 2012 Mark Kettenis
@@ -216,7 +216,7 @@ main(int argc, char **argv)
char path[PATH_MAX];
snprintf(path, sizeof(path), "/dev/vdsp%d", i);
- if (open(path, O_RDWR, 0) == -1)
+ if (open(path, O_RDWR) == -1)
break;
}
@@ -436,7 +436,7 @@ hv_open(void)
ssize_t nbytes;
uint64_t code;
- hvctl_fd = open("/dev/hvctl", O_RDWR, 0);
+ hvctl_fd = open("/dev/hvctl", O_RDWR);
if (hvctl_fd == -1)
fatal("cannot open /dev/hvctl");