summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-24 17:31:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-24 17:31:09 +0000
commit2b51dd5e20e24c21acbd4448de2ca95dc384fc50 (patch)
tree6503d33ea8a8c187e8b56e9fad56d362b71831a3
parent9fe0ebe622331e4ca8b324440857ac3415cf231e (diff)
normal uid before execv
-rw-r--r--usr.bin/rsh/rsh.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/rsh/rsh.c b/usr.bin/rsh/rsh.c
index 281a74b4c6f..3fc51028447 100644
--- a/usr.bin/rsh/rsh.c
+++ b/usr.bin/rsh/rsh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsh.c,v 1.5 1996/07/22 10:09:04 deraadt Exp $ */
+/* $OpenBSD: rsh.c,v 1.6 1996/07/24 17:31:08 deraadt Exp $ */
/*-
* Copyright (c) 1983, 1990 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)rsh.c 5.24 (Berkeley) 7/1/91";*/
-static char rcsid[] = "$OpenBSD: rsh.c,v 1.5 1996/07/22 10:09:04 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rsh.c,v 1.6 1996/07/24 17:31:08 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -163,6 +163,7 @@ main(argc, argv)
if (!argv[optind]) {
if (asrsh)
*argv = "rlogin";
+ setuid(getuid());
execv(_PATH_RLOGIN, argv);
(void)fprintf(stderr, "rsh: can't exec %s.\n", _PATH_RLOGIN);
exit(1);