summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1998-07-06 18:42:46 +0000
committerderaadt <deraadt@openbsd.org>1998-07-06 18:42:46 +0000
commitbb488c017fd0101fac6eb75d1ee10b6fd891829e (patch)
treef36a65538c1241590963cb0b9e946a5d46cc1a7c
parentkill non-POSIX S_IWRITE (diff)
downloadwireguard-openbsd-bb488c017fd0101fac6eb75d1ee10b6fd891829e.tar.xz
wireguard-openbsd-bb488c017fd0101fac6eb75d1ee10b6fd891829e.zip
revoke privs after open
-rw-r--r--usr.bin/modstat/modstat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/modstat/modstat.c b/usr.bin/modstat/modstat.c
index e4193613fb4..0f76a0de171 100644
--- a/usr.bin/modstat/modstat.c
+++ b/usr.bin/modstat/modstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modstat.c,v 1.10 1997/11/18 23:23:18 provos Exp $ */
+/* $OpenBSD: modstat.c,v 1.11 1998/07/06 18:42:46 deraadt Exp $ */
/*
* Copyright (c) 1993 Terrence R. Lambert.
@@ -161,6 +161,9 @@ main(argc, argv)
if ((devfd = open(_PATH_LKM, O_RDONLY, 0)) == -1)
err(2, _PATH_LKM);
+ setegid(getgid());
+ setgid(getgid());
+
atexit(cleanup);
printf("Type Id Off Loadaddr Size Info Rev Module Name\n");