From 5492478e6181173eae5dadab6e76d5dc8b4f0d99 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Thu, 30 Jan 2020 05:17:08 +0000 Subject: Don't open the device for reading. --- usr.bin/audioctl/audioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/audioctl') diff --git a/usr.bin/audioctl/audioctl.c b/usr.bin/audioctl/audioctl.c index 4b84f158e84..1a53bdbc4e4 100644 --- a/usr.bin/audioctl/audioctl.c +++ b/usr.bin/audioctl/audioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audioctl.c,v 1.37 2019/06/28 13:35:00 deraadt Exp $ */ +/* $OpenBSD: audioctl.c,v 1.38 2020/01/30 05:17:07 ratchov Exp $ */ /* * Copyright (c) 2016 Alexandre Ratchov * @@ -217,12 +217,12 @@ main(int argc, char **argv) argc -= optind; argv += optind; - if (unveil(path, "rw") == -1) + if (unveil(path, "w") == -1) err(1, "unveil"); if (unveil(NULL, NULL) == -1) err(1, "unveil"); - fd = open(path, O_RDWR); + fd = open(path, O_WRONLY); if (fd == -1) err(1, "%s", path); if (ioctl(fd, AUDIO_GETSTATUS, &rstatus) == -1) -- cgit v1.2.3