From patchwork Mon Jun 7 17:37:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 43742 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 6FECD3938C3A for ; Mon, 7 Jun 2021 17:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6FECD3938C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623087540; bh=d08v1kX+tX7xv1WkQcBnXxSXX1/UKBj68q/JSZ2BVBc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=PSEUrTbHhuISkB5qTXp0XfsSqUrU7DhHm/9EcmuoZJzOQjs61i/8PRggDmjOUnRG+ zkjJzRWkVxiijDZhT0XDvetDTC4hnNvvDJPXwcx7iW5jr8Pp49kWrrMXTdl1KWTdzs cGWh/C4xBLzGzcDiFGl7zkbv0g87oaOdbzKvkQ44= 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 ESMTP id 9A78D393BC1A for ; Mon, 7 Jun 2021 17:38:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A78D393BC1A Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-20-EBYPftBwNnOysMK7lFIzkQ-1; Mon, 07 Jun 2021 13:38:01 -0400 X-MC-Unique: EBYPftBwNnOysMK7lFIzkQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76F8D188E3CC for ; Mon, 7 Jun 2021 17:37:59 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC2C75D6D3 for ; Mon, 7 Jun 2021 17:37:58 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 0/8] Move nss_files into libc X-From-Line: 54b3b560dbb5fd8e9b5d61c347c4300ceed7659e Mon Sep 17 00:00:00 2001 Message-Id: Date: Mon, 07 Jun 2021 19:37:56 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" I plan to use this to tackle the --enable-static-nss regression in glibc 2.33. I plan to move nss_dns into libc as well, and then we can add a library with dlopen stubs that blocks all dlopen calls. If a programmer wants to build a truly static binary, they can link with -lglibc-nodlopen (or something like that), and the behavior will be as if glibc was configured with --enable-static-nss. Tested on i686-linux-gnu and x86_64-linux-gnu. Built using build-many-glibcs.py. Thanks, Florian Florian Weimer (8): nss: Fix NSS_DECLARE_MODULE_FUNCTIONS handling of _nss_*_endnetgrent inet: Add hidden prototype for __inet_network libio: Add hidden prototype for ungetc libio: Replace internal _IO_getdelim symbol with __getdelim nss_files: Allocate nscd file registration data on the heap nss_files: Add generic code for set*ent, end*ent and file open nss_files: Move into libc nss: Access nss_files through direct references iconv/gconv_conf.c | 4 - include/arpa/inet.h | 2 + include/libc-symbols.h | 23 ---- include/netdb.h | 2 +- include/nss_files.h | 80 +++++++++++- include/stdio.h | 2 + inet/inet_net.c | 4 +- libio/iogetdelim.c | 7 +- libio/ioungetc.c | 6 +- libio/libioP.h | 1 - nss/Makefile | 14 +-- nss/Versions | 17 ++- nss/nss.h | 2 +- nss/nss_files/files-XXX.c | 73 +++-------- nss/nss_files/files-alias.c | 86 ++++--------- nss/nss_files/files-ethers.c | 2 - nss/nss_files/files-grp.c | 2 - nss/nss_files/files-hosts.c | 17 +-- nss/nss_files/files-init.c | 58 ++++----- nss/nss_files/files-initgroups.c | 3 +- nss/nss_files/files-netgrp.c | 11 +- nss/nss_files/files-network.c | 4 +- nss/nss_files/files-parse.c | 8 +- nss/nss_files/files-proto.c | 2 - nss/nss_files/files-pwd.c | 2 - nss/nss_files/files-rpc.c | 2 - nss/nss_files/files-service.c | 2 - nss/nss_files/files-sgrp.c | 2 - nss/nss_files/files-spwd.c | 2 - nss/nss_files_data.c | 159 ++++++++++++++++++++++++ nss/nss_files_functions.c | 43 +++++++ nss/nss_module.c | 38 +++++- nss/nss_module.h | 4 + nss/nss_readline.c | 4 +- stdio-common/getline.c | 2 +- sysdeps/unix/sysv/linux/readonly-area.c | 2 +- 36 files changed, 440 insertions(+), 252 deletions(-) create mode 100644 nss/nss_files_data.c create mode 100644 nss/nss_files_functions.c