Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/resolv don't read hostaliases using unbuffered read...



details:   https://anonhg.NetBSD.org/src/rev/e7516c532ef9
branches:  trunk
changeset: 748472:e7516c532ef9
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Oct 24 21:37:57 2009 +0000

description:
don't read hostaliases using unbuffered reads. there is no security benefit.

diffstat:

 lib/libc/resolv/res_query.c |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 9d0102ced9e9 -r e7516c532ef9 lib/libc/resolv/res_query.c
--- a/lib/libc/resolv/res_query.c       Sat Oct 24 20:07:48 2009 +0000
+++ b/lib/libc/resolv/res_query.c       Sat Oct 24 21:37:57 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: res_query.c,v 1.12 2009/04/12 17:07:17 christos Exp $  */
+/*     $NetBSD: res_query.c,v 1.13 2009/10/24 21:37:57 christos Exp $  */
 
 /*
  * Portions Copyright (C) 2004, 2005, 2008  Internet Systems Consortium, Inc. ("ISC")
@@ -93,7 +93,7 @@
 static const char sccsid[] = "@(#)res_query.c  8.1 (Berkeley) 6/4/93";
 static const char rcsid[] = "Id: res_query.c,v 1.11 2008/11/14 02:36:51 marka Exp";
 #else
-__RCSID("$NetBSD: res_query.c,v 1.12 2009/04/12 17:07:17 christos Exp $");
+__RCSID("$NetBSD: res_query.c,v 1.13 2009/10/24 21:37:57 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -454,7 +454,6 @@
        file = getenv("HOSTALIASES");
        if (file == NULL || (fp = fopen(file, "r")) == NULL)
                return (NULL);
-       setbuf(fp, NULL);
        buf[sizeof(buf) - 1] = '\0';
        while (fgets(buf, sizeof(buf), fp)) {
                for (cp1 = buf; *cp1 && !isspace((unsigned char)*cp1); ++cp1)



Home | Main Index | Thread Index | Old Index