Message ID | xnr1u34wqu.fsf@greed.delorie.com |
---|---|
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> 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 3FD05388A808; Thu, 25 Jun 2020 04:04:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FD05388A808 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1593057857; bh=qC8ZiOWdxiZtu6HPGx/lUWivd5WBYXU4AsS3DJTl8bg=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=w/0FmVyqFLEd/U802jAQ99jyJBsFFBwTgmcmkIg5neRNUeE4JfjXiTmNf8A2cNPhr wmcNKt0nUh1oDPQUxWd3KBCY0BLZER621oRjimnaokT91XH+tHYBr7irfe2hm3E2RA SmiQVYA7Rbn09FaBD4Qy8iSlZn6mnWLpmR25dzYo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id F1E783887019 for <libc-alpha@sourceware.org>; Thu, 25 Jun 2020 04:04:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F1E783887019 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-460-OiyehtJUNfu0-KzTb5df5Q-1; Thu, 25 Jun 2020 00:04:11 -0400 X-MC-Unique: OiyehtJUNfu0-KzTb5df5Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C732610059A1 for <libc-alpha@sourceware.org>; Thu, 25 Jun 2020 04:04:10 +0000 (UTC) Received: from greed.delorie.com (ovpn-112-186.phx2.redhat.com [10.3.112.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D4C92B4B5 for <libc-alpha@sourceware.org>; Thu, 25 Jun 2020 04:04:10 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.14.7/8.14.7) with ESMTP id 05P449sd023183 for <libc-alpha@sourceware.org>; Thu, 25 Jun 2020 00:04:09 -0400 Date: Thu, 25 Jun 2020 00:04:09 -0400 Message-Id: <xnr1u34wqu.fsf@greed.delorie.com> To: libc-alpha@sourceware.org Subject: [PATCH 0/4] nsswitch.conf reloading refactoring X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, 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 <libc-alpha.sourceware.org> List-Unsubscribe: <http://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <http://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: DJ Delorie via Libc-alpha <libc-alpha@sourceware.org> Reply-To: DJ Delorie <dj@redhat.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series | nsswitch.conf reloading refactoring | |
Message
DJ Delorie
June 25, 2020, 4:04 a.m. UTC
The purpose of this sequence of patches is to allow /etc/nsswitch.conf to be dynamically reloaded if it changes while a process is running. Previously, nsswitch.conf is loaded once at first use, but long running programs and highly mobile devices have caused a need for a more dynamic approach. The work was done by Florian and I, and I've kept our work separate. Florian wrote new implementations of the internal datastructures and parsers (patches 0001 through 0003), and I did the integration of those into the rest of the system (patch 0004). The general idea is that there's a cache of "action lists" which correspond to the portion of nsswitch.conf after the ":". There's an array of the current action lists indexed by database (i.e. "passwd" or "hosts") which points into the cache. The action list refers to a list of loaded service modules, which have all needed ABI functions pre-loaded. Since all the data is loaded once and never changed (since it's cached), it becomes read-only after load, so no atomics are required outside of the load code. The rename of "service_user" to "action_list" was intentional, to ensure that all use cases were looked at during the conversion. Tested on x86-64. Also ran some manual tests which did "gethostname" while nsswitch changed between hosts and dns. Also tested nscd similarly. Version 1 :-) [PATCH 1/4] nss: Introduce <nss_module.h> Florian Weimer <fweimer@redhat.com> nss_module handles all dynamically loadable service modules and their entry points. [PATCH 2/4] <nss_action.h>: New abstraction for combining NSS modules Florian Weimer <fweimer@redhat.com> nss_action handles the cache of action lists and action parsing. [PATCH 3/4] nss: Implement <nss_database.h> Florian Weimer <fweimer@redhat.com> nss_database controls overall reloading and stores the list of currently active action lists for each service. [PATCH 4/4] nsswitch: use new internal API DJ Delorie <dj@redhat.com> Removing the old (now unneeded) core code, integrating all users of the core code, and adding some remaining core functionality.
Comments
On 6/25/20 12:04 AM, DJ Delorie via Libc-alpha wrote: > > The purpose of this sequence of patches is to allow /etc/nsswitch.conf > to be dynamically reloaded if it changes while a process is running. > Previously, nsswitch.conf is loaded once at first use, but long > running programs and highly mobile devices have caused a need for a > more dynamic approach. > > The work was done by Florian and I, and I've kept our work separate. > Florian wrote new implementations of the internal datastructures and > parsers (patches 0001 through 0003), and I did the integration of > those into the rest of the system (patch 0004). > > The general idea is that there's a cache of "action lists" which > correspond to the portion of nsswitch.conf after the ":". There's an > array of the current action lists indexed by database (i.e. "passwd" > or "hosts") which points into the cache. The action list refers to a > list of loaded service modules, which have all needed ABI functions > pre-loaded. > > Since all the data is loaded once and never changed (since it's > cached), it becomes read-only after load, so no atomics are required > outside of the load code. > > The rename of "service_user" to "action_list" was intentional, to > ensure that all use cases were looked at during the conversion. > > Tested on x86-64. Also ran some manual tests which did "gethostname" > while nsswitch changed between hosts and dns. Also tested nscd > similarly. > > Version 1 :-) > > [PATCH 1/4] nss: Introduce <nss_module.h> > Florian Weimer <fweimer@redhat.com> > > nss_module handles all dynamically loadable service modules and > their entry points. > > [PATCH 2/4] <nss_action.h>: New abstraction for combining NSS modules > Florian Weimer <fweimer@redhat.com> > > nss_action handles the cache of action lists and action parsing. > > [PATCH 3/4] nss: Implement <nss_database.h> > Florian Weimer <fweimer@redhat.com> > > nss_database controls overall reloading and stores the list of > currently active action lists for each service. > > [PATCH 4/4] nsswitch: use new internal API > DJ Delorie <dj@redhat.com> > > Removing the old (now unneeded) core code, integrating all users of > the core code, and adding some remaining core functionality. Thanks for taking this project on and making glibc more dynamic in this regard with IdM data sources.