Bug 509949

Summary: nscd rexecs itself changing the proc name to exe (by failing to follow the /proc/PID/exe symlink)
Product: Red Hat Enterprise Linux 5 Reporter: Matteo Corti <matteo>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-07 08:20:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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 ***