From patchwork Mon Oct 2 12:55:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76962 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8D2BD38207EE for ; Mon, 2 Oct 2023 13:03:04 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4C3CB385F009 for ; Mon, 2 Oct 2023 13:02:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4C3CB385F009 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9fVj/GsfdqlkwaIKL37CYzGFdWSYGw0rSqH8+EQo57Y=; b=jIoiNIvvoyh0qgIO7qQeqrV/DAOifwJ4aISc0PKvCEtRNb3oLzJ4/0QzmIJxZe5b5zRsKl 6FjIWG+gqhRPD2a5cHXSokTx0Ll76j8pKDlLVpjeN+/jpciBcJRRzQJ9iPbcPRpewR5B9D RUGLdKcy6axXAVlb8gO9akpW4HQ/pJc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-353-XHgcVQuENA6Nd8hRR-qiBA-1; Mon, 02 Oct 2023 09:02:02 -0400 X-MC-Unique: XHgcVQuENA6Nd8hRR-qiBA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 92DCD18153E8 for ; Mon, 2 Oct 2023 13:02:02 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19621C15BB8; Mon, 2 Oct 2023 13:02:01 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 01/16] inet: Rearrange and sort Makefile variables Date: Mon, 2 Oct 2023 14:55:13 +0200 Message-ID: <20231002130150.1497733-2-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Rearrange lists of routines, tests, etc. into one-per-line in inet/Makefile and sort them using scripts/sort-makefile-lines.py. Reviewed-by: Siddhesh Poyarekar --- inet/Makefile | 142 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 112 insertions(+), 30 deletions(-) diff --git a/inet/Makefile b/inet/Makefile index f5249ab2b1..9db7f941c6 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -22,41 +22,123 @@ subdir := inet include ../Makeconfig -headers := netinet/ether.h netinet/in.h netinet/in_systm.h \ - netinet/if_ether.h netinet/igmp.h \ - netinet/tcp.h netinet/ip.h $(wildcard arpa/*.h protocols/*.h) \ - aliases.h ifaddrs.h netinet/ip6.h netinet/icmp6.h bits/in.h \ - rpc/netdb.h - -routines := htonl htons \ - inet_lnaof inet_mkadr \ - inet_netof inet_ntoa inet_net herrno herrno-loc \ - gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \ - gethstbynm_r gethstent gethstent_r \ - getnetbyad getnetbyad_r getnetbynm getnetent getnetent_r \ - getnetbynm_r \ - getproto getproto_r getprtent getprtent_r getprtname getprtname_r \ - getsrvbynm getsrvbynm_r getsrvbypt getsrvbypt_r getservent \ - getservent_r getrpcent getrpcbyname getrpcbynumber \ - getrpcent_r getrpcbyname_r getrpcbynumber_r \ - ether_aton ether_aton_r ether_hton ether_line \ - ether_ntoa ether_ntoa_r ether_ntoh \ - rcmd rexec ruserpass bindresvport \ - getnetgrent_r getnetgrent \ - getaliasent_r getaliasent getaliasname getaliasname_r \ - in6_addr getnameinfo if_index ifaddrs inet6_option \ - getipv4sourcefilter setipv4sourcefilter \ - getsourcefilter setsourcefilter inet6_opt inet6_rth \ - inet6_scopeid_pton deadline idna idna_name_classify +headers := \ + $(wildcard arpa/*.h protocols/*.h) \ + aliases.h \ + bits/in.h \ + ifaddrs.h \ + netinet/ether.h \ + netinet/icmp6.h \ + netinet/if_ether.h \ + netinet/igmp.h \ + netinet/in.h \ + netinet/in_systm.h \ + netinet/ip.h \ + netinet/ip6.h \ + netinet/tcp.h \ + rpc/netdb.h \ + # headers + +routines := \ + bindresvport \ + deadline \ + ether_aton \ + ether_aton_r \ + ether_hton \ + ether_line \ + ether_ntoa \ + ether_ntoa_r \ + ether_ntoh \ + getaliasent \ + getaliasent_r \ + getaliasname \ + getaliasname_r \ + gethstbyad \ + gethstbyad_r \ + gethstbynm \ + gethstbynm2 \ + gethstbynm2_r \ + gethstbynm_r \ + gethstent \ + gethstent_r \ + getipv4sourcefilter \ + getnameinfo \ + getnetbyad \ + getnetbyad_r \ + getnetbynm \ + getnetbynm_r \ + getnetent \ + getnetent_r \ + getnetgrent \ + getnetgrent_r \ + getproto \ + getproto_r \ + getprtent \ + getprtent_r \ + getprtname \ + getprtname_r \ + getrpcbyname \ + getrpcbyname_r \ + getrpcbynumber \ + getrpcbynumber_r \ + getrpcent \ + getrpcent_r \ + getservent \ + getservent_r \ + getsourcefilter \ + getsrvbynm \ + getsrvbynm_r \ + getsrvbypt \ + getsrvbypt_r \ + herrno \ + herrno-loc \ + htonl \ + htons \ + idna \ + idna_name_classify \ + if_index \ + ifaddrs \ + in6_addr \ + inet6_opt \ + inet6_option \ + inet6_rth \ + inet6_scopeid_pton \ + inet_lnaof \ + inet_mkadr \ + inet_net \ + inet_netof \ + inet_ntoa \ + rcmd \ + rexec \ + ruserpass \ + setipv4sourcefilter \ + setsourcefilter \ + # routines install-others = $(inst_sysconfdir)/rpc aux := check_pf check_native ifreq -tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \ - tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \ - tst-getni1 tst-getni2 tst-inet6_rth tst-checks tst-checks-posix \ - tst-sockaddr test-hnto-types tst-if_index-long +tests := \ + bug-if1 \ + htontest \ + test-hnto-types \ + test-ifaddrs \ + test-inet6_opt \ + test_ifindex \ + tst-checks \ + tst-checks-posix \ + tst-ether_aton \ + tst-ether_line \ + tst-gethnm \ + tst-getni1 \ + tst-getni2 \ + tst-if_index-long \ + tst-inet6_rth \ + tst-network \ + tst-ntoa \ + tst-sockaddr \ + # tests # tst-deadline must be linked statically so that we can access # internal functions. From patchwork Mon Oct 2 12:55:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76966 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB5A0394D8B1 for ; Mon, 2 Oct 2023 13:03:26 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D911E385CCA1 for ; Mon, 2 Oct 2023 13:02:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D911E385CCA1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b9T2biJc7UG3PNG2BvztmZdyEo/To5ReDQFAWV4R350=; b=SlEQJohaLS8wTtUdm6ZuRZKXAvF3xw+Ot58g6l6nrMIZnniAcQkKgoxDNZAxzltyOE7heF 8jwYDD9wN8neuzS5rSO2FIWass6hMwP6fd7hfuLIEaqta8ZafRF/V6nfipa1RdpTWjuNmA k2lrvnN0celulkLeZVQ7H4wwPpfyTPA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-618-n9GKOUfhOo-gZJodOdBx4Q-1; Mon, 02 Oct 2023 09:02:04 -0400 X-MC-Unique: n9GKOUfhOo-gZJodOdBx4Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E51CE18153E6 for ; Mon, 2 Oct 2023 13:02:03 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6CB2CC15BB8; Mon, 2 Oct 2023 13:02:03 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 02/16] nss: Rearrange and sort Makefile variables Date: Mon, 2 Oct 2023 14:55:14 +0200 Message-ID: <20231002130150.1497733-3-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Rearrange lists of routines, tests, etc. into one-per-line in nss/Makefile and sort them using scripts/sort-makefile-lines.py. Reviewed-by: Siddhesh Poyarekar --- nss/Makefile | 55 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/nss/Makefile b/nss/Makefile index 668ba34b18..32764b74c0 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -22,23 +22,50 @@ subdir := nss include ../Makeconfig -headers := nss.h +headers := \ + nss.h \ + # headers # This is the trivial part which goes into libc itself. -routines = nsswitch getnssent getnssent_r digits_dots \ - valid_field valid_list_field rewrite_field \ - $(addsuffix -lookup,$(databases)) \ - compat-lookup nss_hash nss_files_fopen \ - nss_readline nss_parse_line_result \ - nss_fgetent_r nss_module nss_action \ - nss_action_parse nss_database nss_files_data \ - nss_files_functions +routines = \ + $(addsuffix -lookup,$(databases)) \ + compat-lookup \ + digits_dots \ + getnssent \ + getnssent_r \ + nss_action \ + nss_action_parse \ + nss_database \ + nss_fgetent_r \ + nss_files_data \ + nss_files_fopen \ + nss_files_functions \ + nss_hash \ + nss_module \ + nss_parse_line_result \ + nss_readline \ + nsswitch \ + rewrite_field \ + valid_field \ + valid_list_field \ + # routines # These are the databases that go through nss dispatch. # Caution: if you add a database here, you must add its real name # in databases.def, too. -databases = proto service hosts network grp pwd ethers \ - spwd netgrp alias sgrp +databases = \ + alias \ + ethers \ + grp \ + hosts \ + netgrp \ + network \ + proto \ + pwd \ + service \ + sgrp \ + spwd \ + # databases ifneq (,$(filter sunrpc,$(subdirs))) databases += key rpc @@ -68,7 +95,7 @@ tests := \ tst-nss-test4 \ tst-nss-test5 \ tst-nss-test_errno \ -# tests + # tests xtests = bug-erange @@ -79,11 +106,11 @@ tests-container := \ tst-nss-files-hosts-long \ tst-nss-files-hosts-v4mapped \ tst-nss-gai-actions \ + tst-nss-gai-hv2-canonname \ tst-nss-test3 \ tst-reload1 \ tst-reload2 \ - tst-nss-gai-hv2-canonname \ -# tests-container + # tests-container # Tests which need libdl ifeq (yes,$(build-shared)) From patchwork Mon Oct 2 12:55:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76958 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 93CCD3831E14 for ; Mon, 2 Oct 2023 13:02:30 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 81769385C6EA for ; Mon, 2 Oct 2023 13:02:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81769385C6EA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KQ0qBMehTTrj70BSvjYFFkeehZM8Hdoq825Iye638JQ=; b=DaYI7wfCF2q2c6ZrpHNBefM05Ns9RuqOpkP/Cw9QergvMuhiyfZF53FfpWVq4eRe0QZoAD RELqzQ4UphWFgxA5ES9GMeHDIGJe/+iOVkWQ53XmnuV1Tr89pNC+Jz2GaVWcyouuTyXqJp vlbOCC5x8p+LWIvej57CO8k3mWrA7+4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-306-G1BZGJPNOFipYAq9B6cYJQ-1; Mon, 02 Oct 2023 09:02:05 -0400 X-MC-Unique: G1BZGJPNOFipYAq9B6cYJQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A03D803497 for ; Mon, 2 Oct 2023 13:02:05 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9F51C15BB8; Mon, 2 Oct 2023 13:02:04 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 03/16] Remove 'grp' and merge into 'nss' and 'posix' Date: Mon, 2 Oct 2023 14:55:15 +0200 Message-ID: <20231002130150.1497733-4-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The majority of grp routines are entry points for nss functionality. This commit removes the 'grp' subdirectory and moves all nss-relevant functionality and all tests to 'nss', and the 'setgroups' stub into 'posix' (alongside the 'getgroups' stub). References to grp/ are accordingly changed. In addition, compat-initgroups.c, a fallback implementation of initgroups is renamed to initgroups-fallback.c so that the build system does not confuse it for nss_compat/compat-initgroups.c. Build time improves very slightly; e.g. down from an average of 45.5s to 44.5s on an 8-thread mobile x86_64 CPU. Reviewed-by: Adhemerval Zanella --- Makeconfig | 2 +- grp/Makefile | 70 ------------------- grp/Versions | 34 --------- include/grp-merge.h | 2 +- include/grp.h | 2 +- nscd/initgrcache.c | 2 +- nss/Makefile | 43 +++++++++++- nss/Versions | 30 ++++++++ {grp => nss}/fgetgrent.c | 0 {grp => nss}/fgetgrent_r.c | 0 {grp => nss}/getgrent.c | 0 {grp => nss}/getgrent_r.c | 0 {grp => nss}/getgrgid.c | 0 {grp => nss}/getgrgid_r.c | 0 {grp => nss}/getgrnam.c | 0 {grp => nss}/getgrnam_r.c | 0 {grp => nss}/grp-merge.c | 0 {grp => nss}/grp-merge.h | 0 {grp => nss}/grp.h | 0 .../initgroups-fallback.c | 0 {grp => nss}/initgroups.c | 2 +- {grp => nss}/putgrent.c | 0 {grp => nss}/testgrp.c | 0 {grp => nss}/tst-initgroups1.c | 0 {grp => nss}/tst-initgroups1.root/etc/group | 0 .../tst-initgroups1.root/etc/nsswitch.conf | 0 {grp => nss}/tst-initgroups1.root/etc/passwd | 0 {grp => nss}/tst-initgroups2.c | 0 {grp => nss}/tst-initgroups2.root/etc/group | 0 .../tst-initgroups2.root/etc/nsswitch.conf | 0 {grp => nss}/tst-initgroups2.root/etc/passwd | 0 {grp => nss}/tst-putgrent.c | 0 {grp => nss}/tst_fgetgrent.c | 0 {grp => nss}/tst_fgetgrent.sh | 10 +-- posix/Makefile | 1 + posix/Versions | 2 +- {grp => posix}/setgroups.c | 0 scripts/update-copyrights | 2 +- 38 files changed, 85 insertions(+), 117 deletions(-) delete mode 100644 grp/Makefile delete mode 100644 grp/Versions rename {grp => nss}/fgetgrent.c (100%) rename {grp => nss}/fgetgrent_r.c (100%) rename {grp => nss}/getgrent.c (100%) rename {grp => nss}/getgrent_r.c (100%) rename {grp => nss}/getgrgid.c (100%) rename {grp => nss}/getgrgid_r.c (100%) rename {grp => nss}/getgrnam.c (100%) rename {grp => nss}/getgrnam_r.c (100%) rename {grp => nss}/grp-merge.c (100%) rename {grp => nss}/grp-merge.h (100%) rename {grp => nss}/grp.h (100%) rename grp/compat-initgroups.c => nss/initgroups-fallback.c (100%) rename {grp => nss}/initgroups.c (99%) rename {grp => nss}/putgrent.c (100%) rename {grp => nss}/testgrp.c (100%) rename {grp => nss}/tst-initgroups1.c (100%) rename {grp => nss}/tst-initgroups1.root/etc/group (100%) rename {grp => nss}/tst-initgroups1.root/etc/nsswitch.conf (100%) rename {grp => nss}/tst-initgroups1.root/etc/passwd (100%) rename {grp => nss}/tst-initgroups2.c (100%) rename {grp => nss}/tst-initgroups2.root/etc/group (100%) rename {grp => nss}/tst-initgroups2.root/etc/nsswitch.conf (100%) rename {grp => nss}/tst-initgroups2.root/etc/passwd (100%) rename {grp => nss}/tst-putgrent.c (100%) rename {grp => nss}/tst_fgetgrent.c (100%) rename {grp => nss}/tst_fgetgrent.sh (76%) rename {grp => posix}/setgroups.c (100%) diff --git a/Makeconfig b/Makeconfig index c48fcc59e8..9ff6a902e9 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1352,7 +1352,7 @@ endif # dependencies and generate sorted-subdirs dynamically. all-subdirs = csu assert ctype locale intl catgets math setjmp signal \ stdlib stdio-common libio malloc string wcsmbs time dirent \ - grp pwd posix io termios resource misc socket sysvipc gmon \ + pwd posix io termios resource misc socket sysvipc gmon \ gnulib iconv iconvdata wctype manual shadow gshadow po argp \ localedata timezone rt conform debug mathvec support \ dlfcn elf diff --git a/grp/Makefile b/grp/Makefile deleted file mode 100644 index 38006fb5c3..0000000000 --- a/grp/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (C) 1991-2023 Free Software Foundation, Inc. -# This file is part of the GNU C Library. - -# The GNU C Library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. - -# The GNU C Library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. - -# You should have received a copy of the GNU Lesser General Public -# License along with the GNU C Library; if not, see -# . - -# -# Sub-makefile for grp portion of the library. -# -subdir := grp - -include ../Makeconfig - -headers := grp.h - -routines := fgetgrent initgroups setgroups \ - getgrent getgrgid getgrnam putgrent \ - getgrent_r getgrgid_r getgrnam_r fgetgrent_r \ - grp-merge - -tests := testgrp tst-putgrent - -tests-container = \ - tst-initgroups1 \ - tst-initgroups2 - -ifeq (yes,$(build-shared)) -test-srcs := tst_fgetgrent -ifeq ($(run-built-tests),yes) -tests-special += $(objpfx)tst_fgetgrent.out -endif -endif - - -include ../Rules - -ifeq ($(have-thread-library),yes) - -CFLAGS-getgrgid_r.c += -fexceptions -CFLAGS-getgrnam_r.c += -fexceptions -CFLAGS-getgrent_r.c += -fexceptions -CFLAGS-getgrent.c += -fexceptions -CFLAGS-fgetgrent.c += -fexceptions -CFLAGS-fgetgrent_r.c += -fexceptions $(libio-mtsafe) -CFLAGS-putgrent.c += -fexceptions $(libio-mtsafe) -CFLAGS-initgroups.c += -fexceptions -CFLAGS-getgrgid.c += -fexceptions - -endif - -ifeq ($(run-built-tests),yes) -# tst_fgetgrent currently only works with shared libraries -ifeq (yes,$(build-shared)) -$(objpfx)tst_fgetgrent.out: tst_fgetgrent.sh $(objpfx)tst_fgetgrent - $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \ - $(evaluate-test) - -endif -endif diff --git a/grp/Versions b/grp/Versions deleted file mode 100644 index 096caa47c5..0000000000 --- a/grp/Versions +++ /dev/null @@ -1,34 +0,0 @@ -libc { - GLIBC_2.0 { - # e* - endgrent; - - # f* - fgetgrent; fgetgrent_r; - - # g* - getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r; - getgroups; - - # i* - initgroups; - - # s* - setgrent; setgroups; - } - GLIBC_2.1 { - # p* - putgrent; - } - GLIBC_2.1.2 { - # g* - getgrent_r; getgrgid_r; getgrnam_r; - } - GLIBC_2.2.4 { - # g* - getgrouplist; - } - GLIBC_PRIVATE { - __merge_grp; __copy_grp; - } -} diff --git a/include/grp-merge.h b/include/grp-merge.h index 331ac20ea9..fc9a25df01 100644 --- a/include/grp-merge.h +++ b/include/grp-merge.h @@ -1,5 +1,5 @@ #ifndef _GRP_MERGE_H -#include +#include libc_hidden_proto (__copy_grp) libc_hidden_proto (__merge_grp) diff --git a/include/grp.h b/include/grp.h index 2cd2475534..96b98a3cde 100644 --- a/include/grp.h +++ b/include/grp.h @@ -1,5 +1,5 @@ #ifndef _GRP_H -#include +#include #ifndef _ISOMAC libc_hidden_proto (setgroups) diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c index be44951bd6..8d8e1c2dbf 100644 --- a/nscd/initgrcache.c +++ b/nscd/initgrcache.c @@ -45,7 +45,7 @@ static const initgr_response_header notfound = }; -#include "../grp/compat-initgroups.c" +#include "../nss/initgroups-fallback.c" static time_t diff --git a/nss/Makefile b/nss/Makefile index 32764b74c0..baf7d9d0ab 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -23,6 +23,7 @@ subdir := nss include ../Makeconfig headers := \ + grp.h \ nss.h \ # headers @@ -50,6 +51,34 @@ routines = \ valid_list_field \ # routines +# grp routines: +routines += \ + fgetgrent \ + fgetgrent_r \ + getgrent \ + getgrent_r \ + getgrgid \ + getgrgid_r \ + getgrnam \ + getgrnam_r \ + grp-merge \ + initgroups \ + putgrent \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-fgetgrent.c += -fexceptions +CFLAGS-fgetgrent_r.c += -fexceptions $(libio-mtsafe) +CFLAGS-getgrent.c += -fexceptions +CFLAGS-getgrent_r.c += -fexceptions +CFLAGS-getgrgid.c += -fexceptions +CFLAGS-getgrgid_r.c += -fexceptions +CFLAGS-getgrnam.c += -fexceptions +CFLAGS-getgrnam_r.c += -fexceptions +CFLAGS-initgroups.c += -fexceptions +CFLAGS-putgrent.c += -fexceptions $(libio-mtsafe) +endif + # These are the databases that go through nss dispatch. # Caution: if you add a database here, you must add its real name # in databases.def, too. @@ -88,6 +117,7 @@ tests := \ bug17079 \ test-digits-dots \ test-netdb \ + testgrp \ tst-nss-getpwent \ tst-nss-hash \ tst-nss-test1 \ @@ -95,11 +125,14 @@ tests := \ tst-nss-test4 \ tst-nss-test5 \ tst-nss-test_errno \ + tst-putgrent \ # tests xtests = bug-erange tests-container := \ + tst-initgroups1 \ + tst-initgroups2 \ tst-nss-compat1 \ tst-nss-db-endgrent \ tst-nss-db-endpwent \ @@ -112,13 +145,21 @@ tests-container := \ tst-reload2 \ # tests-container -# Tests which need libdl ifeq (yes,$(build-shared)) +# Tests which need libdl tests += tst-nss-files-hosts-erange tests += tst-nss-files-hosts-multi tests += tst-nss-files-hosts-getent tests += tst-nss-files-alias-leak tests += tst-nss-files-alias-truncated +# tst_fgetgrent currently only works with shared libraries +test-srcs := tst_fgetgrent +ifeq ($(run-built-tests),yes) +tests-special += $(objpfx)tst_fgetgrent.out +$(objpfx)tst_fgetgrent.out: tst_fgetgrent.sh $(objpfx)tst_fgetgrent + $(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \ + $(evaluate-test) +endif endif # If we have a thread library then we can test cancellation against diff --git a/nss/Versions b/nss/Versions index e551524aa9..5401829911 100644 --- a/nss/Versions +++ b/nss/Versions @@ -5,10 +5,38 @@ libc { # Functions exported as no-op compat symbols. __nss_passwd_lookup; __nss_group_lookup; __nss_hosts_lookup; __nss_next; __nss_database_lookup; + + # e* + endgrent; + + # f* + fgetgrent; fgetgrent_r; + + # g* + getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r; + getgroups; + + # i* + initgroups; + + # s* + setgrent; + } + GLIBC_2.1 { + # p* + putgrent; + } + GLIBC_2.1.2 { + # g* + getgrent_r; getgrgid_r; getgrnam_r; } GLIBC_2.2.2 { __nss_hostname_digits_dots; } + GLIBC_2.2.4 { + # g* + getgrouplist; + } GLIBC_2.27 { } GLIBC_PRIVATE { @@ -107,6 +135,8 @@ libc { _nss_files_initgroups_dyn; _nss_files_init; + + __merge_grp; __copy_grp; } } diff --git a/grp/fgetgrent.c b/nss/fgetgrent.c similarity index 100% rename from grp/fgetgrent.c rename to nss/fgetgrent.c diff --git a/grp/fgetgrent_r.c b/nss/fgetgrent_r.c similarity index 100% rename from grp/fgetgrent_r.c rename to nss/fgetgrent_r.c diff --git a/grp/getgrent.c b/nss/getgrent.c similarity index 100% rename from grp/getgrent.c rename to nss/getgrent.c diff --git a/grp/getgrent_r.c b/nss/getgrent_r.c similarity index 100% rename from grp/getgrent_r.c rename to nss/getgrent_r.c diff --git a/grp/getgrgid.c b/nss/getgrgid.c similarity index 100% rename from grp/getgrgid.c rename to nss/getgrgid.c diff --git a/grp/getgrgid_r.c b/nss/getgrgid_r.c similarity index 100% rename from grp/getgrgid_r.c rename to nss/getgrgid_r.c diff --git a/grp/getgrnam.c b/nss/getgrnam.c similarity index 100% rename from grp/getgrnam.c rename to nss/getgrnam.c diff --git a/grp/getgrnam_r.c b/nss/getgrnam_r.c similarity index 100% rename from grp/getgrnam_r.c rename to nss/getgrnam_r.c diff --git a/grp/grp-merge.c b/nss/grp-merge.c similarity index 100% rename from grp/grp-merge.c rename to nss/grp-merge.c diff --git a/grp/grp-merge.h b/nss/grp-merge.h similarity index 100% rename from grp/grp-merge.h rename to nss/grp-merge.h diff --git a/grp/grp.h b/nss/grp.h similarity index 100% rename from grp/grp.h rename to nss/grp.h diff --git a/grp/compat-initgroups.c b/nss/initgroups-fallback.c similarity index 100% rename from grp/compat-initgroups.c rename to nss/initgroups-fallback.c diff --git a/grp/initgroups.c b/nss/initgroups.c similarity index 99% rename from grp/initgroups.c rename to nss/initgroups.c index 2ebd623d7b..e803cecebc 100644 --- a/grp/initgroups.c +++ b/nss/initgroups.c @@ -39,7 +39,7 @@ typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t, static bool use_initgroups_entry; -#include "compat-initgroups.c" +#include "initgroups-fallback.c" static int diff --git a/grp/putgrent.c b/nss/putgrent.c similarity index 100% rename from grp/putgrent.c rename to nss/putgrent.c diff --git a/grp/testgrp.c b/nss/testgrp.c similarity index 100% rename from grp/testgrp.c rename to nss/testgrp.c diff --git a/grp/tst-initgroups1.c b/nss/tst-initgroups1.c similarity index 100% rename from grp/tst-initgroups1.c rename to nss/tst-initgroups1.c diff --git a/grp/tst-initgroups1.root/etc/group b/nss/tst-initgroups1.root/etc/group similarity index 100% rename from grp/tst-initgroups1.root/etc/group rename to nss/tst-initgroups1.root/etc/group diff --git a/grp/tst-initgroups1.root/etc/nsswitch.conf b/nss/tst-initgroups1.root/etc/nsswitch.conf similarity index 100% rename from grp/tst-initgroups1.root/etc/nsswitch.conf rename to nss/tst-initgroups1.root/etc/nsswitch.conf diff --git a/grp/tst-initgroups1.root/etc/passwd b/nss/tst-initgroups1.root/etc/passwd similarity index 100% rename from grp/tst-initgroups1.root/etc/passwd rename to nss/tst-initgroups1.root/etc/passwd diff --git a/grp/tst-initgroups2.c b/nss/tst-initgroups2.c similarity index 100% rename from grp/tst-initgroups2.c rename to nss/tst-initgroups2.c diff --git a/grp/tst-initgroups2.root/etc/group b/nss/tst-initgroups2.root/etc/group similarity index 100% rename from grp/tst-initgroups2.root/etc/group rename to nss/tst-initgroups2.root/etc/group diff --git a/grp/tst-initgroups2.root/etc/nsswitch.conf b/nss/tst-initgroups2.root/etc/nsswitch.conf similarity index 100% rename from grp/tst-initgroups2.root/etc/nsswitch.conf rename to nss/tst-initgroups2.root/etc/nsswitch.conf diff --git a/grp/tst-initgroups2.root/etc/passwd b/nss/tst-initgroups2.root/etc/passwd similarity index 100% rename from grp/tst-initgroups2.root/etc/passwd rename to nss/tst-initgroups2.root/etc/passwd diff --git a/grp/tst-putgrent.c b/nss/tst-putgrent.c similarity index 100% rename from grp/tst-putgrent.c rename to nss/tst-putgrent.c diff --git a/grp/tst_fgetgrent.c b/nss/tst_fgetgrent.c similarity index 100% rename from grp/tst_fgetgrent.c rename to nss/tst_fgetgrent.c diff --git a/grp/tst_fgetgrent.sh b/nss/tst_fgetgrent.sh similarity index 76% rename from grp/tst_fgetgrent.sh rename to nss/tst_fgetgrent.sh index 1775a6bc61..fb6b0c4179 100644 --- a/grp/tst_fgetgrent.sh +++ b/nss/tst_fgetgrent.sh @@ -21,20 +21,20 @@ set -e common_objpfx=$1; shift test_program_prefix=$1; shift -testout=${common_objpfx}/grp/tst_fgetgrent.out +testout=${common_objpfx}/nss/tst_fgetgrent.out result=0 ${test_program_prefix} \ -${common_objpfx}grp/tst_fgetgrent 0 > ${testout} || result=1 +${common_objpfx}nss/tst_fgetgrent 0 > ${testout} || result=1 ${test_program_prefix} \ -${common_objpfx}grp/tst_fgetgrent 1 >> ${testout} || result=1 +${common_objpfx}nss/tst_fgetgrent 1 >> ${testout} || result=1 ${test_program_prefix} \ -${common_objpfx}grp/tst_fgetgrent 2 >> ${testout} || result=1 +${common_objpfx}nss/tst_fgetgrent 2 >> ${testout} || result=1 ${test_program_prefix} \ -${common_objpfx}grp/tst_fgetgrent 3 >> ${testout} || result=1 +${common_objpfx}nss/tst_fgetgrent 3 >> ${testout} || result=1 exit $result diff --git a/posix/Makefile b/posix/Makefile index c36b9d981e..be7d319394 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -137,6 +137,7 @@ routines := \ sched_sets \ sched_yield \ setgid \ + setgroups \ setpgid \ setpgrp \ setresgid \ diff --git a/posix/Versions b/posix/Versions index 3753810864..2eedbc3e79 100644 --- a/posix/Versions +++ b/posix/Versions @@ -53,7 +53,7 @@ libc { sched_get_priority_max; sched_get_priority_min; sched_getparam; sched_getscheduler; sched_rr_get_interval; sched_setparam; sched_setscheduler; sched_yield; setegid; seteuid; setgid; - setpgid; setpgrp; setsid; setuid; sleep; sysconf; + setgroups; setpgid; setpgrp; setsid; setuid; sleep; sysconf; # t* times; diff --git a/grp/setgroups.c b/posix/setgroups.c similarity index 100% rename from grp/setgroups.c rename to posix/setgroups.c diff --git a/scripts/update-copyrights b/scripts/update-copyrights index f6ef6fa33b..a582fa1476 100755 --- a/scripts/update-copyrights +++ b/scripts/update-copyrights @@ -65,7 +65,7 @@ for f in $files; do "$update_script" "$f" fi ;; - grp/initgroups.c | misc/bits/stab.def | posix/regex.h \ + nss/initgroups.c | misc/bits/stab.def | posix/regex.h \ | sysdeps/wordsize-32/divdi3.c) # Pre-1991 gaps in copyright years, so cannot use a single range. UPDATE_COPYRIGHT_USE_INTERVALS=1 "$update_script" "$f" From patchwork Mon Oct 2 12:55:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76964 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DB75338245A4 for ; Mon, 2 Oct 2023 13:03:14 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B3682385CC95 for ; Mon, 2 Oct 2023 13:02:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B3682385CC95 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gyJA1JhTQ9b5xjj5tEWJeWjrtCqOCDqHoe6zHmDO818=; b=e2h8P1/toKwAFGhij/s3yFmOf19mu++VNBdnA7ZSjIhYSOsiQf7twsBufr/8492KmEkGmP hYFnpM5y0/JCX/pi85uN8vY4GCvY9DNgAk67zxjPQ+3KuzQ4UWPaOuLGJ94cqRA6KnMeLQ I3zTVFlta76ioNxzZkgYUGDva67X/js= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-275-PvhG24DtMYSMUEkiN-Xt0g-1; Mon, 02 Oct 2023 09:02:06 -0400 X-MC-Unique: PvhG24DtMYSMUEkiN-Xt0g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7145B29AB44B for ; Mon, 2 Oct 2023 13:02:06 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED8B0C15BB8; Mon, 2 Oct 2023 13:02:05 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 04/16] Remove 'gshadow' and merge into 'nss' Date: Mon, 2 Oct 2023 14:55:16 +0200 Message-ID: <20231002130150.1497733-5-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The majority of gshadow routines are entry points for nss functionality. This commit removes the 'gshadow' subdirectory and moves all functionality and tests to 'nss'. References to gshadow/ are accordingly changed. Reviewed-by: Adhemerval Zanella --- Makeconfig | 2 +- gshadow/Makefile | 39 ------------------------------ gshadow/Versions | 21 ---------------- include/gshadow.h | 2 +- nss/Makefile | 28 +++++++++++++++++++++ nss/Versions | 19 +++++++++++++++ {gshadow => nss}/fgetsgent.c | 0 {gshadow => nss}/fgetsgent_r.c | 0 {gshadow => nss}/getsgent.c | 0 {gshadow => nss}/getsgent_r.c | 0 {gshadow => nss}/getsgnam.c | 0 {gshadow => nss}/getsgnam_r.c | 0 {gshadow => nss}/gshadow.h | 0 {gshadow => nss}/putsgent.c | 0 {gshadow => nss}/sgetsgent.c | 0 {gshadow => nss}/sgetsgent_r.c | 0 {gshadow => nss}/tst-fgetsgent_r.c | 0 {gshadow => nss}/tst-gshadow.c | 0 {gshadow => nss}/tst-putsgent.c | 0 {gshadow => nss}/tst-sgetsgent.c | 0 20 files changed, 49 insertions(+), 62 deletions(-) delete mode 100644 gshadow/Makefile delete mode 100644 gshadow/Versions rename {gshadow => nss}/fgetsgent.c (100%) rename {gshadow => nss}/fgetsgent_r.c (100%) rename {gshadow => nss}/getsgent.c (100%) rename {gshadow => nss}/getsgent_r.c (100%) rename {gshadow => nss}/getsgnam.c (100%) rename {gshadow => nss}/getsgnam_r.c (100%) rename {gshadow => nss}/gshadow.h (100%) rename {gshadow => nss}/putsgent.c (100%) rename {gshadow => nss}/sgetsgent.c (100%) rename {gshadow => nss}/sgetsgent_r.c (100%) rename {gshadow => nss}/tst-fgetsgent_r.c (100%) rename {gshadow => nss}/tst-gshadow.c (100%) rename {gshadow => nss}/tst-putsgent.c (100%) rename {gshadow => nss}/tst-sgetsgent.c (100%) diff --git a/Makeconfig b/Makeconfig index 9ff6a902e9..ac7fa3dbb3 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1353,7 +1353,7 @@ endif all-subdirs = csu assert ctype locale intl catgets math setjmp signal \ stdlib stdio-common libio malloc string wcsmbs time dirent \ pwd posix io termios resource misc socket sysvipc gmon \ - gnulib iconv iconvdata wctype manual shadow gshadow po argp \ + gnulib iconv iconvdata wctype manual shadow po argp \ localedata timezone rt conform debug mathvec support \ dlfcn elf diff --git a/gshadow/Makefile b/gshadow/Makefile deleted file mode 100644 index a95524593a..0000000000 --- a/gshadow/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2009-2023 Free Software Foundation, Inc. -# This file is part of the GNU C Library. - -# The GNU C Library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. - -# The GNU C Library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. - -# You should have received a copy of the GNU Lesser General Public -# License along with the GNU C Library; if not, see -# . - -# -# Makefile for gshadow. -# -subdir := gshadow - -include ../Makeconfig - -headers = gshadow.h -routines = getsgent getsgnam sgetsgent fgetsgent putsgent \ - getsgent_r getsgnam_r sgetsgent_r fgetsgent_r - -tests = tst-gshadow tst-putsgent tst-fgetsgent_r tst-sgetsgent - -CFLAGS-getsgent_r.c += -fexceptions -CFLAGS-getsgent.c += -fexceptions -CFLAGS-fgetsgent.c += -fexceptions -CFLAGS-fgetsgent_r.c += -fexceptions $(libio-mtsafe) -CFLAGS-putsgent.c += -fexceptions $(libio-mtsafe) -CFLAGS-getsgnam.c += -fexceptions -CFLAGS-getsgnam_r.c += -fexceptions - -include ../Rules diff --git a/gshadow/Versions b/gshadow/Versions deleted file mode 100644 index 1dba0c5f19..0000000000 --- a/gshadow/Versions +++ /dev/null @@ -1,21 +0,0 @@ -libc { - GLIBC_2.10 { - # e* - endsgent; - - # f* - fgetsgent; fgetsgent_r; - - # g* - getsgent; getsgent_r; getsgnam; getsgnam_r; - - # p* - putsgent; - - # s* - setsgent; - - # s* - sgetsgent; sgetsgent_r; - } -} diff --git a/include/gshadow.h b/include/gshadow.h index 1cefcfc641..95f8f950a9 100644 --- a/include/gshadow.h +++ b/include/gshadow.h @@ -1,5 +1,5 @@ #ifndef _GSHADOW_H -#include +#include # ifndef _ISOMAC diff --git a/nss/Makefile b/nss/Makefile index baf7d9d0ab..5256b90f8b 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -24,6 +24,7 @@ include ../Makeconfig headers := \ grp.h \ + gshadow.h \ nss.h \ # headers @@ -79,6 +80,29 @@ CFLAGS-initgroups.c += -fexceptions CFLAGS-putgrent.c += -fexceptions $(libio-mtsafe) endif +# gshadow routines: +routines += \ + fgetsgent \ + fgetsgent_r \ + getsgent \ + getsgent_r \ + getsgnam \ + getsgnam_r \ + putsgent \ + sgetsgent \ + sgetsgent_r \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-getsgent_r.c += -fexceptions +CFLAGS-getsgent.c += -fexceptions +CFLAGS-fgetsgent.c += -fexceptions +CFLAGS-fgetsgent_r.c += -fexceptions $(libio-mtsafe) +CFLAGS-putsgent.c += -fexceptions $(libio-mtsafe) +CFLAGS-getsgnam.c += -fexceptions +CFLAGS-getsgnam_r.c += -fexceptions +endif + # These are the databases that go through nss dispatch. # Caution: if you add a database here, you must add its real name # in databases.def, too. @@ -118,6 +142,8 @@ tests := \ test-digits-dots \ test-netdb \ testgrp \ + tst-fgetsgent_r \ + tst-gshadow \ tst-nss-getpwent \ tst-nss-hash \ tst-nss-test1 \ @@ -126,6 +152,8 @@ tests := \ tst-nss-test5 \ tst-nss-test_errno \ tst-putgrent \ + tst-putsgent \ + tst-sgetsgent \ # tests xtests = bug-erange diff --git a/nss/Versions b/nss/Versions index 5401829911..6204ac0af1 100644 --- a/nss/Versions +++ b/nss/Versions @@ -37,6 +37,25 @@ libc { # g* getgrouplist; } + GLIBC_2.10 { + # e* + endsgent; + + # f* + fgetsgent; fgetsgent_r; + + # g* + getsgent; getsgent_r; getsgnam; getsgnam_r; + + # p* + putsgent; + + # s* + setsgent; + + # s* + sgetsgent; sgetsgent_r; + } GLIBC_2.27 { } GLIBC_PRIVATE { diff --git a/gshadow/fgetsgent.c b/nss/fgetsgent.c similarity index 100% rename from gshadow/fgetsgent.c rename to nss/fgetsgent.c diff --git a/gshadow/fgetsgent_r.c b/nss/fgetsgent_r.c similarity index 100% rename from gshadow/fgetsgent_r.c rename to nss/fgetsgent_r.c diff --git a/gshadow/getsgent.c b/nss/getsgent.c similarity index 100% rename from gshadow/getsgent.c rename to nss/getsgent.c diff --git a/gshadow/getsgent_r.c b/nss/getsgent_r.c similarity index 100% rename from gshadow/getsgent_r.c rename to nss/getsgent_r.c diff --git a/gshadow/getsgnam.c b/nss/getsgnam.c similarity index 100% rename from gshadow/getsgnam.c rename to nss/getsgnam.c diff --git a/gshadow/getsgnam_r.c b/nss/getsgnam_r.c similarity index 100% rename from gshadow/getsgnam_r.c rename to nss/getsgnam_r.c diff --git a/gshadow/gshadow.h b/nss/gshadow.h similarity index 100% rename from gshadow/gshadow.h rename to nss/gshadow.h diff --git a/gshadow/putsgent.c b/nss/putsgent.c similarity index 100% rename from gshadow/putsgent.c rename to nss/putsgent.c diff --git a/gshadow/sgetsgent.c b/nss/sgetsgent.c similarity index 100% rename from gshadow/sgetsgent.c rename to nss/sgetsgent.c diff --git a/gshadow/sgetsgent_r.c b/nss/sgetsgent_r.c similarity index 100% rename from gshadow/sgetsgent_r.c rename to nss/sgetsgent_r.c diff --git a/gshadow/tst-fgetsgent_r.c b/nss/tst-fgetsgent_r.c similarity index 100% rename from gshadow/tst-fgetsgent_r.c rename to nss/tst-fgetsgent_r.c diff --git a/gshadow/tst-gshadow.c b/nss/tst-gshadow.c similarity index 100% rename from gshadow/tst-gshadow.c rename to nss/tst-gshadow.c diff --git a/gshadow/tst-putsgent.c b/nss/tst-putsgent.c similarity index 100% rename from gshadow/tst-putsgent.c rename to nss/tst-putsgent.c diff --git a/gshadow/tst-sgetsgent.c b/nss/tst-sgetsgent.c similarity index 100% rename from gshadow/tst-sgetsgent.c rename to nss/tst-sgetsgent.c From patchwork Mon Oct 2 12:55:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76957 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1869A385624F for ; Mon, 2 Oct 2023 13:02:27 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 861CC385CC91 for ; Mon, 2 Oct 2023 13:02:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 861CC385CC91 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9l0leiNT5s+PoYERAmgKwHhQv59EQZboIhGRM0SYCP4=; b=Xnn7DU0qId5msKfEXdjWL327UAfEjXhLs6KpAQ7PXGYug2m5YNRUsEYN4aMAqVHwYCJx/a DOpa30wT8zmov6kWzfepip6kzc8kO5azS6+QIS8YP7g9fGAkfFflBX5RL+smrPtStuwH3R sdxqDSaI715nSasIzJR4Otn+nPrcG5w= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-411-sqz8ev6_N-KiMvln-zkDtw-1; Mon, 02 Oct 2023 09:02:07 -0400 X-MC-Unique: sqz8ev6_N-KiMvln-zkDtw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9593F811E88 for ; Mon, 2 Oct 2023 13:02:07 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1E155C15BB8; Mon, 2 Oct 2023 13:02:07 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 05/16] Remove 'pwd' and merge into 'nss' Date: Mon, 2 Oct 2023 14:55:17 +0200 Message-ID: <20231002130150.1497733-6-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The majority of pwd routines are entry points for nss functionality. This commit removes the 'pwd' subdirectory and moves all functionality and tests to 'nss'. References to pwd/ are accordingly changed. Reviewed-by: Adhemerval Zanella --- Makeconfig | 2 +- include/pwd.h | 2 +- nss/Makefile | 24 +++++++++++++++++++++ nss/Versions | 8 +++++++ {pwd => nss}/fgetpwent.c | 0 {pwd => nss}/fgetpwent_r.c | 0 {pwd => nss}/getpw.c | 0 {pwd => nss}/getpwent.c | 0 {pwd => nss}/getpwent_r.c | 0 {pwd => nss}/getpwnam.c | 0 {pwd => nss}/getpwnam_r.c | 0 {pwd => nss}/getpwuid.c | 0 {pwd => nss}/getpwuid_r.c | 0 {pwd => nss}/putpwent.c | 0 {pwd => nss}/pwd.h | 0 {pwd => nss}/tst-getpw.c | 0 {pwd => nss}/tst-putpwent.c | 0 pwd/Makefile | 42 ------------------------------------- pwd/Versions | 19 ----------------- 19 files changed, 34 insertions(+), 63 deletions(-) rename {pwd => nss}/fgetpwent.c (100%) rename {pwd => nss}/fgetpwent_r.c (100%) rename {pwd => nss}/getpw.c (100%) rename {pwd => nss}/getpwent.c (100%) rename {pwd => nss}/getpwent_r.c (100%) rename {pwd => nss}/getpwnam.c (100%) rename {pwd => nss}/getpwnam_r.c (100%) rename {pwd => nss}/getpwuid.c (100%) rename {pwd => nss}/getpwuid_r.c (100%) rename {pwd => nss}/putpwent.c (100%) rename {pwd => nss}/pwd.h (100%) rename {pwd => nss}/tst-getpw.c (100%) rename {pwd => nss}/tst-putpwent.c (100%) delete mode 100644 pwd/Makefile delete mode 100644 pwd/Versions diff --git a/Makeconfig b/Makeconfig index ac7fa3dbb3..e5badddbc4 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1352,7 +1352,7 @@ endif # dependencies and generate sorted-subdirs dynamically. all-subdirs = csu assert ctype locale intl catgets math setjmp signal \ stdlib stdio-common libio malloc string wcsmbs time dirent \ - pwd posix io termios resource misc socket sysvipc gmon \ + posix io termios resource misc socket sysvipc gmon \ gnulib iconv iconvdata wctype manual shadow po argp \ localedata timezone rt conform debug mathvec support \ dlfcn elf diff --git a/include/pwd.h b/include/pwd.h index f8975d4957..c4ca8bab33 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -1,5 +1,5 @@ #ifndef _PWD_H -#include +#include #ifndef _ISOMAC /* Now define the internal interfaces. */ diff --git a/nss/Makefile b/nss/Makefile index 5256b90f8b..28648ea884 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -26,6 +26,7 @@ headers := \ grp.h \ gshadow.h \ nss.h \ + pwd.h \ # headers # This is the trivial part which goes into libc itself. @@ -103,6 +104,27 @@ CFLAGS-getsgnam.c += -fexceptions CFLAGS-getsgnam_r.c += -fexceptions endif +# pwd routines: +routines += \ + fgetpwent \ + fgetpwent_r \ + getpw \ + getpwent \ + getpwent_r \ + getpwnam \ + getpwnam_r \ + getpwuid \ + getpwuid_r \ + putpwent \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-fgetpwent_r.c += $(libio-mtsafe) +CFLAGS-getpw.c += -fexceptions +CFLAGS-getpwent.c += -fexceptions +CFLAGS-getpwent_r.c += -fexceptions +endif + # These are the databases that go through nss dispatch. # Caution: if you add a database here, you must add its real name # in databases.def, too. @@ -143,6 +165,7 @@ tests := \ test-netdb \ testgrp \ tst-fgetsgent_r \ + tst-getpw \ tst-gshadow \ tst-nss-getpwent \ tst-nss-hash \ @@ -152,6 +175,7 @@ tests := \ tst-nss-test5 \ tst-nss-test_errno \ tst-putgrent \ + tst-putpwent \ tst-putsgent \ tst-sgetsgent \ # tests diff --git a/nss/Versions b/nss/Versions index 6204ac0af1..58ca73c9df 100644 --- a/nss/Versions +++ b/nss/Versions @@ -8,19 +8,26 @@ libc { # e* endgrent; + endpwent; # f* fgetgrent; fgetgrent_r; + fgetpwent; fgetpwent_r; # g* getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r; getgroups; + getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; # i* initgroups; + # p* + putpwent; + # s* setgrent; + setpwent; } GLIBC_2.1 { # p* @@ -29,6 +36,7 @@ libc { GLIBC_2.1.2 { # g* getgrent_r; getgrgid_r; getgrnam_r; + getpwent_r; getpwuid_r; getpwnam_r; } GLIBC_2.2.2 { __nss_hostname_digits_dots; diff --git a/pwd/fgetpwent.c b/nss/fgetpwent.c similarity index 100% rename from pwd/fgetpwent.c rename to nss/fgetpwent.c diff --git a/pwd/fgetpwent_r.c b/nss/fgetpwent_r.c similarity index 100% rename from pwd/fgetpwent_r.c rename to nss/fgetpwent_r.c diff --git a/pwd/getpw.c b/nss/getpw.c similarity index 100% rename from pwd/getpw.c rename to nss/getpw.c diff --git a/pwd/getpwent.c b/nss/getpwent.c similarity index 100% rename from pwd/getpwent.c rename to nss/getpwent.c diff --git a/pwd/getpwent_r.c b/nss/getpwent_r.c similarity index 100% rename from pwd/getpwent_r.c rename to nss/getpwent_r.c diff --git a/pwd/getpwnam.c b/nss/getpwnam.c similarity index 100% rename from pwd/getpwnam.c rename to nss/getpwnam.c diff --git a/pwd/getpwnam_r.c b/nss/getpwnam_r.c similarity index 100% rename from pwd/getpwnam_r.c rename to nss/getpwnam_r.c diff --git a/pwd/getpwuid.c b/nss/getpwuid.c similarity index 100% rename from pwd/getpwuid.c rename to nss/getpwuid.c diff --git a/pwd/getpwuid_r.c b/nss/getpwuid_r.c similarity index 100% rename from pwd/getpwuid_r.c rename to nss/getpwuid_r.c diff --git a/pwd/putpwent.c b/nss/putpwent.c similarity index 100% rename from pwd/putpwent.c rename to nss/putpwent.c diff --git a/pwd/pwd.h b/nss/pwd.h similarity index 100% rename from pwd/pwd.h rename to nss/pwd.h diff --git a/pwd/tst-getpw.c b/nss/tst-getpw.c similarity index 100% rename from pwd/tst-getpw.c rename to nss/tst-getpw.c diff --git a/pwd/tst-putpwent.c b/nss/tst-putpwent.c similarity index 100% rename from pwd/tst-putpwent.c rename to nss/tst-putpwent.c diff --git a/pwd/Makefile b/pwd/Makefile deleted file mode 100644 index d85842af3e..0000000000 --- a/pwd/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 1991-2023 Free Software Foundation, Inc. -# This file is part of the GNU C Library. - -# The GNU C Library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. - -# The GNU C Library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. - -# You should have received a copy of the GNU Lesser General Public -# License along with the GNU C Library; if not, see -# . - -# -# Sub-makefile for pwd portion of the library. -# -subdir := pwd - -include ../Makeconfig - -headers := pwd.h - -routines := fgetpwent getpw putpwent \ - getpwent getpwnam getpwuid \ - getpwent_r getpwnam_r getpwuid_r fgetpwent_r - -tests := tst-getpw tst-putpwent - -include ../Rules - -ifeq ($(have-thread-library),yes) - -CFLAGS-getpwent_r.c += -fexceptions -CFLAGS-getpwent.c += -fexceptions -CFLAGS-getpw.c += -fexceptions -CFLAGS-fgetpwent_r.c += $(libio-mtsafe) - -endif diff --git a/pwd/Versions b/pwd/Versions deleted file mode 100644 index b56970019a..0000000000 --- a/pwd/Versions +++ /dev/null @@ -1,19 +0,0 @@ -libc { - GLIBC_2.0 { - # e* - endpwent; - - # f* - fgetpwent; fgetpwent_r; - - # g* - getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; - - # p* - putpwent; setpwent; - } - GLIBC_2.1.2 { - # g* - getpwent_r; getpwuid_r; getpwnam_r; - } -} From patchwork Mon Oct 2 12:55:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76959 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B249B388264A for ; Mon, 2 Oct 2023 13:02:45 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id AC75D38560AA for ; Mon, 2 Oct 2023 13:02:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AC75D38560AA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pQsYY/PaRUVjyfbf7VPMSDsfQbY0C/uFvofik2zi8NY=; b=hD7wM0dR4z2T0jKc/W0G3HTwTnNDLAIM7+s013d/opqyvwErRA9hkqUshMZmXZsLMDvzCD EvsMdAoYZlkFLt1UzHl2o33Wg+OFsH4MkLINswD7POtd/y/H4VlJ047T5NbRS7aCY6OMI8 JCEwf/5FAR9SFrUM7jki1eWzhknyLVM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-644-MeJeRsBbMx6g8rkr5cX8wA-1; Mon, 02 Oct 2023 09:02:09 -0400 X-MC-Unique: MeJeRsBbMx6g8rkr5cX8wA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C2E7E29AB45C for ; Mon, 2 Oct 2023 13:02:08 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A72FC158BA; Mon, 2 Oct 2023 13:02:08 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 06/16] Remove 'shadow' and merge into 'nss' Date: Mon, 2 Oct 2023 14:55:18 +0200 Message-ID: <20231002130150.1497733-7-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The majority of shadow routines are entry points for nss functionality. This commit removes the 'shadow' subdirectory and moves all functionality and tests to 'nss'. References to shadow/ are accordingly changed. Reviewed-by: Adhemerval Zanella --- Makeconfig | 2 +- include/shadow.h | 2 +- nss/Makefile | 27 +++++++++++++++++++++++ nss/Versions | 13 +++++++++++ {shadow => nss}/fgetspent.c | 0 {shadow => nss}/fgetspent_r.c | 0 {shadow => nss}/getspent.c | 0 {shadow => nss}/getspent_r.c | 0 {shadow => nss}/getspnam.c | 0 {shadow => nss}/getspnam_r.c | 0 {shadow => nss}/lckpwdf.c | 0 {shadow => nss}/putspent.c | 0 {shadow => nss}/sgetspent.c | 0 {shadow => nss}/sgetspent_r.c | 0 {shadow => nss}/shadow.h | 0 {shadow => nss}/tst-putspent.c | 0 {shadow => nss}/tst-shadow.c | 0 shadow/Makefile | 40 ---------------------------------- shadow/Versions | 31 -------------------------- 19 files changed, 42 insertions(+), 73 deletions(-) rename {shadow => nss}/fgetspent.c (100%) rename {shadow => nss}/fgetspent_r.c (100%) rename {shadow => nss}/getspent.c (100%) rename {shadow => nss}/getspent_r.c (100%) rename {shadow => nss}/getspnam.c (100%) rename {shadow => nss}/getspnam_r.c (100%) rename {shadow => nss}/lckpwdf.c (100%) rename {shadow => nss}/putspent.c (100%) rename {shadow => nss}/sgetspent.c (100%) rename {shadow => nss}/sgetspent_r.c (100%) rename {shadow => nss}/shadow.h (100%) rename {shadow => nss}/tst-putspent.c (100%) rename {shadow => nss}/tst-shadow.c (100%) delete mode 100644 shadow/Makefile delete mode 100644 shadow/Versions diff --git a/Makeconfig b/Makeconfig index e5badddbc4..fc35aee10b 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1353,7 +1353,7 @@ endif all-subdirs = csu assert ctype locale intl catgets math setjmp signal \ stdlib stdio-common libio malloc string wcsmbs time dirent \ posix io termios resource misc socket sysvipc gmon \ - gnulib iconv iconvdata wctype manual shadow po argp \ + gnulib iconv iconvdata wctype manual po argp \ localedata timezone rt conform debug mathvec support \ dlfcn elf diff --git a/include/shadow.h b/include/shadow.h index fb1681909f..bbb8be2ff0 100644 --- a/include/shadow.h +++ b/include/shadow.h @@ -1,5 +1,5 @@ #ifndef _SHADOW_H -#include +#include # ifndef _ISOMAC diff --git a/nss/Makefile b/nss/Makefile index 28648ea884..84cf62af2b 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -27,6 +27,7 @@ headers := \ gshadow.h \ nss.h \ pwd.h \ + shadow.h \ # headers # This is the trivial part which goes into libc itself. @@ -125,6 +126,30 @@ CFLAGS-getpwent.c += -fexceptions CFLAGS-getpwent_r.c += -fexceptions endif +# shadow routines +routines += \ + fgetspent \ + fgetspent_r \ + getspent \ + getspent_r \ + getspnam \ + getspnam_r \ + lckpwdf \ + putspent \ + sgetspent \ + sgetspent_r \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-getspent_r.c += -fexceptions +CFLAGS-getspent.c += -fexceptions +CFLAGS-fgetspent.c += -fexceptions +CFLAGS-fgetspent_r.c += -fexceptions $(libio-mtsafe) +CFLAGS-putspent.c += -fexceptions $(libio-mtsafe) +CFLAGS-getspnam.c += -fexceptions +CFLAGS-getspnam_r.c += -fexceptions +endif + # These are the databases that go through nss dispatch. # Caution: if you add a database here, you must add its real name # in databases.def, too. @@ -177,7 +202,9 @@ tests := \ tst-putgrent \ tst-putpwent \ tst-putsgent \ + tst-putspent \ tst-sgetsgent \ + tst-shadow \ # tests xtests = bug-erange diff --git a/nss/Versions b/nss/Versions index 58ca73c9df..632af25be4 100644 --- a/nss/Versions +++ b/nss/Versions @@ -9,25 +9,37 @@ libc { # e* endgrent; endpwent; + endspent; # f* fgetgrent; fgetgrent_r; fgetpwent; fgetpwent_r; + fgetspent; fgetspent_r; # g* getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r; getgroups; getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; + getspent; getspent_r; getspnam; getspnam_r; # i* initgroups; + # l* + lckpwdf; + # p* putpwent; + putspent; # s* setgrent; setpwent; + setspent; + sgetspent; sgetspent_r; + + # u* + ulckpwdf; } GLIBC_2.1 { # p* @@ -37,6 +49,7 @@ libc { # g* getgrent_r; getgrgid_r; getgrnam_r; getpwent_r; getpwuid_r; getpwnam_r; + getspent_r; getspnam_r; } GLIBC_2.2.2 { __nss_hostname_digits_dots; diff --git a/shadow/fgetspent.c b/nss/fgetspent.c similarity index 100% rename from shadow/fgetspent.c rename to nss/fgetspent.c diff --git a/shadow/fgetspent_r.c b/nss/fgetspent_r.c similarity index 100% rename from shadow/fgetspent_r.c rename to nss/fgetspent_r.c diff --git a/shadow/getspent.c b/nss/getspent.c similarity index 100% rename from shadow/getspent.c rename to nss/getspent.c diff --git a/shadow/getspent_r.c b/nss/getspent_r.c similarity index 100% rename from shadow/getspent_r.c rename to nss/getspent_r.c diff --git a/shadow/getspnam.c b/nss/getspnam.c similarity index 100% rename from shadow/getspnam.c rename to nss/getspnam.c diff --git a/shadow/getspnam_r.c b/nss/getspnam_r.c similarity index 100% rename from shadow/getspnam_r.c rename to nss/getspnam_r.c diff --git a/shadow/lckpwdf.c b/nss/lckpwdf.c similarity index 100% rename from shadow/lckpwdf.c rename to nss/lckpwdf.c diff --git a/shadow/putspent.c b/nss/putspent.c similarity index 100% rename from shadow/putspent.c rename to nss/putspent.c diff --git a/shadow/sgetspent.c b/nss/sgetspent.c similarity index 100% rename from shadow/sgetspent.c rename to nss/sgetspent.c diff --git a/shadow/sgetspent_r.c b/nss/sgetspent_r.c similarity index 100% rename from shadow/sgetspent_r.c rename to nss/sgetspent_r.c diff --git a/shadow/shadow.h b/nss/shadow.h similarity index 100% rename from shadow/shadow.h rename to nss/shadow.h diff --git a/shadow/tst-putspent.c b/nss/tst-putspent.c similarity index 100% rename from shadow/tst-putspent.c rename to nss/tst-putspent.c diff --git a/shadow/tst-shadow.c b/nss/tst-shadow.c similarity index 100% rename from shadow/tst-shadow.c rename to nss/tst-shadow.c diff --git a/shadow/Makefile b/shadow/Makefile deleted file mode 100644 index 0102a4d0e3..0000000000 --- a/shadow/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 1996-2023 Free Software Foundation, Inc. -# This file is part of the GNU C Library. - -# The GNU C Library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. - -# The GNU C Library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. - -# You should have received a copy of the GNU Lesser General Public -# License along with the GNU C Library; if not, see -# . - -# -# Makefile for shadow. -# -subdir := shadow - -include ../Makeconfig - -headers = shadow.h -routines = getspent getspnam sgetspent fgetspent putspent \ - getspent_r getspnam_r sgetspent_r fgetspent_r \ - lckpwdf - -tests = tst-shadow tst-putspent - -CFLAGS-getspent_r.c += -fexceptions -CFLAGS-getspent.c += -fexceptions -CFLAGS-fgetspent.c += -fexceptions -CFLAGS-fgetspent_r.c += -fexceptions $(libio-mtsafe) -CFLAGS-putspent.c += -fexceptions $(libio-mtsafe) -CFLAGS-getspnam.c += -fexceptions -CFLAGS-getspnam_r.c += -fexceptions - -include ../Rules diff --git a/shadow/Versions b/shadow/Versions deleted file mode 100644 index 38ab368fff..0000000000 --- a/shadow/Versions +++ /dev/null @@ -1,31 +0,0 @@ -libc { - GLIBC_2.0 { - # e* - endspent; - - # f* - fgetspent; fgetspent_r; - - # g* - getspent; getspent_r; getspnam; getspnam_r; - - # l* - lckpwdf; - - # p* - putspent; - - # s* - setspent; - - # s* - sgetspent; sgetspent_r; - - # u* - ulckpwdf; - } - GLIBC_2.1.2 { - # g* - getspent_r; getspnam_r; - } -} From patchwork Mon Oct 2 12:55:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76960 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A4373861866 for ; Mon, 2 Oct 2023 13:02:55 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 21C02385CCBE for ; Mon, 2 Oct 2023 13:02:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 21C02385CCBE Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ouerx0ZYnLGblOsOZhuFLyIqO3oIsIOPfmhgGm9NehQ=; b=O3lIdj/4b2oopNvrhxSmLtZIv+dVu0AFNqOiLETz7MvxKBO4DfOiB6wv7u+UVJp3XFkJ/S MhadyP7wxqyTNZj7OqWlVACk1FvvAUQ6sJJlAJA/O156KJqpLtkmNvQqo6LZuUmq6moBJ5 gO/LtCay7h6ZjMhW7Np7pWZxUKuIwG4= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-617-cYNH_njfOB-yF_g5uUV8VQ-1; Mon, 02 Oct 2023 09:02:10 -0400 X-MC-Unique: cYNH_njfOB-yF_g5uUV8VQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E782D3816C9C for ; Mon, 2 Oct 2023 13:02:09 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6CF14C15BB8; Mon, 2 Oct 2023 13:02:09 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 07/16] Move 'aliases' routines from 'inet' into 'nss' Date: Mon, 2 Oct 2023 14:55:19 +0200 Message-ID: <20231002130150.1497733-8-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The aliases routines are entry points for nss functionality. This commit moves aliases.h and the aliases routines from the 'inet' subdirectory to 'nss', and adjusts any external references. Reviewed-by: Adhemerval Zanella --- include/aliases.h | 2 +- inet/Makefile | 7 ------- inet/Versions | 1 - nss/Makefile | 14 ++++++++++++++ nss/Versions | 1 + {inet => nss}/aliases.h | 0 {inet => nss}/getaliasent.c | 0 {inet => nss}/getaliasent_r.c | 0 {inet => nss}/getaliasname.c | 0 {inet => nss}/getaliasname_r.c | 0 10 files changed, 16 insertions(+), 9 deletions(-) rename {inet => nss}/aliases.h (100%) rename {inet => nss}/getaliasent.c (100%) rename {inet => nss}/getaliasent_r.c (100%) rename {inet => nss}/getaliasname.c (100%) rename {inet => nss}/getaliasname_r.c (100%) diff --git a/include/aliases.h b/include/aliases.h index db82588630..2c7756efe8 100644 --- a/include/aliases.h +++ b/include/aliases.h @@ -1,5 +1,5 @@ #ifndef _ALIASES_H -#include +#include # ifndef _ISOMAC diff --git a/inet/Makefile b/inet/Makefile index 9db7f941c6..bd3dc58322 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -24,7 +24,6 @@ include ../Makeconfig headers := \ $(wildcard arpa/*.h protocols/*.h) \ - aliases.h \ bits/in.h \ ifaddrs.h \ netinet/ether.h \ @@ -49,10 +48,6 @@ routines := \ ether_ntoa \ ether_ntoa_r \ ether_ntoh \ - getaliasent \ - getaliasent_r \ - getaliasname \ - getaliasname_r \ gethstbyad \ gethstbyad_r \ gethstbynm \ @@ -176,8 +171,6 @@ CFLAGS-getnetbyad_r.c += -fexceptions CFLAGS-getnetbyad.c += -fexceptions CFLAGS-getnetent_r.c += -fexceptions CFLAGS-getnetent.c += -fexceptions -CFLAGS-getaliasent_r.c += -fexceptions -CFLAGS-getaliasent.c += -fexceptions CFLAGS-getrpcent_r.c += -fexceptions CFLAGS-getrpcent.c += -fexceptions CFLAGS-getservent_r.c += -fexceptions diff --git a/inet/Versions b/inet/Versions index 84cbe847cd..e6d1e6f1ba 100644 --- a/inet/Versions +++ b/inet/Versions @@ -14,7 +14,6 @@ libc { ether_ntoa_r; ether_ntohost; # g* - getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r; getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2; gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r; getnetbyaddr; getnetbyaddr_r; getnetbyname; diff --git a/nss/Makefile b/nss/Makefile index 84cf62af2b..2dfa7ebef9 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -23,6 +23,7 @@ subdir := nss include ../Makeconfig headers := \ + aliases.h \ grp.h \ gshadow.h \ nss.h \ @@ -54,6 +55,19 @@ routines = \ valid_list_field \ # routines +# alias routines: +routines += \ + getaliasent \ + getaliasent_r \ + getaliasname \ + getaliasname_r \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-getaliasent_r.c += -fexceptions +CFLAGS-getaliasent.c += -fexceptions +endif + # grp routines: routines += \ fgetgrent \ diff --git a/nss/Versions b/nss/Versions index 632af25be4..5d1b1dac3d 100644 --- a/nss/Versions +++ b/nss/Versions @@ -17,6 +17,7 @@ libc { fgetspent; fgetspent_r; # g* + getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r; getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r; getgroups; getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; diff --git a/inet/aliases.h b/nss/aliases.h similarity index 100% rename from inet/aliases.h rename to nss/aliases.h diff --git a/inet/getaliasent.c b/nss/getaliasent.c similarity index 100% rename from inet/getaliasent.c rename to nss/getaliasent.c diff --git a/inet/getaliasent_r.c b/nss/getaliasent_r.c similarity index 100% rename from inet/getaliasent_r.c rename to nss/getaliasent_r.c diff --git a/inet/getaliasname.c b/nss/getaliasname.c similarity index 100% rename from inet/getaliasname.c rename to nss/getaliasname.c diff --git a/inet/getaliasname_r.c b/nss/getaliasname_r.c similarity index 100% rename from inet/getaliasname_r.c rename to nss/getaliasname_r.c From patchwork Mon Oct 2 12:55:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76968 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B8A1D3954420 for ; Mon, 2 Oct 2023 13:03:32 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D54343875437 for ; Mon, 2 Oct 2023 13:02:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D54343875437 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5w1TMGf59SvJowqykJBSpqpufUFsGngPBys20GFrz88=; b=ayaGWEPts1nmWE42zwcHG6aYgSu+PNLVJ0VXmoBm4aD0ezZCBxfjm1FRCcI4JYINVX9qXp kbKrAGib80vOW6292g2ATr9+puarf6b7yULxarX+k9eKrifMTNSTYLvoQT+LCT8GxIKbk0 vv/4H9dg5HSDCvE0JXYH6DAz7E3k11c= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-691-JliiwX2KNPuP6x1EoqVSJg-1; Mon, 02 Oct 2023 09:02:11 -0400 X-MC-Unique: JliiwX2KNPuP6x1EoqVSJg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2483029AB442 for ; Mon, 2 Oct 2023 13:02:11 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A12CDC15BB8; Mon, 2 Oct 2023 13:02:10 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 08/16] Move 'ethers' routines from 'inet' into 'nss' Date: Mon, 2 Oct 2023 14:55:20 +0200 Message-ID: <20231002130150.1497733-9-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org ether_hostton and ether_ntohost are entry points for nss functionality. This commit moves them from the 'inet' subdirectory to 'nss', and adjusts any references accordingly. Reviewed-by: Adhemerval Zanella --- inet/Makefile | 2 -- inet/Versions | 4 ++-- nss/Makefile | 6 ++++++ nss/Versions | 1 + {inet => nss}/ether_hton.c | 2 +- {inet => nss}/ether_ntoh.c | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) rename {inet => nss}/ether_hton.c (98%) rename {inet => nss}/ether_ntoh.c (98%) diff --git a/inet/Makefile b/inet/Makefile index bd3dc58322..4d053de748 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -43,11 +43,9 @@ routines := \ deadline \ ether_aton \ ether_aton_r \ - ether_hton \ ether_line \ ether_ntoa \ ether_ntoa_r \ - ether_ntoh \ gethstbyad \ gethstbyad_r \ gethstbynm \ diff --git a/inet/Versions b/inet/Versions index e6d1e6f1ba..a7c1a0fb6f 100644 --- a/inet/Versions +++ b/inet/Versions @@ -10,8 +10,8 @@ libc { endaliasent; endhostent; endnetent; endnetgrent; endprotoent; endservent; # e* - ether_aton; ether_aton_r; ether_hostton; ether_line; ether_ntoa; - ether_ntoa_r; ether_ntohost; + ether_aton; ether_aton_r; ether_line; ether_ntoa; + ether_ntoa_r; # g* getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname; diff --git a/nss/Makefile b/nss/Makefile index 2dfa7ebef9..148c6dc1cf 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -68,6 +68,12 @@ CFLAGS-getaliasent_r.c += -fexceptions CFLAGS-getaliasent.c += -fexceptions endif +# ethers routines: +routines += \ + ether_hton \ + ether_ntoh \ + # routines + # grp routines: routines += \ fgetgrent \ diff --git a/nss/Versions b/nss/Versions index 5d1b1dac3d..99208cb9df 100644 --- a/nss/Versions +++ b/nss/Versions @@ -10,6 +10,7 @@ libc { endgrent; endpwent; endspent; + ether_hostton; ether_ntohost; # f* fgetgrent; fgetgrent_r; diff --git a/inet/ether_hton.c b/nss/ether_hton.c similarity index 98% rename from inet/ether_hton.c rename to nss/ether_hton.c index 1b49a57f48..5419464756 100644 --- a/inet/ether_hton.c +++ b/nss/ether_hton.c @@ -20,7 +20,7 @@ #include #include -#include "../nss/nsswitch.h" +#include "nsswitch.h" /* Type of the lookup function we need here. */ typedef int (*lookup_function) (const char *, struct etherent *, char *, int, diff --git a/inet/ether_ntoh.c b/nss/ether_ntoh.c similarity index 98% rename from inet/ether_ntoh.c rename to nss/ether_ntoh.c index 9f9d7c1a63..2f1eb4ec3d 100644 --- a/inet/ether_ntoh.c +++ b/nss/ether_ntoh.c @@ -20,7 +20,7 @@ #include #include -#include +#include /* Type of the lookup function we need here. */ From patchwork Mon Oct 2 12:55:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76961 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CEDB438845F9 for ; Mon, 2 Oct 2023 13:03:01 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6D672385F015 for ; Mon, 2 Oct 2023 13:02:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D672385F015 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y5bQYDSQ/VwetDC9JbYeWlrIUPGJX/ZO/IvofoWKGbk=; b=cgexpQKxPwRmKeKhVBMg+j8EyEHoj9ThTDkc3uOhYSMjeR6S5KqpI834hpDHcOc7Qb/CVa J+Gvcx2BPgGwM1VdbjhudoZ1Fc6Q+pxu16rKnuKEbjKfV8OHqM4HjZ2rK6avZsaPpzJMJl aeIAsf2Un7zNZBovd/Y5iqWB0tG4NgA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-311-BFOsigEHNNaZa9gtfBcyfQ-1; Mon, 02 Oct 2023 09:02:12 -0400 X-MC-Unique: BFOsigEHNNaZa9gtfBcyfQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 47B4329AB452 for ; Mon, 2 Oct 2023 13:02:12 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C38F3C15BB8; Mon, 2 Oct 2023 13:02:11 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 09/16] Move 'hosts' routines from 'inet' into 'nss' Date: Mon, 2 Oct 2023 14:55:21 +0200 Message-ID: <20231002130150.1497733-10-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The gethostby* and gethostent* routines are entry points for nss functionality. This commit moves them from the 'inet' subdirectory to 'nss'. Reviewed-by: Adhemerval Zanella --- inet/Makefile | 17 ----------------- inet/Versions | 4 +--- nss/Makefile | 24 ++++++++++++++++++++++++ nss/Versions | 2 ++ {inet => nss}/gethstbyad.c | 0 {inet => nss}/gethstbyad_r.c | 0 {inet => nss}/gethstbynm.c | 0 {inet => nss}/gethstbynm2.c | 0 {inet => nss}/gethstbynm2_r.c | 0 {inet => nss}/gethstbynm_r.c | 0 {inet => nss}/gethstent.c | 0 {inet => nss}/gethstent_r.c | 0 {inet => nss}/tst-gethnm.c | 0 13 files changed, 27 insertions(+), 20 deletions(-) rename {inet => nss}/gethstbyad.c (100%) rename {inet => nss}/gethstbyad_r.c (100%) rename {inet => nss}/gethstbynm.c (100%) rename {inet => nss}/gethstbynm2.c (100%) rename {inet => nss}/gethstbynm2_r.c (100%) rename {inet => nss}/gethstbynm_r.c (100%) rename {inet => nss}/gethstent.c (100%) rename {inet => nss}/gethstent_r.c (100%) rename {inet => nss}/tst-gethnm.c (100%) diff --git a/inet/Makefile b/inet/Makefile index 4d053de748..d378542549 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -46,14 +46,6 @@ routines := \ ether_line \ ether_ntoa \ ether_ntoa_r \ - gethstbyad \ - gethstbyad_r \ - gethstbynm \ - gethstbynm2 \ - gethstbynm2_r \ - gethstbynm_r \ - gethstent \ - gethstent_r \ getipv4sourcefilter \ getnameinfo \ getnetbyad \ @@ -123,7 +115,6 @@ tests := \ tst-checks-posix \ tst-ether_aton \ tst-ether_line \ - tst-gethnm \ tst-getni1 \ tst-getni2 \ tst-if_index-long \ @@ -154,14 +145,6 @@ include ../gen-locales.mk ifeq ($(have-thread-library),yes) -CFLAGS-gethstbyad_r.c += -fexceptions -CFLAGS-gethstbyad.c += -fexceptions -CFLAGS-gethstbynm_r.c += -fexceptions -CFLAGS-gethstbynm.c += -fexceptions -CFLAGS-gethstbynm2_r.c += -fexceptions -CFLAGS-gethstbynm2.c += -fexceptions -CFLAGS-gethstent_r.c += -fexceptions -CFLAGS-gethstent.c += -fexceptions CFLAGS-rcmd.c += -fexceptions CFLAGS-getnetbynm_r.c += -fexceptions CFLAGS-getnetbynm.c += -fexceptions diff --git a/inet/Versions b/inet/Versions index a7c1a0fb6f..d937e9835c 100644 --- a/inet/Versions +++ b/inet/Versions @@ -14,9 +14,7 @@ libc { ether_ntoa_r; # g* - getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname; - gethostbyname2; gethostbyname2_r; gethostbyname_r; gethostent; - gethostent_r; getnetbyaddr; getnetbyaddr_r; getnetbyname; + getdomainname; getnetbyaddr; getnetbyaddr_r; getnetbyname; getnetbyname_r; getnetent; getnetent_r; getnetgrent; getnetgrent_r; getprotobyname; getprotobyname_r; getprotobynumber; getprotobynumber_r; getprotoent; getprotoent_r; diff --git a/nss/Makefile b/nss/Makefile index 148c6dc1cf..d0b564a033 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -125,6 +125,29 @@ CFLAGS-getsgnam.c += -fexceptions CFLAGS-getsgnam_r.c += -fexceptions endif +# hosts routines: +routines += \ + gethstbyad \ + gethstbyad_r \ + gethstbynm \ + gethstbynm2 \ + gethstbynm2_r \ + gethstbynm_r \ + gethstent \ + gethstent_r \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-gethstbyad.c += -fexceptions +CFLAGS-gethstbyad_r.c += -fexceptions +CFLAGS-gethstbynm.c += -fexceptions +CFLAGS-gethstbynm_r.c += -fexceptions +CFLAGS-gethstbynm2.c += -fexceptions +CFLAGS-gethstbynm2_r.c += -fexceptions +CFLAGS-gethstent.c += -fexceptions +CFLAGS-gethstent_r.c += -fexceptions +endif + # pwd routines: routines += \ fgetpwent \ @@ -210,6 +233,7 @@ tests := \ test-netdb \ testgrp \ tst-fgetsgent_r \ + tst-gethnm \ tst-getpw \ tst-gshadow \ tst-nss-getpwent \ diff --git a/nss/Versions b/nss/Versions index 99208cb9df..74ba4470d8 100644 --- a/nss/Versions +++ b/nss/Versions @@ -21,6 +21,8 @@ libc { getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r; getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r; getgroups; + gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2; + gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r; getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; getspent; getspent_r; getspnam; getspnam_r; diff --git a/inet/gethstbyad.c b/nss/gethstbyad.c similarity index 100% rename from inet/gethstbyad.c rename to nss/gethstbyad.c diff --git a/inet/gethstbyad_r.c b/nss/gethstbyad_r.c similarity index 100% rename from inet/gethstbyad_r.c rename to nss/gethstbyad_r.c diff --git a/inet/gethstbynm.c b/nss/gethstbynm.c similarity index 100% rename from inet/gethstbynm.c rename to nss/gethstbynm.c diff --git a/inet/gethstbynm2.c b/nss/gethstbynm2.c similarity index 100% rename from inet/gethstbynm2.c rename to nss/gethstbynm2.c diff --git a/inet/gethstbynm2_r.c b/nss/gethstbynm2_r.c similarity index 100% rename from inet/gethstbynm2_r.c rename to nss/gethstbynm2_r.c diff --git a/inet/gethstbynm_r.c b/nss/gethstbynm_r.c similarity index 100% rename from inet/gethstbynm_r.c rename to nss/gethstbynm_r.c diff --git a/inet/gethstent.c b/nss/gethstent.c similarity index 100% rename from inet/gethstent.c rename to nss/gethstent.c diff --git a/inet/gethstent_r.c b/nss/gethstent_r.c similarity index 100% rename from inet/gethstent_r.c rename to nss/gethstent_r.c diff --git a/inet/tst-gethnm.c b/nss/tst-gethnm.c similarity index 100% rename from inet/tst-gethnm.c rename to nss/tst-gethnm.c From patchwork Mon Oct 2 12:55:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76965 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F2C8C3888C79 for ; Mon, 2 Oct 2023 13:03:21 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 298A23861892 for ; Mon, 2 Oct 2023 13:02:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 298A23861892 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qlpIvwAXroS5mefZZDSGw6wHEFBHK5T19d7OtqqqZN0=; b=OalsPG456JzOhNX9NPuDzkkW3KqUdejy9A0dDKYV4Q24WQZ86IiH4SQrhQFVUyV2T6N8QA hnDE4bV9DwKyEROPNjcnS9fUpsTA5umyn2BPSsxQyrlI1rWfiShkxQ8waC5jOCJQKWfSUE VoaR/cuMDzkD/Q5kW3NLC/zi4oHuzBg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-423-pRaSIwgKOqCuy77KGIBhhA-1; Mon, 02 Oct 2023 09:02:13 -0400 X-MC-Unique: pRaSIwgKOqCuy77KGIBhhA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6591D97E40B for ; Mon, 2 Oct 2023 13:02:13 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E0464C15BB8; Mon, 2 Oct 2023 13:02:12 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 10/16] Move 'netgroup' routines from 'inet' into 'nss' Date: Mon, 2 Oct 2023 14:55:22 +0200 Message-ID: <20231002130150.1497733-11-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org These netgroup routines are entry points for nss functionality. This commit moves them along with netgroup.h from the 'inet' subdirectory to 'nss', and adjusts any references accordingly. Reviewed-by: Adhemerval Zanella --- include/netdb.h | 2 +- include/netgroup.h | 2 +- inet/Makefile | 4 ---- inet/Versions | 12 ++++-------- nscd/netgroupcache.c | 2 +- nss/Makefile | 11 +++++++++++ nss/Versions | 7 +++++++ {inet => nss}/getnetgrent.c | 0 {inet => nss}/getnetgrent_r.c | 0 {inet => nss}/netgroup.h | 0 10 files changed, 25 insertions(+), 15 deletions(-) rename {inet => nss}/getnetgrent.c (100%) rename {inet => nss}/getnetgrent_r.c (100%) rename {inet => nss}/netgroup.h (100%) diff --git a/include/netdb.h b/include/netdb.h index 4dcdbb8cd4..1b25837b4b 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -211,7 +211,7 @@ libanl_hidden_proto (__gai_suspend_time64) #define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG) -#include +#include extern enum nss_status _nss_netgroup_parseline (char **cursor, struct __netgrent *result, diff --git a/include/netgroup.h b/include/netgroup.h index 4b2b284cdb..40a5d1a65e 100644 --- a/include/netgroup.h +++ b/include/netgroup.h @@ -1 +1 @@ -#include +#include diff --git a/inet/Makefile b/inet/Makefile index d378542549..9f39f7ff2b 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -54,8 +54,6 @@ routines := \ getnetbynm_r \ getnetent \ getnetent_r \ - getnetgrent \ - getnetgrent_r \ getproto \ getproto_r \ getprtent \ @@ -160,8 +158,6 @@ CFLAGS-getprtent_r.c += -fexceptions CFLAGS-getprtent.c += -fexceptions CFLAGS-either_ntoh.c += -fexceptions CFLAGS-either_hton.c += -fexceptions -CFLAGS-getnetgrent.c += -fexceptions -CFLAGS-getnetgrent_r.c += -fexceptions CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes) CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes) CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes) diff --git a/inet/Versions b/inet/Versions index d937e9835c..1ffa444730 100644 --- a/inet/Versions +++ b/inet/Versions @@ -7,7 +7,7 @@ libc { rexecoptions; # e* - endaliasent; endhostent; endnetent; endnetgrent; endprotoent; endservent; + endaliasent; endhostent; endnetent; endprotoent; endservent; # e* ether_aton; ether_aton_r; ether_line; ether_ntoa; @@ -15,7 +15,7 @@ libc { # g* getdomainname; getnetbyaddr; getnetbyaddr_r; getnetbyname; - getnetbyname_r; getnetent; getnetent_r; getnetgrent; getnetgrent_r; + getnetbyname_r; getnetent; getnetent_r; getprotobyname; getprotobyname_r; getprotobynumber; getprotobynumber_r; getprotoent; getprotoent_r; getservbyname; getservbyname_r; getservbyport; @@ -36,7 +36,7 @@ libc { rcmd; rexec; rresvport; ruserok; ruserpass; # s* - setaliasent; setnetent; setnetgrent; setprotoent; setservent; + setaliasent; setnetent; setprotoent; setservent; } GLIBC_2.1 { # variables in normal name space @@ -49,7 +49,7 @@ libc { # g* getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r; gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r; - getnetent_r; getnetgrent_r; getprotobyname_r; getprotobynumber_r; + getnetent_r; getprotobyname_r; getprotobynumber_r; getprotoent_r; getservbyname_r; getservbyport_r; getservent_r; @@ -81,10 +81,6 @@ libc { inet6_rth_segments; inet6_rth_getaddr; } GLIBC_PRIVATE { - # functions used in other libraries - __internal_endnetgrent; __internal_getnetgrent_r; - __internal_setnetgrent; - # Used from nscd. __inet6_scopeid_pton; __idna_to_dns_encoding; diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c index 06b7d7b6ca..b9174a138c 100644 --- a/nscd/netgroupcache.c +++ b/nscd/netgroupcache.c @@ -24,7 +24,7 @@ #include #include -#include "../inet/netgroup.h" +#include "../nss/netgroup.h" #include "nscd.h" #include "dbg_log.h" diff --git a/nss/Makefile b/nss/Makefile index d0b564a033..2a451f68d9 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -148,6 +148,17 @@ CFLAGS-gethstent.c += -fexceptions CFLAGS-gethstent_r.c += -fexceptions endif +# netgroup routines: +routines += \ + getnetgrent \ + getnetgrent_r \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-getnetgrent.c += -fexceptions +CFLAGS-getnetgrent_r.c += -fexceptions +endif + # pwd routines: routines += \ fgetpwent \ diff --git a/nss/Versions b/nss/Versions index 74ba4470d8..4ddc018012 100644 --- a/nss/Versions +++ b/nss/Versions @@ -8,6 +8,7 @@ libc { # e* endgrent; + endnetgrent; endpwent; endspent; ether_hostton; ether_ntohost; @@ -23,6 +24,7 @@ libc { getgroups; gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2; gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r; + getnetgrent; getnetgrent_r; getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; getspent; getspent_r; getspnam; getspnam_r; @@ -38,6 +40,7 @@ libc { # s* setgrent; + setnetgrent; setpwent; setspent; sgetspent; sgetspent_r; @@ -52,6 +55,7 @@ libc { GLIBC_2.1.2 { # g* getgrent_r; getgrgid_r; getgrnam_r; + getnetgrent_r; getpwent_r; getpwuid_r; getpwnam_r; getspent_r; getspnam_r; } @@ -181,6 +185,9 @@ libc { _nss_files_init; __merge_grp; __copy_grp; + + __internal_endnetgrent; __internal_getnetgrent_r; + __internal_setnetgrent; } } diff --git a/inet/getnetgrent.c b/nss/getnetgrent.c similarity index 100% rename from inet/getnetgrent.c rename to nss/getnetgrent.c diff --git a/inet/getnetgrent_r.c b/nss/getnetgrent_r.c similarity index 100% rename from inet/getnetgrent_r.c rename to nss/getnetgrent_r.c diff --git a/inet/netgroup.h b/nss/netgroup.h similarity index 100% rename from inet/netgroup.h rename to nss/netgroup.h From patchwork Mon Oct 2 12:55:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76971 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 228CF385697B for ; Mon, 2 Oct 2023 13:04:00 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 3437938323DD for ; Mon, 2 Oct 2023 13:02:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3437938323DD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=szhQnwT607aQ/NYarDPNKrOmpmjxMMPIJVXuBtBTGzc=; b=MvNS2laEUsP7eSAFkfz9O2t2wSgK56MlgOug42vKOnhHWc4VkuDA2QJy3zUhPWlCQqN3tx m18MjhKWzW4uIrIEZFp9Wdlp/6BJxlvH0+n6u4JaUxzSnzNlA6ICljUShi8u0FVOJku9r0 HQP1bxC+qMgbiA0Ju8laIyzmoL7NMJ0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-156-n8jBnY4JOY67UfonVyW7QQ-1; Mon, 02 Oct 2023 09:02:14 -0400 X-MC-Unique: n8jBnY4JOY67UfonVyW7QQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8F1E8185A78E for ; Mon, 2 Oct 2023 13:02:14 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 176FBC15BB8; Mon, 2 Oct 2023 13:02:13 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 11/16] Move 'networks' routines from 'inet' into 'nss' Date: Mon, 2 Oct 2023 14:55:23 +0200 Message-ID: <20231002130150.1497733-12-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The getnetby* and getnetent* routines are entry points for nss functionality. This commit moves them from the 'inet' subdirectory to 'nss'. Reviewed-by: Adhemerval Zanella --- inet/Makefile | 12 ------------ inet/Versions | 3 +-- nss/Makefile | 19 +++++++++++++++++++ nss/Versions | 2 ++ {inet => nss}/getnetbyad.c | 0 {inet => nss}/getnetbyad_r.c | 0 {inet => nss}/getnetbynm.c | 0 {inet => nss}/getnetbynm_r.c | 0 {inet => nss}/getnetent.c | 0 {inet => nss}/getnetent_r.c | 0 10 files changed, 22 insertions(+), 14 deletions(-) rename {inet => nss}/getnetbyad.c (100%) rename {inet => nss}/getnetbyad_r.c (100%) rename {inet => nss}/getnetbynm.c (100%) rename {inet => nss}/getnetbynm_r.c (100%) rename {inet => nss}/getnetent.c (100%) rename {inet => nss}/getnetent_r.c (100%) diff --git a/inet/Makefile b/inet/Makefile index 9f39f7ff2b..776cbfa0fd 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -48,12 +48,6 @@ routines := \ ether_ntoa_r \ getipv4sourcefilter \ getnameinfo \ - getnetbyad \ - getnetbyad_r \ - getnetbynm \ - getnetbynm_r \ - getnetent \ - getnetent_r \ getproto \ getproto_r \ getprtent \ @@ -144,12 +138,6 @@ include ../gen-locales.mk ifeq ($(have-thread-library),yes) CFLAGS-rcmd.c += -fexceptions -CFLAGS-getnetbynm_r.c += -fexceptions -CFLAGS-getnetbynm.c += -fexceptions -CFLAGS-getnetbyad_r.c += -fexceptions -CFLAGS-getnetbyad.c += -fexceptions -CFLAGS-getnetent_r.c += -fexceptions -CFLAGS-getnetent.c += -fexceptions CFLAGS-getrpcent_r.c += -fexceptions CFLAGS-getrpcent.c += -fexceptions CFLAGS-getservent_r.c += -fexceptions diff --git a/inet/Versions b/inet/Versions index 1ffa444730..051b305e48 100644 --- a/inet/Versions +++ b/inet/Versions @@ -14,8 +14,7 @@ libc { ether_ntoa_r; # g* - getdomainname; getnetbyaddr; getnetbyaddr_r; getnetbyname; - getnetbyname_r; getnetent; getnetent_r; + getdomainname; getprotobyname; getprotobyname_r; getprotobynumber; getprotobynumber_r; getprotoent; getprotoent_r; getservbyname; getservbyname_r; getservbyport; diff --git a/nss/Makefile b/nss/Makefile index 2a451f68d9..023a11fa4b 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -159,6 +159,25 @@ CFLAGS-getnetgrent.c += -fexceptions CFLAGS-getnetgrent_r.c += -fexceptions endif +# networks routines: +routines += \ + getnetbyad \ + getnetbyad_r \ + getnetbynm \ + getnetbynm_r \ + getnetent \ + getnetent_r \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-getnetbyad.c += -fexceptions +CFLAGS-getnetbyad_r.c += -fexceptions +CFLAGS-getnetbynm.c += -fexceptions +CFLAGS-getnetbynm_r.c += -fexceptions +CFLAGS-getnetent.c += -fexceptions +CFLAGS-getnetent_r.c += -fexceptions +endif + # pwd routines: routines += \ fgetpwent \ diff --git a/nss/Versions b/nss/Versions index 4ddc018012..95219f0fc7 100644 --- a/nss/Versions +++ b/nss/Versions @@ -25,6 +25,8 @@ libc { gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2; gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r; getnetgrent; getnetgrent_r; + getnetbyaddr; getnetbyaddr_r; getnetbyname; getnetbyname_r; + getnetent; getnetent_r; getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; getspent; getspent_r; getspnam; getspnam_r; diff --git a/inet/getnetbyad.c b/nss/getnetbyad.c similarity index 100% rename from inet/getnetbyad.c rename to nss/getnetbyad.c diff --git a/inet/getnetbyad_r.c b/nss/getnetbyad_r.c similarity index 100% rename from inet/getnetbyad_r.c rename to nss/getnetbyad_r.c diff --git a/inet/getnetbynm.c b/nss/getnetbynm.c similarity index 100% rename from inet/getnetbynm.c rename to nss/getnetbynm.c diff --git a/inet/getnetbynm_r.c b/nss/getnetbynm_r.c similarity index 100% rename from inet/getnetbynm_r.c rename to nss/getnetbynm_r.c diff --git a/inet/getnetent.c b/nss/getnetent.c similarity index 100% rename from inet/getnetent.c rename to nss/getnetent.c diff --git a/inet/getnetent_r.c b/nss/getnetent_r.c similarity index 100% rename from inet/getnetent_r.c rename to nss/getnetent_r.c From patchwork Mon Oct 2 12:55:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76963 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BB6FF3889826 for ; Mon, 2 Oct 2023 13:03:08 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 83234386180D for ; Mon, 2 Oct 2023 13:02:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 83234386180D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ToErMRgIvpeomrsqqFFmQs2EIG6v4451j1dSXe892CE=; b=PyB/aFu8cebz9+4Pz2A7tPc8NLHSCQqbA5o/NNx+cy5XaN20PYSyiCYZwrW8KBIvJ1H/4m yaaFfalXmSjmVsA3aG7t2w+AOItsLqSLs//G2Ca6vP5vGYoO50Xn4vKk8zcvFh5X6bi8q6 W7r4ti376jYe6OV00ysAlWT0+BhCsw8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-426-9uz--qcFMlG1trsuYCHGSw-1; Mon, 02 Oct 2023 09:02:16 -0400 X-MC-Unique: 9uz--qcFMlG1trsuYCHGSw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF5BD101A550 for ; Mon, 2 Oct 2023 13:02:15 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 47192C15BB8; Mon, 2 Oct 2023 13:02:15 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 12/16] Move 'protocols' routines from 'inet' into 'nss' Date: Mon, 2 Oct 2023 14:55:24 +0200 Message-ID: <20231002130150.1497733-13-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The getprotoby* and getprotoent* routines are entry points for nss functionality. This commit moves them from the 'inet' subdirectory to 'nss'. Reviewed-by: Adhemerval Zanella --- inet/Makefile | 8 -------- inet/Versions | 5 +---- nss/Makefile | 15 +++++++++++++++ nss/Versions | 3 +++ {inet => nss}/getproto.c | 0 {inet => nss}/getproto_r.c | 0 {inet => nss}/getprtent.c | 0 {inet => nss}/getprtent_r.c | 0 {inet => nss}/getprtname.c | 0 {inet => nss}/getprtname_r.c | 0 10 files changed, 19 insertions(+), 12 deletions(-) rename {inet => nss}/getproto.c (100%) rename {inet => nss}/getproto_r.c (100%) rename {inet => nss}/getprtent.c (100%) rename {inet => nss}/getprtent_r.c (100%) rename {inet => nss}/getprtname.c (100%) rename {inet => nss}/getprtname_r.c (100%) diff --git a/inet/Makefile b/inet/Makefile index 776cbfa0fd..dab7182a11 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -48,12 +48,6 @@ routines := \ ether_ntoa_r \ getipv4sourcefilter \ getnameinfo \ - getproto \ - getproto_r \ - getprtent \ - getprtent_r \ - getprtname \ - getprtname_r \ getrpcbyname \ getrpcbyname_r \ getrpcbynumber \ @@ -142,8 +136,6 @@ CFLAGS-getrpcent_r.c += -fexceptions CFLAGS-getrpcent.c += -fexceptions CFLAGS-getservent_r.c += -fexceptions CFLAGS-getservent.c += -fexceptions -CFLAGS-getprtent_r.c += -fexceptions -CFLAGS-getprtent.c += -fexceptions CFLAGS-either_ntoh.c += -fexceptions CFLAGS-either_hton.c += -fexceptions CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes) diff --git a/inet/Versions b/inet/Versions index 051b305e48..c0c64e1543 100644 --- a/inet/Versions +++ b/inet/Versions @@ -15,8 +15,6 @@ libc { # g* getdomainname; - getprotobyname; getprotobyname_r; getprotobynumber; - getprotobynumber_r; getprotoent; getprotoent_r; getservbyname; getservbyname_r; getservbyport; getservbyport_r; getservent; getservent_r; @@ -48,8 +46,7 @@ libc { # g* getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r; gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r; - getnetent_r; getprotobyname_r; getprotobynumber_r; - getprotoent_r; getservbyname_r; + getnetent_r; getservbyname_r; getservbyport_r; getservent_r; } diff --git a/nss/Makefile b/nss/Makefile index 023a11fa4b..df22d3655c 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -178,6 +178,21 @@ CFLAGS-getnetent.c += -fexceptions CFLAGS-getnetent_r.c += -fexceptions endif +# protocols routines: +routines += \ + getproto \ + getproto_r \ + getprtent \ + getprtent_r \ + getprtname \ + getprtname_r \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-getprtent_r.c += -fexceptions +CFLAGS-getprtent.c += -fexceptions +endif + # pwd routines: routines += \ fgetpwent \ diff --git a/nss/Versions b/nss/Versions index 95219f0fc7..c5de97fb53 100644 --- a/nss/Versions +++ b/nss/Versions @@ -27,6 +27,8 @@ libc { getnetgrent; getnetgrent_r; getnetbyaddr; getnetbyaddr_r; getnetbyname; getnetbyname_r; getnetent; getnetent_r; + getprotobyname; getprotobyname_r; getprotobynumber; + getprotobynumber_r; getprotoent; getprotoent_r; getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; getspent; getspent_r; getspnam; getspnam_r; @@ -58,6 +60,7 @@ libc { # g* getgrent_r; getgrgid_r; getgrnam_r; getnetgrent_r; + getprotobyname_r; getprotobynumber_r; getprotoent_r; getpwent_r; getpwuid_r; getpwnam_r; getspent_r; getspnam_r; } diff --git a/inet/getproto.c b/nss/getproto.c similarity index 100% rename from inet/getproto.c rename to nss/getproto.c diff --git a/inet/getproto_r.c b/nss/getproto_r.c similarity index 100% rename from inet/getproto_r.c rename to nss/getproto_r.c diff --git a/inet/getprtent.c b/nss/getprtent.c similarity index 100% rename from inet/getprtent.c rename to nss/getprtent.c diff --git a/inet/getprtent_r.c b/nss/getprtent_r.c similarity index 100% rename from inet/getprtent_r.c rename to nss/getprtent_r.c diff --git a/inet/getprtname.c b/nss/getprtname.c similarity index 100% rename from inet/getprtname.c rename to nss/getprtname.c diff --git a/inet/getprtname_r.c b/nss/getprtname_r.c similarity index 100% rename from inet/getprtname_r.c rename to nss/getprtname_r.c From patchwork Mon Oct 2 12:55:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76970 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF835394847B for ; Mon, 2 Oct 2023 13:03:48 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 7F2013861876 for ; Mon, 2 Oct 2023 13:02:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F2013861876 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HCSGBvgBP/HeJgwvtSBxFE8xAmWNjR/Ru9N9v9JIFT8=; b=Zuyio9kcMii50EmbwdpAZ3Bt0rHWI/5MNnWHADZX+EzchcKt8ULyLJkvv5HHKB7vZ7Ifyz TX9xu9KBy/51PL4E1SHNszGvKL/szZQJZddJq0AG35HI0locLpQqhc8KJQP5lcfUorGURQ OBxE9bVCfki1RiLJlDoJ2gcay5pQz48= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-bMzoEfuUMXGc1U2oeE_r3g-1; Mon, 02 Oct 2023 09:02:17 -0400 X-MC-Unique: bMzoEfuUMXGc1U2oeE_r3g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F22BE3C176EF for ; Mon, 2 Oct 2023 13:02:16 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 78EEFC154CA; Mon, 2 Oct 2023 13:02:16 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 13/16] Move 'rpc' routines from 'inet' into 'nss' Date: Mon, 2 Oct 2023 14:55:25 +0200 Message-ID: <20231002130150.1497733-14-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The getrpcby* and getrpcent* routines are entry points for nss functionality. This commit moves them from the 'inet' subdirectory to 'nss'. The Versions entries for these routines along with a test, located in the 'sunrpc' subdirectory, are also moved into 'nss'. Reviewed-by: Adhemerval Zanella --- inet/Makefile | 8 -------- nss/Makefile | 16 ++++++++++++++++ nss/Versions | 2 ++ {inet => nss}/getrpcbyname.c | 0 {inet => nss}/getrpcbyname_r.c | 0 {inet => nss}/getrpcbynumber.c | 0 {inet => nss}/getrpcbynumber_r.c | 0 {inet => nss}/getrpcent.c | 0 {inet => nss}/getrpcent_r.c | 0 {sunrpc => nss}/test-rpcent.c | 0 sunrpc/Makefile | 2 +- sunrpc/Versions | 3 +-- 12 files changed, 20 insertions(+), 11 deletions(-) rename {inet => nss}/getrpcbyname.c (100%) rename {inet => nss}/getrpcbyname_r.c (100%) rename {inet => nss}/getrpcbynumber.c (100%) rename {inet => nss}/getrpcbynumber_r.c (100%) rename {inet => nss}/getrpcent.c (100%) rename {inet => nss}/getrpcent_r.c (100%) rename {sunrpc => nss}/test-rpcent.c (100%) diff --git a/inet/Makefile b/inet/Makefile index dab7182a11..3c1987877a 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -48,12 +48,6 @@ routines := \ ether_ntoa_r \ getipv4sourcefilter \ getnameinfo \ - getrpcbyname \ - getrpcbyname_r \ - getrpcbynumber \ - getrpcbynumber_r \ - getrpcent \ - getrpcent_r \ getservent \ getservent_r \ getsourcefilter \ @@ -132,8 +126,6 @@ include ../gen-locales.mk ifeq ($(have-thread-library),yes) CFLAGS-rcmd.c += -fexceptions -CFLAGS-getrpcent_r.c += -fexceptions -CFLAGS-getrpcent.c += -fexceptions CFLAGS-getservent_r.c += -fexceptions CFLAGS-getservent.c += -fexceptions CFLAGS-either_ntoh.c += -fexceptions diff --git a/nss/Makefile b/nss/Makefile index df22d3655c..cbfd5dc692 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -214,6 +214,21 @@ CFLAGS-getpwent.c += -fexceptions CFLAGS-getpwent_r.c += -fexceptions endif +# rpc routines: +routines += \ + getrpcbyname \ + getrpcbyname_r \ + getrpcbynumber \ + getrpcbynumber_r \ + getrpcent \ + getrpcent_r \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-getrpcent_r.c += -fexceptions +CFLAGS-getrpcent.c += -fexceptions +endif + # shadow routines routines += \ fgetspent \ @@ -276,6 +291,7 @@ tests := \ bug17079 \ test-digits-dots \ test-netdb \ + test-rpcent \ testgrp \ tst-fgetsgent_r \ tst-gethnm \ diff --git a/nss/Versions b/nss/Versions index c5de97fb53..b7491154bf 100644 --- a/nss/Versions +++ b/nss/Versions @@ -30,6 +30,8 @@ libc { getprotobyname; getprotobyname_r; getprotobynumber; getprotobynumber_r; getprotoent; getprotoent_r; getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; + getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r; + getrpcent; getrpcent_r; getspent; getspent_r; getspnam; getspnam_r; # i* diff --git a/inet/getrpcbyname.c b/nss/getrpcbyname.c similarity index 100% rename from inet/getrpcbyname.c rename to nss/getrpcbyname.c diff --git a/inet/getrpcbyname_r.c b/nss/getrpcbyname_r.c similarity index 100% rename from inet/getrpcbyname_r.c rename to nss/getrpcbyname_r.c diff --git a/inet/getrpcbynumber.c b/nss/getrpcbynumber.c similarity index 100% rename from inet/getrpcbynumber.c rename to nss/getrpcbynumber.c diff --git a/inet/getrpcbynumber_r.c b/nss/getrpcbynumber_r.c similarity index 100% rename from inet/getrpcbynumber_r.c rename to nss/getrpcbynumber_r.c diff --git a/inet/getrpcent.c b/nss/getrpcent.c similarity index 100% rename from inet/getrpcent.c rename to nss/getrpcent.c diff --git a/inet/getrpcent_r.c b/nss/getrpcent_r.c similarity index 100% rename from inet/getrpcent_r.c rename to nss/getrpcent_r.c diff --git a/sunrpc/test-rpcent.c b/nss/test-rpcent.c similarity index 100% rename from sunrpc/test-rpcent.c rename to nss/test-rpcent.c diff --git a/sunrpc/Makefile b/sunrpc/Makefile index ec2ea04ca9..83a0f2d099 100644 --- a/sunrpc/Makefile +++ b/sunrpc/Makefile @@ -64,7 +64,7 @@ routines := auth_none authuxprot clnt_raw clnt_simp \ shared-only-routines = $(routines) endif -tests = tst-xdrmem tst-xdrmem2 test-rpcent tst-udp-error tst-udp-timeout \ +tests = tst-xdrmem tst-xdrmem2 tst-udp-error tst-udp-timeout \ tst-udp-nonblocking tst-bug22542 tst-bug28768 xtests := tst-getmyaddr diff --git a/sunrpc/Versions b/sunrpc/Versions index 77bc6a4c9b..cba6e36422 100644 --- a/sunrpc/Versions +++ b/sunrpc/Versions @@ -26,8 +26,7 @@ libc { # g* get_myaddress; getpublickey; getsecretkey; - getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r; - getrpcent; getrpcent_r; getrpcport; + getrpcport; # p* pmap_getmaps; pmap_getport; pmap_rmtcall; pmap_set; pmap_unset; From patchwork Mon Oct 2 12:55:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76969 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 653DF3959C96 for ; Mon, 2 Oct 2023 13:03:38 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0E9E238618FE for ; Mon, 2 Oct 2023 13:02:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E9E238618FE Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zRPjwMoKKRG9sSXeuTZJlx07PSHqBN70YBFgrwCpjkk=; b=g/dvXSh6yrl9BimE0ySsnFqJdHLnwh0S5iIyEPunf6wSyr9Lv33GgHoJdMmQJCTMsmbnox aZL7oz6kfeLeouI2bild7qpdItxv0T+CxxqDM5lnvM1EQGE7AaS70pUb5wY3/Cr2Z/3Ow/ 0jkNcLJx0wvW7m9VSURKc88sL8VDTlw= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-209-gcho6J2-Pr-frl--NHxK-w-1; Mon, 02 Oct 2023 09:02:18 -0400 X-MC-Unique: gcho6J2-Pr-frl--NHxK-w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 428043816C8A for ; Mon, 2 Oct 2023 13:02:18 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE482C15BB8; Mon, 2 Oct 2023 13:02:17 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 14/16] Move 'services' routines from 'inet' into 'nss' Date: Mon, 2 Oct 2023 14:55:26 +0200 Message-ID: <20231002130150.1497733-15-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The getservby* and getservent* routines are entry points for nss functionality. This commit moves them from the 'inet' subdirectory to 'nss'. Reviewed-by: Adhemerval Zanella --- inet/Makefile | 8 -------- inet/Versions | 6 +----- nss/Makefile | 15 +++++++++++++++ nss/Versions | 3 +++ {inet => nss}/getservent.c | 0 {inet => nss}/getservent_r.c | 0 {inet => nss}/getsrvbynm.c | 0 {inet => nss}/getsrvbynm_r.c | 0 {inet => nss}/getsrvbypt.c | 0 {inet => nss}/getsrvbypt_r.c | 0 10 files changed, 19 insertions(+), 13 deletions(-) rename {inet => nss}/getservent.c (100%) rename {inet => nss}/getservent_r.c (100%) rename {inet => nss}/getsrvbynm.c (100%) rename {inet => nss}/getsrvbynm_r.c (100%) rename {inet => nss}/getsrvbypt.c (100%) rename {inet => nss}/getsrvbypt_r.c (100%) diff --git a/inet/Makefile b/inet/Makefile index 3c1987877a..d275f51b3f 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -48,13 +48,7 @@ routines := \ ether_ntoa_r \ getipv4sourcefilter \ getnameinfo \ - getservent \ - getservent_r \ getsourcefilter \ - getsrvbynm \ - getsrvbynm_r \ - getsrvbypt \ - getsrvbypt_r \ herrno \ herrno-loc \ htonl \ @@ -126,8 +120,6 @@ include ../gen-locales.mk ifeq ($(have-thread-library),yes) CFLAGS-rcmd.c += -fexceptions -CFLAGS-getservent_r.c += -fexceptions -CFLAGS-getservent.c += -fexceptions CFLAGS-either_ntoh.c += -fexceptions CFLAGS-either_hton.c += -fexceptions CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes) diff --git a/inet/Versions b/inet/Versions index c0c64e1543..7765cb7722 100644 --- a/inet/Versions +++ b/inet/Versions @@ -15,8 +15,6 @@ libc { # g* getdomainname; - getservbyname; getservbyname_r; getservbyport; - getservbyport_r; getservent; getservent_r; # h* htonl; htons; @@ -46,9 +44,7 @@ libc { # g* getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r; gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r; - getnetent_r; getservbyname_r; - getservbyport_r; - getservent_r; + getnetent_r; } GLIBC_2.2 { # i* diff --git a/nss/Makefile b/nss/Makefile index cbfd5dc692..e88754bf51 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -229,6 +229,21 @@ CFLAGS-getrpcent_r.c += -fexceptions CFLAGS-getrpcent.c += -fexceptions endif +# services routines: +routines += \ + getservent \ + getservent_r \ + getsrvbynm \ + getsrvbynm_r \ + getsrvbypt \ + getsrvbypt_r \ + # routines + +ifeq ($(have-thread-library),yes) +CFLAGS-getservent_r.c += -fexceptions +CFLAGS-getservent.c += -fexceptions +endif + # shadow routines routines += \ fgetspent \ diff --git a/nss/Versions b/nss/Versions index b7491154bf..d8c4e373c9 100644 --- a/nss/Versions +++ b/nss/Versions @@ -32,6 +32,8 @@ libc { getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r; getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r; getrpcent; getrpcent_r; + getservbyname; getservbyname_r; getservbyport; + getservbyport_r; getservent; getservent_r; getspent; getspent_r; getspnam; getspnam_r; # i* @@ -64,6 +66,7 @@ libc { getnetgrent_r; getprotobyname_r; getprotobynumber_r; getprotoent_r; getpwent_r; getpwuid_r; getpwnam_r; + getservbyname_r; getservbyport_r; getservent_r; getspent_r; getspnam_r; } GLIBC_2.2.2 { diff --git a/inet/getservent.c b/nss/getservent.c similarity index 100% rename from inet/getservent.c rename to nss/getservent.c diff --git a/inet/getservent_r.c b/nss/getservent_r.c similarity index 100% rename from inet/getservent_r.c rename to nss/getservent_r.c diff --git a/inet/getsrvbynm.c b/nss/getsrvbynm.c similarity index 100% rename from inet/getsrvbynm.c rename to nss/getsrvbynm.c diff --git a/inet/getsrvbynm_r.c b/nss/getsrvbynm_r.c similarity index 100% rename from inet/getsrvbynm_r.c rename to nss/getsrvbynm_r.c diff --git a/inet/getsrvbypt.c b/nss/getsrvbypt.c similarity index 100% rename from inet/getsrvbypt.c rename to nss/getsrvbypt.c diff --git a/inet/getsrvbypt_r.c b/nss/getsrvbypt_r.c similarity index 100% rename from inet/getsrvbypt_r.c rename to nss/getsrvbypt_r.c From patchwork Mon Oct 2 12:55:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76967 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A91F6395203E for ; Mon, 2 Oct 2023 13:03:29 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 931FB386193B for ; Mon, 2 Oct 2023 13:02:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 931FB386193B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RHej7BS9OlikPqaYliY5XjSNrTRch1ew7VHdfb6VHQM=; b=MnNGr+YAr+pOdQWVUzz3T/Zg3B1gGaLv8XncwlvQWqLNoK1zYIxYFdWpi3CBVOZ9uuNKfi AuFVl/GbHv9AGeHZA54f1BBtylHCTmPakcuGR3BuycR6R96l9WgcfUk38N2LS6pMPYHnEF 2PRWtmtOAFcWZ2/7B88sPOFT/OqKqLA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-221-Cq3_Zse4OBKjfWnfWgz6aA-1; Mon, 02 Oct 2023 09:02:19 -0400 X-MC-Unique: Cq3_Zse4OBKjfWnfWgz6aA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 788A429AB452 for ; Mon, 2 Oct 2023 13:02:19 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F361BC15BB8; Mon, 2 Oct 2023 13:02:18 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 15/16] Move getaddrinfo from 'posix' into 'nss' Date: Mon, 2 Oct 2023 14:55:27 +0200 Message-ID: <20231002130150.1497733-16-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org getaddrinfo is an entry point for nss functionality. This commit moves it from 'sysdeps/posix' to 'nss', gets rid of the stub in 'posix', and moves all associated tests as well. Reviewed-by: Adhemerval Zanella --- nss/Makefile | 19 ++++++++++++-- nss/Versions | 1 + {sysdeps/posix => nss}/getaddrinfo.c | 0 {posix => nss}/tst-getaddrinfo.c | 0 {posix => nss}/tst-getaddrinfo2.c | 0 {posix => nss}/tst-getaddrinfo3.c | 0 {posix => nss}/tst-getaddrinfo4.c | 0 {posix => nss}/tst-getaddrinfo5.c | 0 {posix => nss}/tst-rfc3484-2.c | 2 +- {posix => nss}/tst-rfc3484-3.c | 2 +- {posix => nss}/tst-rfc3484.c | 2 +- posix/Makefile | 10 -------- posix/Versions | 2 +- posix/getaddrinfo.c | 38 ---------------------------- 14 files changed, 22 insertions(+), 54 deletions(-) rename {sysdeps/posix => nss}/getaddrinfo.c (100%) rename {posix => nss}/tst-getaddrinfo.c (100%) rename {posix => nss}/tst-getaddrinfo2.c (100%) rename {posix => nss}/tst-getaddrinfo3.c (100%) rename {posix => nss}/tst-getaddrinfo4.c (100%) rename {posix => nss}/tst-getaddrinfo5.c (100%) rename {posix => nss}/tst-rfc3484-2.c (99%) rename {posix => nss}/tst-rfc3484-3.c (98%) rename {posix => nss}/tst-rfc3484.c (98%) delete mode 100644 posix/getaddrinfo.c diff --git a/nss/Makefile b/nss/Makefile index e88754bf51..da5bd207aa 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -127,6 +127,7 @@ endif # hosts routines: routines += \ + getaddrinfo \ gethstbyad \ gethstbyad_r \ gethstbynm \ @@ -138,6 +139,7 @@ routines += \ # routines ifeq ($(have-thread-library),yes) +CFLAGS-getaddrinfo.c += -fexceptions CFLAGS-gethstbyad.c += -fexceptions CFLAGS-gethstbyad_r.c += -fexceptions CFLAGS-gethstbynm.c += -fexceptions @@ -300,7 +302,13 @@ others-extras = $(makedb-modules) extra-objs += $(makedb-modules:=.o) tests-static = tst-field -tests-internal = tst-field + +tests-internal := \ + tst-field \ + tst-rfc3484 \ + tst-rfc3484-2 \ + tst-rfc3484-3 \ + # tests-internal tests := \ bug17079 \ @@ -309,6 +317,9 @@ tests := \ test-rpcent \ testgrp \ tst-fgetsgent_r \ + tst-getaddrinfo \ + tst-getaddrinfo2 \ + tst-getaddrinfo3 \ tst-gethnm \ tst-getpw \ tst-gshadow \ @@ -327,7 +338,11 @@ tests := \ tst-shadow \ # tests -xtests = bug-erange +xtests := \ + bug-erange \ + tst-getaddrinfo4 \ + tst-getaddrinfo5 \ + # xtests tests-container := \ tst-initgroups1 \ diff --git a/nss/Versions b/nss/Versions index d8c4e373c9..158a9175a4 100644 --- a/nss/Versions +++ b/nss/Versions @@ -19,6 +19,7 @@ libc { fgetspent; fgetspent_r; # g* + getaddrinfo; getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r; getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r; getgroups; diff --git a/sysdeps/posix/getaddrinfo.c b/nss/getaddrinfo.c similarity index 100% rename from sysdeps/posix/getaddrinfo.c rename to nss/getaddrinfo.c diff --git a/posix/tst-getaddrinfo.c b/nss/tst-getaddrinfo.c similarity index 100% rename from posix/tst-getaddrinfo.c rename to nss/tst-getaddrinfo.c diff --git a/posix/tst-getaddrinfo2.c b/nss/tst-getaddrinfo2.c similarity index 100% rename from posix/tst-getaddrinfo2.c rename to nss/tst-getaddrinfo2.c diff --git a/posix/tst-getaddrinfo3.c b/nss/tst-getaddrinfo3.c similarity index 100% rename from posix/tst-getaddrinfo3.c rename to nss/tst-getaddrinfo3.c diff --git a/posix/tst-getaddrinfo4.c b/nss/tst-getaddrinfo4.c similarity index 100% rename from posix/tst-getaddrinfo4.c rename to nss/tst-getaddrinfo4.c diff --git a/posix/tst-getaddrinfo5.c b/nss/tst-getaddrinfo5.c similarity index 100% rename from posix/tst-getaddrinfo5.c rename to nss/tst-getaddrinfo5.c diff --git a/posix/tst-rfc3484-2.c b/nss/tst-rfc3484-2.c similarity index 99% rename from posix/tst-rfc3484-2.c rename to nss/tst-rfc3484-2.c index ce8ccd5f38..a5f8f82c04 100644 --- a/posix/tst-rfc3484-2.c +++ b/nss/tst-rfc3484-2.c @@ -57,7 +57,7 @@ _res_hconf_init (void) } #undef USE_NSCD -#include "../sysdeps/posix/getaddrinfo.c" +#include "getaddrinfo.c" nss_action_list __nss_hosts_database attribute_hidden; diff --git a/posix/tst-rfc3484-3.c b/nss/tst-rfc3484-3.c similarity index 98% rename from posix/tst-rfc3484-3.c rename to nss/tst-rfc3484-3.c index ecb163963f..edf0b7db2e 100644 --- a/posix/tst-rfc3484-3.c +++ b/nss/tst-rfc3484-3.c @@ -57,7 +57,7 @@ _res_hconf_init (void) } #undef USE_NSCD -#include "../sysdeps/posix/getaddrinfo.c" +#include "getaddrinfo.c" nss_action_list __nss_hosts_database attribute_hidden; diff --git a/posix/tst-rfc3484.c b/nss/tst-rfc3484.c similarity index 98% rename from posix/tst-rfc3484.c rename to nss/tst-rfc3484.c index 3b2052eb54..5b4a0c5b82 100644 --- a/posix/tst-rfc3484.c +++ b/nss/tst-rfc3484.c @@ -57,7 +57,7 @@ _res_hconf_init (void) } #undef USE_NSCD -#include "../sysdeps/posix/getaddrinfo.c" +#include "getaddrinfo.c" nss_action_list __nss_hosts_database attribute_hidden; diff --git a/posix/Makefile b/posix/Makefile index be7d319394..3ab124d040 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -88,7 +88,6 @@ routines := \ fpathconf \ gai_strerror \ get_child_max \ - getaddrinfo \ getegid \ geteuid \ getgid \ @@ -287,9 +286,6 @@ tests := \ tst-fnmatch7 \ tst-fork \ tst-gai_strerror \ - tst-getaddrinfo \ - tst-getaddrinfo2 \ - tst-getaddrinfo3 \ tst-getopt_long1 \ tst-glob-tilde \ tst-glob_symlinks \ @@ -351,9 +347,6 @@ tests-internal := \ bug-regex5 \ bug-regex20 \ bug-regex33 \ - tst-rfc3484 \ - tst-rfc3484-2 \ - tst-rfc3484-3 \ # tests-internal tests-container := \ @@ -368,8 +361,6 @@ tests-time64 := \ # tests-time64 xtests := \ - tst-getaddrinfo4 \ - tst-getaddrinfo5 \ tst-sched_rr_get_interval \ # xtests @@ -556,7 +547,6 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make '$(config-machine)-$(config-vendor)' > $@.new mv -f $@.new $@ -CFLAGS-getaddrinfo.c += -fexceptions CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes) diff --git a/posix/Versions b/posix/Versions index 2eedbc3e79..b24c7c87ff 100644 --- a/posix/Versions +++ b/posix/Versions @@ -34,7 +34,7 @@ libc { fnmatch; fork; fpathconf; freeaddrinfo; # g* - getaddrinfo; getdtablesize; getegid; geteuid; getgid; getopt; getopt_long; + getdtablesize; getegid; geteuid; getgid; getopt; getopt_long; getopt_long_only; getpgid; getpgrp; getpid; getppid; getsid; getuid; glob; glob_pattern_p; globfree; group_member; diff --git a/posix/getaddrinfo.c b/posix/getaddrinfo.c deleted file mode 100644 index 0e36a4564c..0000000000 --- a/posix/getaddrinfo.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Stub version of getaddrinfo function. - Copyright (C) 1996-2023 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - -int -getaddrinfo (const char *name, const char *service, const struct addrinfo *req, - struct addrinfo **pai) -{ - __set_errno (ENOSYS); - return EAI_SYSTEM; -} -stub_warning (getaddrinfo) -libc_hidden_def (getaddrinfo) - -void -freeaddrinfo (struct addrinfo *ai) -{ - /* Nothing. */ -} -stub_warning (freeaddrinfo) -libc_hidden_def (freeaddrinfo) From patchwork Mon Oct 2 12:55:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 76972 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BCE1138245A6 for ; Mon, 2 Oct 2023 13:04:14 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 9D22D385CCBA for ; Mon, 2 Oct 2023 13:02:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D22D385CCBA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696251742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n1+2MoigsqYlfLSFR2t5I+lE/YpUDvX/IZx5i1zrCKU=; b=VD/EgpDJ9S2sf/XSLwd8xbBuXj3fQeFhxmcPzWPkkn+bfCg6VnxpIp27LQ2CiSOtDXTm13 NRZCvb2lGiPztpuPd683jngcALDn0nU0svqImFfQpkwYWTjpiTvGGOO5bX5cOD8glncsEo ezmszq8+rwxeJyDqj4zyELAnbvvihOI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-287-Y1PJz_hTNhG8KUW6GH3rsA-1; Mon, 02 Oct 2023 09:02:21 -0400 X-MC-Unique: Y1PJz_hTNhG8KUW6GH3rsA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EEF4D29AB448 for ; Mon, 2 Oct 2023 13:02:20 +0000 (UTC) Received: from localhost.localdomain (dhcp129-93.brq.redhat.com [10.34.129.93]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 773DBC15BB8; Mon, 2 Oct 2023 13:02:20 +0000 (UTC) From: Arjun Shankar To: libc-alpha@sourceware.org, Arjun Shankar Subject: [PATCH 16/16] Move getnameinfo from 'inet' to 'nss' Date: Mon, 2 Oct 2023 14:55:28 +0200 Message-ID: <20231002130150.1497733-17-arjun@redhat.com> In-Reply-To: <20231002130150.1497733-1-arjun@redhat.com> References: <20231002130150.1497733-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org getnameinfo is an entry points for nss functionality. This commit moves it from the 'inet' subdirectory to 'nss'. The corresponding Versions entry is also moved from 'posix' into 'nss'. Reviewed-by: Adhemerval Zanella --- inet/Makefile | 1 - nss/Makefile | 1 + nss/Versions | 3 +++ {inet => nss}/getnameinfo.c | 2 +- posix/Versions | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) rename {inet => nss}/getnameinfo.c (99%) diff --git a/inet/Makefile b/inet/Makefile index d275f51b3f..b691fef921 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -47,7 +47,6 @@ routines := \ ether_ntoa \ ether_ntoa_r \ getipv4sourcefilter \ - getnameinfo \ getsourcefilter \ herrno \ herrno-loc \ diff --git a/nss/Makefile b/nss/Makefile index da5bd207aa..213b68720b 100644 --- a/nss/Makefile +++ b/nss/Makefile @@ -136,6 +136,7 @@ routines += \ gethstbynm_r \ gethstent \ gethstent_r \ + getnameinfo \ # routines ifeq ($(have-thread-library),yes) diff --git a/nss/Versions b/nss/Versions index 158a9175a4..d765e1d3b6 100644 --- a/nss/Versions +++ b/nss/Versions @@ -58,6 +58,9 @@ libc { ulckpwdf; } GLIBC_2.1 { + # g* + getnameinfo; + # p* putgrent; } diff --git a/inet/getnameinfo.c b/nss/getnameinfo.c similarity index 99% rename from inet/getnameinfo.c rename to nss/getnameinfo.c index 40c20b4be6..062652c229 100644 --- a/inet/getnameinfo.c +++ b/nss/getnameinfo.c @@ -71,7 +71,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include +#include #include #ifndef min diff --git a/posix/Versions b/posix/Versions index b24c7c87ff..0624d24bcc 100644 --- a/posix/Versions +++ b/posix/Versions @@ -72,7 +72,7 @@ libc { __pread64; __pwrite64; # g* - gai_strerror; getnameinfo; glob64; globfree64; + gai_strerror; glob64; globfree64; # p* pread; pread64; pwrite; pwrite64;