Bug 509949 - nscd rexecs itself changing the proc name to exe (by failing to follow the /proc/PID/exe symlink)
Summary: nscd rexecs itself changing the proc name to exe (by failing to follow the /p...
Keywords:
Status: CLOSED DUPLICATE of bug 490010
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-07 05:51 UTC by Matteo Corti
Modified: 2009-07-07 08:20 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-07 08:20:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Matteo Corti 2009-07-07 05:51:50 UTC
Description of problem:

nscd performs 

  /* The preparations are done.  */
  execv ("/proc/self/exe", argv);

in connections.c without following the symlink and renaming itself to 'exe'.

Version-Release number of selected component (if applicable):

nscd-2.5-34

How reproducible:

always

Steps to Reproduce:
1. start nscd
  
Actual results:

nscd renames itself to 'exe'

Expected results:

nscd does not rename itself to 'exe' (as on Fedora 11)


Additional info:

A correct behaviour is found for example in nscd-2.10.1-2 on Fedora 11:

  /* The preparations are done.  */
#ifdef PATH_MAX
  char pathbuf[PATH_MAX];
#else
  char pathbuf[256];
#endif
  /* Try to exec the real nscd program so the process name (as reported
     in /proc/PID/status) will be 'nscd', but fall back to /proc/self/exe
     if readlink fails */
  ssize_t n = readlink ("/proc/self/exe", pathbuf, sizeof (pathbuf) - 1);
  if (n == -1)
    execv ("/proc/self/exe", argv);
  else
    {
      pathbuf[n] = '\0';
      execv (pathbuf, argv);
    }

Comment 1 Jakub Jelinek 2009-07-07 08:20:28 UTC

*** This bug has been marked as a duplicate of bug 490010 ***


Note You need to log in before you can comment on or make changes to this bug.