From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7088 Path: news.gmane.org!not-for-mail From: Josiah Worcester Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] support alternate backends for the passwd and group dbs Date: Mon, 23 Feb 2015 00:24:11 -0600 Message-ID: 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: multipart/alternative; boundary=047d7b5d341e526c25050fbb739a X-Trace: ger.gmane.org 1424672672 613 80.91.229.3 (23 Feb 2015 06:24:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2015 06:24:32 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7101-gllmg-musl=m.gmane.org@lists.openwall.com Mon Feb 23 07:24:32 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 1YPmRR-0003JN-Fh for gllmg-musl@m.gmane.org; Mon, 23 Feb 2015 07:24:29 +0100 Original-Received: (qmail 15943 invoked by uid 550); 23 Feb 2015 06:24:27 -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 15893 invoked from network); 23 Feb 2015 06:24:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=5XRQ97YN4TWR3r7s3ENHhU2DcJ8WksXRwvmlNSh0Ufk=; b=CSsFrjs0ldCZSICCBsMNwb5jWuVgSDCTUeb7+beNbyuL+Wb0nsrKJSoEGbgnGOEgbA 3XBO5DhOgtOtkK01rcL6JX5tcrk0u7xdWPNJrE/B508ZVu2HmPMwNtzAHlT1K4S+0RPc kTUH4p4rMtW/mgRghH5QW2JeCyQ7QuNoARSMxqKYp3tUR81xddH5d2lw6ehNNi4uwm0P DFqprTjO9XvP5kEA21KKdi9XrQZzuk56ICHTBt0/kNiZZO3GrizlTnIasgWPPdx5Jvle QpWBa/Q2cTXwdz/82KKzKKEOvC07SgpM801URPepuTFCai4Ezip9ScL2FU9q8cxCQgwT MFpg== X-Received: by 10.60.145.212 with SMTP id sw20mr6443853oeb.39.1424672651634; Sun, 22 Feb 2015 22:24:11 -0800 (PST) In-Reply-To: <20150223061843.GA8602@openwall.com> Xref: news.gmane.org gmane.linux.lib.musl.general:7088 Archived-At: --047d7b5d341e526c25050fbb739a Content-Type: text/plain; charset=UTF-8 On Feb 23, 2015 12:18 AM, "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? > > Alexander Yes, musl is intentionally repurposing it. By using it as an extra place to look it is much harder to create a situation where getpwuid et al change their results because of an inability to talk to the daemon. Additionally, musl's normal path is file lookup, which should not be slow (and hence has no need for a cache). And of course, by reusing the protocol, musl gets compatibility with the backends configured on glibc systems for free. --047d7b5d341e526c25050fbb739a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Feb 23, 2015 12:18 AM, "Solar Designer" <solar@openwall.com> 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 file= s,=C2=A0 we
> > > query a server over a Unix domain socket on /var/run/nscd/so= cket.
> > > the protocol used here is compatible with glibc's nscd p= rotocol on
> > > most systems (all that use 32-bit numbers for all the protoc= ol fields,
> > > which appears to be everything but Alpha).
> >
> > I'm committing with the attached additional changes [...]
>
> Hmm.=C2=A0 I guess this was discussed before, but I am surprised.=C2= =A0 Wasn't
> nscd intended for caching rather than to provide a fallback?=C2=A0 If = so,
> does musl intentionally re-purpose it?
>
> Alexander

Yes, musl is intentionally repurposing it. By using it as an= extra place to look it is much harder to create a situation where getpwuid= et al change their results because of an inability to talk to the daemon. = Additionally, musl's normal path is file lookup, which should not be sl= ow (and hence has no need for a cache).

And of course, by reusing the protocol, musl gets compatibil= ity with the backends configured on glibc systems for free.

--047d7b5d341e526c25050fbb739a--