summaryrefslogtreecommitdiff
path: root/usr.bin/modstat
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-06 18:42:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-06 18:42:47 +0000
commit29c9832f6c6b865c809911af28214d7583e332e7 (patch)
tree28144a85b7c509fdcb1ff6016e5d308b4ca1749f /usr.bin/modstat
parent8cee62f01b2476c08af03735a81064676dc404f8 (diff)
revoke privs after open
Diffstat (limited to 'usr.bin/modstat')
-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");