diff options
author | 2005-04-01 04:06:40 +0000 | |
---|---|---|
committer | 2005-04-01 04:06:40 +0000 | |
commit | b0fc9d66ce3bec4bb693a1585ca349cd5304a9b2 (patch) | |
tree | 88d194b4a6c9e5b97a7395941414a4227f97d32b | |
parent | spacing (diff) | |
download | wireguard-openbsd-b0fc9d66ce3bec4bb693a1585ca349cd5304a9b2.tar.xz wireguard-openbsd-b0fc9d66ce3bec4bb693a1585ca349cd5304a9b2.zip |
move more stuff after revoke; millert ok
-rw-r--r-- | usr.bin/rsh/rsh.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/usr.bin/rsh/rsh.c b/usr.bin/rsh/rsh.c index a7039b16fc8..6a18aa836cf 100644 --- a/usr.bin/rsh/rsh.c +++ b/usr.bin/rsh/rsh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsh.c,v 1.36 2004/01/17 21:42:48 millert Exp $ */ +/* $OpenBSD: rsh.c,v 1.37 2005/04/01 04:06:40 deraadt Exp $ */ /*- * Copyright (c) 1983, 1990 The Regents of the University of California. @@ -37,7 +37,7 @@ static const char copyright[] = #ifndef lint /*static const char sccsid[] = "from: @(#)rsh.c 5.24 (Berkeley) 7/1/91";*/ -static const char rcsid[] = "$OpenBSD: rsh.c,v 1.36 2004/01/17 21:42:48 millert Exp $"; +static const char rcsid[] = "$OpenBSD: rsh.c,v 1.37 2005/04/01 04:06:40 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -77,15 +77,11 @@ main(int argc, char *argv[]) struct passwd *pw; struct servent *sp; sigset_t mask, omask; - int argoff, asrsh, ch, dflag, nflag, one, rem, uid; - char *args, *host, *user; + int argoff = 0, asrsh = 0, ch, dflag = 0, nflag = 0, one = 1, rem, uid; + char *args, *host = NULL, *user = NULL; pid_t pid = 0; extern char *__progname; - argoff = asrsh = dflag = nflag = 0; - one = 1; - host = user = NULL; - /* if called as something other than "rsh", use it as the host name */ if (strcmp(__progname, "rsh") != 0) host = __progname; @@ -155,9 +151,12 @@ main(int argc, char *argv[]) PF_UNSPEC); if (rem < 0) exit(1); - if (rfd2 < 0) errx(1, "can't establish stderr"); + + (void)seteuid(uid); + (void)setuid(uid); + if (dflag) { if (setsockopt(rem, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) < 0) @@ -166,9 +165,6 @@ main(int argc, char *argv[]) sizeof(one)) < 0) warn("setsockopt"); } - - (void)seteuid(uid); - (void)setuid(uid); sigemptyset(&mask); sigaddset(&mask, SIGINT); sigaddset(&mask, SIGQUIT); |