-/* $OpenBSD: misc.c,v 1.2 1996/08/19 20:08:57 downsj Exp $ */
+/* $OpenBSD: misc.c,v 1.3 1996/12/22 02:57:49 tholo Exp $ */
/*
* Miscellaneous functions
#ifdef OS2
;
#else /* OS2 */
+ seteuid(getuid());
setuid(getuid());
+ setegid(getgid());
setgid(getgid());
#endif /* OS2 */
} else if (f == FPOSIX && newval) {
-/* $OpenBSD: misc.c,v 1.2 1996/08/19 20:08:57 downsj Exp $ */
+/* $OpenBSD: misc.c,v 1.3 1996/12/22 02:57:49 tholo Exp $ */
/*
* Miscellaneous functions
#ifdef OS2
;
#else /* OS2 */
+ seteuid(getuid());
setuid(getuid());
+ setegid(getgid());
setgid(getgid());
#endif /* OS2 */
} else if (f == FPOSIX && newval) {
-/* $OpenBSD: ps.c,v 1.6 1996/12/14 12:18:10 mickey Exp $ */
+/* $OpenBSD: ps.c,v 1.7 1996/12/22 02:57:50 tholo Exp $ */
/* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: ps.c,v 1.6 1996/12/14 12:18:10 mickey Exp $";
+static char rcsid[] = "$OpenBSD: ps.c,v 1.7 1996/12/22 02:57:50 tholo 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 (nlistf != NULL || memf != NULL || swapf != NULL)
+ if (nlistf != NULL || memf != NULL || swapf != NULL) {
+ setegid(getgid());
setgid(getgid());
+ }
kd = kvm_openfiles(nlistf, memf, swapf, O_RDONLY, errbuf);
if (kd == 0)
/* $NetBSD: rcp.c,v 1.9 1995/03/21 08:19:06 cgd Exp $ */
-/* $OpenBSD: rcp.c,v 1.7 1996/12/14 12:18:13 mickey Exp $ */
+/* $OpenBSD: rcp.c,v 1.8 1996/12/22 02:57:51 tholo Exp $ */
/*
* Copyright (c) 1983, 1990, 1992, 1993
if (fflag) { /* Follow "protocol", send data. */
(void)response();
+ (void)seteuid(userid);
(void)setuid(userid);
source(argc, argv);
exit(errs);
}
if (tflag) { /* Receive data. */
+ (void)seteuid(userid);
(void)setuid(userid);
sink(argc, argv);
exit(errs);
if (response() < 0)
exit(1);
(void)free(bp);
+ (void)seteuid(userid);
(void)setuid(userid);
}
source(1, argv+i);
-/* $OpenBSD: util.c,v 1.3 1996/09/03 09:35:31 deraadt Exp $ */
+/* $OpenBSD: util.c,v 1.4 1996/12/22 02:57:52 tholo Exp $ */
/* $NetBSD: util.c,v 1.2 1995/03/21 08:19:08 cgd Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)util.c 8.2 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: util.c,v 1.3 1996/09/03 09:35:31 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: util.c,v 1.4 1996/12/22 02:57:52 tholo Exp $";
#endif
#endif /* not lint */
return (127);
case 0:
+ (void)seteuid(userid);
(void)setuid(userid);
execl(_PATH_BSHELL, "sh", "-c", s, NULL);
_exit(127);