nscd paranoia mode restart functionality

Florian Weimer fweimer@redhat.com
Wed Feb 25 12:45:00 GMT 2015


Does anybody know what's going on in the restart function in
nscd/connections.c?

  /* 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[0]));
  int argc = 0;

Can we get rid of the code instead pass around the argv vector?

-- 
Florian Weimer / Red Hat Product Security



More information about the Libc-alpha mailing list