From patchwork Wed Apr 27 14:21:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 615682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qw2Fq0ncBz9t0t for ; Thu, 28 Apr 2016 00:21:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=aaDYSNTr; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; q=dns; s=default; b=vajSlVq0X2OjcdVFyOkicYQRLMofh 4MYibRFS8FnnJib7h6O5M8D3oe44CL1AobXgTiBTBbJ9S6cO6IL6yFHJXtYo+Dgx 2ChyQL0UnSn7VpYKXVnAlykddT4NK2k4Wy7yLlkVZmH32meh5DK3ymqPetEX7jEP 7LYX105upnVWtU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; s=default; bh=acRxEZ3BA8VX1jQ0lGDTPOlcLk8=; b=aaD YSNTrvS3bePLFsUvmWrCsLxBQSwwzuE8WLXejcDuzIhb1f7y8MmEMNATlt7J3km6 qMvB84D2LLk9ZOgOp+tsaUCaWT1BbkVLWlXacyTbruPwcIqqgc1HiIGdpJ1MjznV vsDBL37G/cgKlVYliJEN2IJRJo0TdeWR+/GdewZo= Received: (qmail 13627 invoked by alias); 27 Apr 2016 14:21:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 13543 invoked by uid 89); 27 Apr 2016 14:21:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=8.1, 7266, 726, 6, 99, 10 X-HELO: mx1.redhat.com To: GNU C Library From: Florian Weimer Subject: [PATCH COMMITTED] resolv, nss_dns: Remove remaining syslog logging [BZ #19862] Message-ID: <5720CAD2.5060907@redhat.com> Date: Wed, 27 Apr 2016 16:21:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 The fix for bug 14841 only removed part of the logging. Tested using external stub resolver tests. Florian 2016-04-27 Florian Weimer [BZ #19862] * resolv/nss_dns/dns-host.c (AskedForGot): Remove. (getanswer_r): Do not call syslog. (gaih_getanswer_slice): Likewise. * resolv/gethnamaddr.c (AskedForGot): Remove. (getanswer): Do not call syslog. (gethostbyaddr): Likewise. diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c index 3a8e9b1..4720fc8 100644 --- a/resolv/gethnamaddr.c +++ b/resolv/gethnamaddr.c @@ -70,7 +70,6 @@ static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; #include #include #include -#include #define RESOLVSORT @@ -100,9 +99,6 @@ static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; #define MAXALIASES 35 #define MAXADDRS 35 -static const char AskedForGot[] = - "gethostby*.getanswer: asked for \"%s\", got \"%s\""; - static char *h_addr_ptrs[MAXADDRS + 1]; static struct hostent host; @@ -335,20 +331,12 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) * uses many different types in responses that do not * match QTYPE. */ - if ((_res.options & RES_USE_DNSSEC) == 0) { - syslog(LOG_NOTICE|LOG_AUTH, - "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", - qname, p_class(C_IN), p_type(qtype), - p_type(type)); - } cp += n; continue; /* XXX - had_error++ ? */ } switch (type) { case T_PTR: if (strcasecmp(tname, bp) != 0) { - syslog(LOG_NOTICE|LOG_AUTH, - AskedForGot, qname, bp); cp += n; continue; /* XXX - had_error++ ? */ } @@ -397,8 +385,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) case T_A: case T_AAAA: if (strcasecmp(host.h_name, bp) != 0) { - syslog(LOG_NOTICE|LOG_AUTH, - AskedForGot, host.h_name, bp); cp += n; continue; /* XXX - had_error++ ? */ } @@ -740,9 +726,6 @@ gethostbyaddr (const void *addr, socklen_t len, int af) _res.options &= ~RES_DNSRCH; _res.options |= RES_DEFNAMES; if (!(rhp = gethostbyname(hname2))) { - syslog(LOG_NOTICE|LOG_AUTH, - "gethostbyaddr: No A record for %s (verifying [%s])", - hname2, inet_ntoa(*((struct in_addr *)addr))); _res.options = old_options; __set_h_errno (HOST_NOT_FOUND); return (NULL); @@ -752,9 +735,6 @@ gethostbyaddr (const void *addr, socklen_t len, int af) if (!memcmp(*haddr, addr, INADDRSZ)) break; if (!*haddr) { - syslog(LOG_NOTICE|LOG_AUTH, - "gethostbyaddr: A record of %s != PTR record [%s]", - hname2, inet_ntoa(*((struct in_addr *)addr))); __set_h_errno (HOST_NOT_FOUND); return (NULL); } diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index 4bb0e62..fb1d21c 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -78,7 +78,6 @@ #include #include #include -#include #include "nsswitch.h" @@ -99,10 +98,6 @@ #endif #define MAXHOSTNAMELEN 256 -static const char AskedForGot[] = "\ -gethostby*.getanswer: asked for \"%s\", got \"%s\""; - - /* We need this time later. */ typedef union querybuf { @@ -838,14 +833,6 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, have_to_map = 1; else if (__glibc_unlikely (type != qtype)) { - /* Log a low priority message if we get an unexpected record, but - skip it if we are using DNSSEC since it uses many different types - in responses that do not match QTYPE. */ - if ((_res.options & RES_USE_DNSSEC) == 0) - syslog (LOG_NOTICE | LOG_AUTH, - "gethostby*.getanswer: asked for \"%s %s %s\", " - "got type \"%s\"", - qname, p_class (C_IN), p_type (qtype), p_type (type)); cp += n; continue; /* XXX - had_error++ ? */ } @@ -855,7 +842,6 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, case T_PTR: if (__glibc_unlikely (strcasecmp (tname, bp) != 0)) { - syslog (LOG_NOTICE | LOG_AUTH, AskedForGot, qname, bp); cp += n; continue; /* XXX - had_error++ ? */ } @@ -899,7 +885,6 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, case T_AAAA: if (__builtin_expect (strcasecmp (result->h_name, bp), 0) != 0) { - syslog (LOG_NOTICE | LOG_AUTH, AskedForGot, result->h_name, bp); cp += n; continue; /* XXX - had_error++ ? */ } @@ -1152,13 +1137,6 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, || __builtin_expect (type == T_DNAME, 0)) #endif { - /* We don't support DNSSEC yet. For now, ignore the record - and send a low priority message to syslog. - - We also don't expect T_PTR or T_DNAME messages. */ - syslog (LOG_DEBUG | LOG_AUTH, - "getaddrinfo*.gaih_getanswer: got type \"%s\"", - p_type (type)); cp += n; continue; } -- 2.4.11