This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix for crash in NSS when libc built with--enable-static-nss and exe built with -static
- From: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Date: Tue, 3 Apr 2012 09:23:01 +0530
- Subject: Re: [patch] Fix for crash in NSS when libc built with--enable-static-nss and exe built with -static
- References: <20120304192904.090C119096D@elbrus2.mtv.corp.google.com><Pine.LNX.4.64.1203181352390.10325@digraph.polyomino.org.uk><CALoOobNpkmwsih14nuzL+reyjZAk-JsR7MRpyxCNQcg+gRP7Tg@mail.gmail.com><CALoOobNm4Hpec_7FRYeR-97Bc1f3z4myCXzKRPx=ExH_Wk8Ktw@mail.gmail.com>
On Mon, Apr 2, 2012 at 11:08 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> @@ -457,12 +457,12 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
> # include "function.def"
> { NULL, NULL }
> };
> - size_t namlen = (5 + strlen (ni->library->name) + 1
> + size_t namlen = (5 + strlen (ni->name) + 1
> + strlen (fct_name) + 1);
> char name[namlen];
>
> /* Construct the function name. */
> - __stpcpy (__stpcpy (__stpcpy (name, ni->library->name),
> + __stpcpy (__stpcpy (__stpcpy (name, ni->name),
> "_"),
> fct_name);
This is the only bit that is needed since the rest of the changes
within SHARED and will not be built with --enable-static-nss.
Technically it doesn't make a difference however, since the
pre-requisite for a service library being loaded for a service user is
that the names match.
--
Siddhesh Poyarekar
http://siddhesh.in