summaryrefslogtreecommitdiff
path: root/sbin/dump/optr.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-01 15:31:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-01 15:31:04 +0000
commit4f427464f8448fd439e17fc9e4ecc8a1f8c2c93c (patch)
tree896f7a00fae520296b7fcf526216ec9482c2c2fa /sbin/dump/optr.c
parent9435f46851bb0822fb093b6853202b28649a867a (diff)
kill setuid, fix setgid hole
Diffstat (limited to 'sbin/dump/optr.c')
-rw-r--r--sbin/dump/optr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index 6147b6772ce..836446289a8 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: optr.c,v 1.8 1996/09/01 15:30:18 deraadt Exp $ */
+/* $OpenBSD: optr.c,v 1.9 1996/09/01 15:31:03 deraadt Exp $ */
/* $NetBSD: optr.c,v 1.4 1996/05/18 16:16:17 jtk Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
#else
-static char rcsid[] = "$OpenBSD: optr.c,v 1.8 1996/09/01 15:30:18 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: optr.c,v 1.9 1996/09/01 15:31:03 deraadt Exp $";
#endif
#endif /* not lint */
@@ -72,6 +72,8 @@ void alarmcatch __P((/* int, int */));
int datesort __P((const void *, const void *));
static void sendmes __P((char *, char *));
+extern gid_t gid, egid;
+
/*
* Query the operator; This previously-fascist piece of code
* no longer requires an exact response.
@@ -272,6 +274,7 @@ sendmes(tty, message)
(void) strcpy(t, _PATH_DEV);
(void) strncat(t, tty, sizeof t - strlen(_PATH_DEV));
+ setegid(egid);
if ((f_tty = fopen(t, "w")) != NULL) {
setbuf(f_tty, buf);
(void) fprintf(f_tty,
@@ -295,6 +298,7 @@ DUMP: NEEDS ATTENTION: ",
}
(void) fclose(f_tty);
}
+ setegid(gid);
}
/*