summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderaadt <>1998-02-11 02:26:15 +0000
committerderaadt <>1998-02-11 02:26:15 +0000
commit997296bac15a2a4180e500b0722d1b6060a0dc87 (patch)
treeeecb9806ac0622f0b42f0b388ae086130d782101
parent3ad81c0a64ce5fcd52d1e4e57c81830fed266114 (diff)
downloadopenbsd-997296bac15a2a4180e500b0722d1b6060a0dc87.tar.gz
openbsd-997296bac15a2a4180e500b0722d1b6060a0dc87.tar.bz2
openbsd-997296bac15a2a4180e500b0722d1b6060a0dc87.zip
increased paranoia about .rhosts validity
-rw-r--r--src/lib/libc/net/rcmd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c
index 4fbf602215..9db161e96d 100644
--- a/src/lib/libc/net/rcmd.c
+++ b/src/lib/libc/net/rcmd.c
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37static char *rcsid = "$OpenBSD: rcmd.c,v 1.26 1997/07/09 01:08:47 millert Exp $"; 37static char *rcsid = "$OpenBSD: rcmd.c,v 1.27 1998/02/11 02:26:15 deraadt Exp $";
38#endif /* LIBC_SCCS and not lint */ 38#endif /* LIBC_SCCS and not lint */
39 39
40#include <sys/param.h> 40#include <sys/param.h>
@@ -417,7 +417,8 @@ __ivaliduser(hostf, raddrl, luser, ruser)
417 /* Skip lines that are too long. */ 417 /* Skip lines that are too long. */
418 if (strchr(p, '\n') == NULL) { 418 if (strchr(p, '\n') == NULL) {
419 while ((ch = getc(hostf)) != '\n' && ch != EOF) 419 while ((ch = getc(hostf)) != '\n' && ch != EOF)
420 ; 420 if (!isprint(ch))
421 goto bail;
421 continue; 422 continue;
422 } 423 }
423 if (*p == '#') 424 if (*p == '#')
@@ -434,8 +435,11 @@ __ivaliduser(hostf, raddrl, luser, ruser)
434 p++; 435 p++;
435 user = p; 436 user = p;
436 while (*p != '\n' && *p != ' ' && 437 while (*p != '\n' && *p != ' ' &&
437 *p != '\t' && *p != '\0') 438 *p != '\t' && *p != '\0') {
439 if (!isprint(*p))
440 goto bail;
438 p++; 441 p++;
442 }
439 } else 443 } else
440 user = p; 444 user = p;
441 *p = '\0'; 445 *p = '\0';