summaryrefslogtreecommitdiff
path: root/usr.bin/rlogin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-12 08:07:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-07-12 08:07:13 +0000
commitabb4411452ad36fa43e6aaa446b6732c0d710ba4 (patch)
tree445baea5d3c27f952c90bd41fa5e27dffa770881 /usr.bin/rlogin
parentf55cc3abeeca5f46caca15ec4b2068d4797eb34f (diff)
strncpy correctly; remove old code
Diffstat (limited to 'usr.bin/rlogin')
-rw-r--r--usr.bin/rlogin/rlogin.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c
index df6b434e04d..18361f6b818 100644
--- a/usr.bin/rlogin/rlogin.c
+++ b/usr.bin/rlogin/rlogin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlogin.c,v 1.20 1998/06/03 16:20:33 deraadt Exp $ */
+/* $OpenBSD: rlogin.c,v 1.21 1998/07/12 08:07:12 deraadt Exp $ */
/* $NetBSD: rlogin.c,v 1.8 1995/10/05 09:07:22 mycroft Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: rlogin.c,v 1.20 1998/06/03 16:20:33 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rlogin.c,v 1.21 1998/07/12 08:07:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -212,8 +212,10 @@ main(argc, argv)
break;
#ifdef KERBEROS
case 'k':
+ (void)strncpy(dst_realm_buf, optarg,
+ sizeof dst_realm_buf-1);
+ dst_realm_buf[sizeof dst_realm_buf-1] = '\0';
dest_realm = dst_realm_buf;
- (void)strncpy(dest_realm, optarg, REALM_SZ);
break;
#endif
case 'l':
@@ -754,11 +756,7 @@ reader(omask)
int n, remaining;
char *bufp;
-#if BSD >= 43 || defined(SUNOS4)
pid = getpid(); /* modern systems use positives for pid */
-#else
- pid = -getpid(); /* old broken systems use negatives */
-#endif
(void)signal(SIGTTOU, SIG_IGN);
(void)signal(SIGURG, oob);
ppid = getppid();