This is the mail archive of the
mailing list for the glibc project.
Re: nscd paranoia mode restart functionality
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 25 Feb 2015 14:43:35 +0100
- Subject: Re: nscd paranoia mode restart functionality
- Authentication-results: sourceware.org; auth=none
- References: <54EDC3FB dot 6040007 at redhat dot com>
On 02/25/2015 01:45 PM, Florian Weimer wrote:
> Does anybody know what's going on in the restart function in
> /* First determine the parameters. We do not use the parameters
> passed to main() since in case nscd is started by running the
> dynamic linker this will not work. Yes, this is not the usual
> case but nscd is part of glibc and we occasionally do this. */
> size_t buflen = 1024;
> char *buf = alloca (buflen);
> size_t readlen = 0;
> int fd = open ("/proc/self/cmdline", O_RDONLY);
> /* Parse the command line. Worst case scenario: every two
> characters form one parameter (one character plus NUL). */
> char **argv = alloca ((readlen / 2 + 1) * sizeof (argv));
> int argc = 0;
What the comment tries to say is this: Without this logic, the
reinvocation will run without the wrapper.
I wonder how this logic interferes with valgrind and similar tools.
> Can we get rid of the code instead pass around the argv vector?
Question still remains.
Florian Weimer / Red Hat Product Security