From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7089 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] support alternate backends for the passwd and group dbs Date: Mon, 23 Feb 2015 02:04:43 -0500 Message-ID: <20150223070443.GC23507@brightrain.aerifal.cx> References: <1424658940-16635-1-git-send-email-josiahw@gmail.com> <1424660290-25921-1-git-send-email-josiahw@gmail.com> <20150223060840.GB23507@brightrain.aerifal.cx> <20150223061843.GA8602@openwall.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1424675107 3190 80.91.229.3 (23 Feb 2015 07:05:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2015 07:05:07 +0000 (UTC) Cc: musl@lists.openwall.com To: Solar Designer Original-X-From: musl-return-7102-gllmg-musl=m.gmane.org@lists.openwall.com Mon Feb 23 08:05:06 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YPn4k-0004PU-E9 for gllmg-musl@m.gmane.org; Mon, 23 Feb 2015 08:05:06 +0100 Original-Received: (qmail 8055 invoked by uid 550); 23 Feb 2015 07:05:04 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7984 invoked from network); 23 Feb 2015 07:04:55 -0000 Content-Disposition: inline In-Reply-To: <20150223061843.GA8602@openwall.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7089 Archived-At: On Mon, Feb 23, 2015 at 09:18:43AM +0300, Solar Designer wrote: > On Mon, Feb 23, 2015 at 01:08:40AM -0500, Rich Felker wrote: > > On Sun, Feb 22, 2015 at 08:58:10PM -0600, Josiah Worcester wrote: > > > when we fail to find the entry in the commonly accepted files, we > > > query a server over a Unix domain socket on /var/run/nscd/socket. > > > the protocol used here is compatible with glibc's nscd protocol on > > > most systems (all that use 32-bit numbers for all the protocol fields, > > > which appears to be everything but Alpha). > > > > I'm committing with the attached additional changes [...] > > Hmm. I guess this was discussed before, but I am surprised. Wasn't > nscd intended for caching rather than to provide a fallback? If so, > does musl intentionally re-purpose it? There were multiple discussions of how to support alternate backends in the past, and the main two candidates were a new text-based protocol over a unix socket that returns the result in passwd/group file form, and repurposing nscd protocol. While I originally preferred the former, using nscd has the advantage that, on existing glibc systems with non-default (possibly even custom nss modules) backends, everything works out of the box. Using a new protocol/new daemon would require installing that daemon before any musl-linked binaries could lookup users/groups, and would require significant custom glue to integrate with custom site-local backends. The intended usage for musl binaries running on glibc systems is to use whatever nscd is already running. Systems with a network-based user/group db backend should already be running nscd; if not it's easy to add. Systems just using passwd/group files don't need it anyway. For musl-native systems, the user is intended to have some choice. The options should eventually include at least: 1. A featureful generic nscd implementation that uses one or more nss modules (optionally static linked into the daemon or dynamically loaded) as its backend(s). 2. A simple nscd implementation that just does NIS and LDAP. At this time neither exists, but it's possible to use glibc nscd if really needed. Rich