From patchwork Thu Apr 28 12:08:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 616166 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 3qwbJJ6L0fz9t74 for ; Thu, 28 Apr 2016 22:10:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=bjfQvGT2; 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:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= E8+fWtdRpaM2q2KjIJWSNhVFU/Ujom8+/aeFSTKtR9Jkp5uJeuVHkSb+Z4v7mdZK olCjbOaXG0SD2W98618SxHCxNyADdnFkb8cyykaHNGB1rW2pYnjuEaWXXmFPZ6+v NE0pFD9Yo283lwqTxtr640VxXTuyR4eD0IBy8Ep06q4= 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:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=o1Zuhj 0yO2V0EjbNnSm1X5eiphU=; b=bjfQvGT2afRbumc7r/JaAs/AmC94ldL3cEgPy+ UX3GZVa1wW4oOgQVQosvMGhK9IHHu4fKy2uUeluWma48M0hyEj7cNh06RDQk+BXc WMe/N12trT1IU7myiARXR+i1McBHCKtAy6WTRimMQu5jPcYYKg1ilhonOINolgIQ mpJnI= Received: (qmail 15998 invoked by alias); 28 Apr 2016 12:09:12 -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 15597 invoked by uid 89); 28 Apr 2016 12:09:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=520, 6, 5206, Hx-languages-length:2193 X-HELO: mx1.redhat.com Date: Thu, 28 Apr 2016 14:08:59 +0200 To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] resolv: Remove SUNSECURITY preprocessor conditionals User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20160428120859.EC76A403F10AA@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2016-04-28 Florian Weimer * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr2_r): Remove SUNSECURITY conditional. * resolv/gethnamaddr.c (gethostbyaddr): Likewise. diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c index 1b55ba1..97e2dc3 100644 --- a/resolv/gethnamaddr.c +++ b/resolv/gethnamaddr.c @@ -618,12 +618,6 @@ gethostbyaddr (const void *addr, socklen_t len, int af) querybuf *orig_buf; struct hostent *hp; char qbuf[MAXDNAME+1], *qp = NULL; -#ifdef SUNSECURITY - struct hostent *rhp; - char **haddr; - u_long old_options; - char hname2[MAXDNAME+1]; -#endif /*SUNSECURITY*/ if (__res_maybe_init (&_res, 0) == -1) { __set_h_errno (NETDB_INTERNAL); @@ -699,32 +693,6 @@ gethostbyaddr (const void *addr, socklen_t len, int af) free (buf.buf); if (!hp) return (NULL); /* h_errno was set by getanswer() */ -#ifdef SUNSECURITY - if (af == AF_INET) { - /* - * turn off search as the name should be absolute, - * 'localhost' should be matched by defnames - */ - strncpy(hname2, hp->h_name, MAXDNAME); - hname2[MAXDNAME] = '\0'; - old_options = _res.options; - _res.options &= ~RES_DNSRCH; - _res.options |= RES_DEFNAMES; - if (!(rhp = gethostbyname(hname2))) { - _res.options = old_options; - __set_h_errno (HOST_NOT_FOUND); - return (NULL); - } - _res.options = old_options; - for (haddr = rhp->h_addr_list; *haddr; haddr++) - if (!memcmp(*haddr, addr, INADDRSZ)) - break; - if (!*haddr) { - __set_h_errno (HOST_NOT_FOUND); - return (NULL); - } - } -#endif /*SUNSECURITY*/ hp->h_addrtype = af; hp->h_length = len; memmove(host_addr, addr, len); diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index 93fee10..5f9e357 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -520,11 +520,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, if (status != NSS_STATUS_SUCCESS) return status; -#ifdef SUNSECURITY - This is not implemented because it is not possible to use the current - source from bind in a multi-threaded program. -#endif - result->h_addrtype = af; result->h_length = len; memcpy (host_data->host_addr, addr, len);