Module Name: src
Committed By: dholland
Date: Thu Oct 30 06:13:50 UTC 2014
Modified Files:
src/usr.bin/rsh: rsh.c
Log Message:
Drop setuid before execing rlogin. Failure to do so should be
harmless, but is sloppy.
To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/rsh/rsh.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/rsh/rsh.c
diff -u src/usr.bin/rsh/rsh.c:1.36 src/usr.bin/rsh/rsh.c:1.37
--- src/usr.bin/rsh/rsh.c:1.36 Sun Jun 8 02:44:15 2014
+++ src/usr.bin/rsh/rsh.c Thu Oct 30 06:13:50 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: rsh.c,v 1.36 2014/06/08 02:44:15 enami Exp $ */
+/* $NetBSD: rsh.c,v 1.37 2014/10/30 06:13:50 dholland Exp $ */
/*-
* Copyright (c) 1983, 1990, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
#if 0
static char sccsid[] = "@(#)rsh.c 8.4 (Berkeley) 4/29/95";
#else
-__RCSID("$NetBSD: rsh.c,v 1.36 2014/06/08 02:44:15 enami Exp $");
+__RCSID("$NetBSD: rsh.c,v 1.37 2014/10/30 06:13:50 dholland Exp $");
#endif
#endif /* not lint */
@@ -203,6 +203,7 @@ main(int argc, char **argv)
#else
if (asrsh)
*argv = __UNCONST("rlogin");
+ setuid(uid);
execv(_PATH_RLOGIN, argv);
err(1, "can't exec %s", _PATH_RLOGIN);
#endif