summaryrefslogtreecommitdiff
path: root/usr.sbin/eeprom/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/eeprom/main.c')
-rw-r--r--usr.sbin/eeprom/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/eeprom/main.c b/usr.sbin/eeprom/main.c
index b5d06d5baff..48fccb98b8c 100644
--- a/usr.sbin/eeprom/main.c
+++ b/usr.sbin/eeprom/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.4 1996/07/22 02:01:50 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.5 1998/07/08 22:13:26 deraadt Exp $ */
/* $NetBSD: main.c,v 1.3 1996/05/16 16:00:55 thorpej Exp $ */
/*-
@@ -161,8 +161,10 @@ main(argc, argv)
argv += optind;
#ifdef __sparc__
- if (system != NULL)
+ if (system != NULL) {
+ setegid(getgid());
setgid(getgid());
+ }
if (getcputype() != CPU_SUN4)
use_openprom = 1;
#endif /* __sparc__ */
@@ -223,6 +225,9 @@ getcputype()
if ((kd = kvm_openfiles(system, NULL, NULL, O_RDONLY, errbuf)) == NULL)
errx(1, "can't open kvm: %s", errbuf);
+ setegid(getgid());
+ setgid(getgid());
+
if (kvm_nlist(kd, nl))
KVM_ABORT(kd, "can't read symbol table");