From 351fe9477007a45df62eaafe7ae8adc5cd1d0e0e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 22 Nov 2009 19:07:52 -0800 Subject: [PATCH] Try harder to re-exec nscd in paranoia mode. --- ChangeLog | 2 ++ nscd/connections.c | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a73351..337af67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-11-22 Ulrich Drepper + * nscd/connections.c (restart): Try harder to re-exec. + * sunrpc/create_xid.c (_create_xid): Reinitialize state after fork. * sysdeps/unix/sysv/linux/ntp_gettimex.c: New file. diff --git a/nscd/connections.c b/nscd/connections.c index ca73393..69f6533 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"), -- 2.7.4