-/* $OpenBSD: ccdconfig.c,v 1.5 1996/05/30 09:11:20 deraadt Exp $ */
+/* $OpenBSD: ccdconfig.c,v 1.6 1996/12/22 03:00:47 deraadt Exp $ */
/* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */
/*-
* Discard setgid privileges if not the running kernel so that bad
* guys can't print interesting stuff from kernel memory.
*/
- if (core != NULL || kernel != NULL)
+ if (core != NULL || kernel != NULL) {
+ setegid(getgid());
setgid(getgid());
+ }
switch (action) {
case CCD_CONFIG:
-/* $OpenBSD: dmesg.c,v 1.2 1996/06/23 14:30:08 deraadt Exp $ */
+/* $OpenBSD: dmesg.c,v 1.3 1996/12/22 03:00:49 deraadt Exp $ */
/* $NetBSD: dmesg.c,v 1.8 1995/03/18 14:54:49 cgd Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)dmesg.c 8.1 (Berkeley) 6/5/93";
#else
-static char rcsid[] = "$OpenBSD: dmesg.c,v 1.2 1996/06/23 14:30:08 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: dmesg.c,v 1.3 1996/12/22 03:00:49 deraadt Exp $";
#endif
#endif /* not lint */
* Discard setgid privileges if not the running kernel so that bad
* guys can't print interesting stuff from kernel memory.
*/
- if (memf != NULL || nlistf != NULL)
+ if (memf != NULL || nlistf != NULL) {
+ setegid(getgid());
setgid(getgid());
+ }
/* Read in kernel message buffer, do sanity checks. */
if ((kd = kvm_open(nlistf, memf, NULL, O_RDONLY, "dmesg")) == NULL)
-/* $OpenBSD: ping.c,v 1.11 1996/12/14 15:35:26 deraadt Exp $ */
+/* $OpenBSD: ping.c,v 1.12 1996/12/22 03:00:52 deraadt Exp $ */
/* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */
/*
#if 0
static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
#else
-static char rcsid[] = "$OpenBSD: ping.c,v 1.11 1996/12/14 15:35:26 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ping.c,v 1.12 1996/12/22 03:00:52 deraadt Exp $";
#endif
#endif /* not lint */
err(1, "socket");
/* revoke privs */
+ seteuid(getuid());
setuid(getuid());
preload = 0;
-/* $OpenBSD: route.c,v 1.15 1996/12/14 18:41:37 deraadt Exp $ */
+/* $OpenBSD: route.c,v 1.16 1996/12/22 03:00:53 deraadt Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
#if 0
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: route.c,v 1.15 1996/12/14 18:41:37 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: route.c,v 1.16 1996/12/22 03:00:53 deraadt Exp $";
#endif
#endif /* not lint */
s = open("/dev/null", O_WRONLY, 0);
else
s = socket(PF_ROUTE, SOCK_RAW, 0);
+ seteuid(uid);
setuid(uid);
if (s < 0)
quit("socket");