Try harder to re-exec nscd in paranoia mode.

This commit is contained in:
Ulrich Drepper 2009-11-22 19:07:52 -08:00
parent 57a299fe47
commit 351fe94770
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,7 @@
2009-11-22 Ulrich Drepper <drepper@redhat.com> 2009-11-22 Ulrich Drepper <drepper@redhat.com>
* nscd/connections.c (restart): Try harder to re-exec.
* sunrpc/create_xid.c (_create_xid): Reinitialize state after fork. * sunrpc/create_xid.c (_create_xid): Reinitialize state after fork.
* sysdeps/unix/sysv/linux/ntp_gettimex.c: New file. * sysdeps/unix/sysv/linux/ntp_gettimex.c: New file.

View File

@ -1426,15 +1426,14 @@ cannot change to old working directory: %s; disabling paranoia mode"),
#endif #endif
/* Try to exec the real nscd program so the process name (as reported /* 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 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); ssize_t n = readlink ("/proc/self/exe", pathbuf, sizeof (pathbuf) - 1);
if (n == -1) if (n != -1)
execv ("/proc/self/exe", argv);
else
{ {
pathbuf[n] = '\0'; pathbuf[n] = '\0';
execv (pathbuf, argv); execv (pathbuf, argv);
} }
execv ("/proc/self/exe", argv);
/* If we come here, we will never be able to re-exec. */ /* If we come here, we will never be able to re-exec. */
dbg_log (_("re-exec failed: %s; disabling paranoia mode"), dbg_log (_("re-exec failed: %s; disabling paranoia mode"),