unveil _PATH_DEVDB for devname(). All other filenames are opened
authorderaadt <deraadt@openbsd.org>
Fri, 3 Aug 2018 14:39:55 +0000 (14:39 +0000)
committerderaadt <deraadt@openbsd.org>
Fri, 3 Aug 2018 14:39:55 +0000 (14:39 +0000)
before unveil/pledge.

usr.sbin/pstat/pstat.c

index e0e3f33..79499d8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pstat.c,v 1.117 2018/06/18 09:15:05 mpi Exp $ */
+/*     $OpenBSD: pstat.c,v 1.118 2018/08/03 14:39:55 deraadt Exp $     */
 /*     $NetBSD: pstat.c,v 1.27 1996/10/23 22:50:06 cgd Exp $   */
 
 /*-
@@ -229,6 +229,8 @@ main(int argc, char *argv[])
                        ttymodeprep();
        }
 
+       if (unveil(_PATH_DEVDB, "r") == -1)
+               err(1, "unveil");
        if (pledge("stdio rpath vminfo", NULL) == -1)
                err(1, "pledge");