access and disable further calls to unveil(2) with unveil(NULL, NULL).
OK ratchov@
-/* $OpenBSD: audioctl.c,v 1.35 2017/05/31 04:18:58 jsg Exp $ */
+/* $OpenBSD: audioctl.c,v 1.36 2018/09/17 14:14:39 mestre Exp $ */
/*
* Copyright (c) 2016 Alexandre Ratchov <alex@caoua.org>
*
argc -= optind;
argv += optind;
+ if (unveil(path, "rw") == -1)
+ err(1, "unveil");
+ if (unveil(NULL, NULL) == -1)
+ err(1, "unveil");
+
fd = open(path, O_RDWR);
if (fd < 0)
err(1, "%s", path);