From 02437ef35d84c02d1da1e8ecca94f622a19ea82f Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 5 Feb 1997 21:09:29 +0000 Subject: [PATCH] do not warn about valid options; invalid options correctly quit --- libexec/rlogind/rlogind.c | 10 ++-------- libexec/rshd/rshd.c | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c index c9789037856..30f366f6507 100644 --- a/libexec/rlogind/rlogind.c +++ b/libexec/rlogind/rlogind.c @@ -39,7 +39,7 @@ static char copyright[] = #ifndef lint /* from: static char sccsid[] = "@(#)rlogind.c 8.1 (Berkeley) 6/4/93"; */ -static char *rcsid = "$Id: rlogind.c,v 1.15 1997/02/05 14:26:52 deraadt Exp $"; +static char *rcsid = "$Id: rlogind.c,v 1.16 1997/02/05 21:09:30 deraadt Exp $"; #endif /* not lint */ /* @@ -258,8 +258,7 @@ doit(f, fromp) } #ifdef IP_OPTIONS { - u_char optbuf[BUFSIZ/3], *cp; - char lbuf[sizeof(optbuf)*3+1], *lp; + u_char optbuf[BUFSIZ/3]; int optsize = sizeof(optbuf), ipproto, i; struct protoent *ip; @@ -269,11 +268,6 @@ doit(f, fromp) ipproto = IPPROTO_IP; if (getsockopt(0, ipproto, IP_OPTIONS, (char *)optbuf, &optsize) == 0 && optsize != 0) { - for (lp = lbuf, i = 0; i < optsize; i++, lp += 3) - sprintf(lp, " %2.2x", optbuf[i]); - syslog(LOG_NOTICE, - "Connection received using IP options (ignored):%s", - lbuf); for (i = 0; i < optsize; ) { u_char c = optbuf[i]; if (c == IPOPT_LSRR || c == IPOPT_SSRR) diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c index 2c6715c9344..2ac2bf24ccb 100644 --- a/libexec/rshd/rshd.c +++ b/libexec/rshd/rshd.c @@ -39,7 +39,7 @@ static char copyright[] = #ifndef lint /* from: static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; */ -static char *rcsid = "$Id: rshd.c,v 1.12 1997/02/05 14:26:49 deraadt Exp $"; +static char *rcsid = "$Id: rshd.c,v 1.13 1997/02/05 21:09:29 deraadt Exp $"; #endif /* not lint */ /* @@ -238,8 +238,7 @@ doit(fromp) } #ifdef IP_OPTIONS { - u_char optbuf[BUFSIZ/3], *cp; - char lbuf[sizeof(optbuf)*3+1], *lp; + u_char optbuf[BUFSIZ/3]; int optsize = sizeof(optbuf), ipproto, i; struct protoent *ip; @@ -249,11 +248,6 @@ doit(fromp) ipproto = IPPROTO_IP; if (!getsockopt(0, ipproto, IP_OPTIONS, (char *)optbuf, &optsize) && optsize != 0) { - for (lp = lbuf, i = 0; i < optsize; i++, lp += 3) - sprintf(lp, " %2.2x", optbuf[i]); - syslog(LOG_NOTICE, - "Connection received from %s using IP options (ignored):%s", - inet_ntoa(fromp->sin_addr), lbuf); for (i = 0; i < optsize; ) { u_char c = optbuf[i]; if (c == IPOPT_LSRR || c == IPOPT_SSRR) -- 2.20.1