diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2001-03-28 13:41:19 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2001-03-28 13:41:19 +0000 |
commit | eee651a650e987c5a3e656f914acee58ea353256 (patch) | |
tree | def2d072556ef8641dc0ca9a8c200cdad32dceca /usr.sbin/inetd/builtins.c | |
parent | 323ee87c0251766010bc22b47d488399a5135449 (diff) | |
download | FreeBSD-src-eee651a650e987c5a3e656f914acee58ea353256.zip FreeBSD-src-eee651a650e987c5a3e656f914acee58ea353256.tar.gz |
Allow ident requests with trailing junk following the terminating "\n".
Reviewed by: ben
Approved by: green
Diffstat (limited to 'usr.sbin/inetd/builtins.c')
-rw-r--r-- | usr.sbin/inetd/builtins.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/inetd/builtins.c b/usr.sbin/inetd/builtins.c index 0083932..ad0160b 100644 --- a/usr.sbin/inetd/builtins.c +++ b/usr.sbin/inetd/builtins.c @@ -464,7 +464,7 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */ size = 0; bufsiz = sizeof(buf) - 1; FD_ZERO(&fdset); - while (bufsiz > 0 && (size == 0 || buf[size - 1] != '\n')) { + while (bufsiz > 0) { gettimeofday(&tv, NULL); tv.tv_sec = to.tv_sec - tv.tv_sec; tv.tv_usec = to.tv_usec - tv.tv_usec; @@ -488,6 +488,8 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */ break; bufsiz -= ssize; size += ssize; + if (memchr(&buf[size - ssize], '\n', ssize) != NULL) + break; } buf[size] = '\0'; /* Read two characters, and check for a delimiting character */ |