Hi all,
I just noticed that aucat(1) is missing pledge. However, I'm aware that
aucat(1) is talking to sndiod(8), which is being pledged properly. But
seeing that programs like yes(1) is properly pledged, I don't see any
reason not to pledge aucat(1) as well, unless I'm missing something
obvious.
Regards,
Jesper Wallin
Index: aucat.c
===================================================================
RCS file: /cvs/src/usr.bin/aucat/aucat.c,v
retrieving revision 1.172
diff -u -p -r1.172 aucat.c
--- aucat.c 7 Nov 2017 11:39:24 -0000 1.172
+++ aucat.c 3 May 2018 19:13:14 -0000
@@ -14,6 +14,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <err.h>
#include <errno.h>
#include <limits.h>
#include <poll.h>
@@ -1452,6 +1453,9 @@ main(int argc, char **argv)
log_puts(usagestr);
return 1;
}
+ if (mode & SIO_REC &&
+ pledge("stdio rpath wpath cpath unix dns", NULL) == -1)
+ err(1, "pledge");
if (n_flag) {
if (dev != NULL || port != NULL) {
log_puts("-f and -q make no sense in off-line mode\n");
@@ -1461,6 +1465,8 @@ main(int argc, char **argv)
log_puts("both -i and -o required\n");
return 1;
}
+ if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ err(1, "pledge");
if (!offline())
return 1;
} else {
@@ -1470,6 +1476,9 @@ main(int argc, char **argv)
log_puts("at least -i or -o required\n");
return 1;
}
+ if (mode & SIO_PLAY &&
+ pledge("stdio rpath unix dns", NULL) == -1)
+ err(1, "pledge");
if (!playrec(dev, mode, bufsz, port))
return 1;
}