about summary refs log tree commit diff
path: root/nscd/connections.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-11-22 19:07:52 -0800
committerUlrich Drepper <drepper@redhat.com>2009-11-22 19:07:52 -0800
commit351fe9477007a45df62eaafe7ae8adc5cd1d0e0e (patch)
treeea035529ff845affaf1ab53f6b43429fb45581d6 /nscd/connections.c
parent57a299fe4757e50e70fe8c96a357293e7fa0db53 (diff)
downloadglibc-351fe9477007a45df62eaafe7ae8adc5cd1d0e0e.tar.gz
glibc-351fe9477007a45df62eaafe7ae8adc5cd1d0e0e.tar.xz
glibc-351fe9477007a45df62eaafe7ae8adc5cd1d0e0e.zip
Try harder to re-exec nscd in paranoia mode.
Diffstat (limited to 'nscd/connections.c')
-rw-r--r--nscd/connections.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/nscd/connections.c b/nscd/connections.c
index ca73393f40..69f6533a32 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -1426,15 +1426,14 @@ cannot change to old working directory: %s; disabling paranoia mode"),
 #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 */
+     if readlink or the exec with the result of the readlink call fails.  */
   ssize_t n = readlink ("/proc/self/exe", pathbuf, sizeof (pathbuf) - 1);
-  if (n == -1)
-    execv ("/proc/self/exe", argv);
-  else
+  if (n != -1)
     {
       pathbuf[n] = '\0';
       execv (pathbuf, argv);
     }
+  execv ("/proc/self/exe", argv);
 
   /* If we come here, we will never be able to re-exec.  */
   dbg_log (_("re-exec failed: %s; disabling paranoia mode"),