diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-03-20 20:00:20 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2009-03-20 20:00:20 +0000 |
commit | ef860a878bf532436a469fc1f89fe3366862a949 (patch) | |
tree | c4a2666ac77cdaa00f41bd8f66a828b39e2642ff /nscd | |
parent | d4c583b4466962a9d9d4ca54ab6108dc7b42cdcc (diff) | |
download | glibc-ef860a878bf532436a469fc1f89fe3366862a949.tar glibc-ef860a878bf532436a469fc1f89fe3366862a949.tar.gz glibc-ef860a878bf532436a469fc1f89fe3366862a949.tar.bz2 glibc-ef860a878bf532436a469fc1f89fe3366862a949.zip |
Updated to fedora-glibc-20090320T1944cvs/fedora-glibc-2_9_90-11
Diffstat (limited to 'nscd')
-rw-r--r-- | nscd/connections.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/nscd/connections.c b/nscd/connections.c index 3d0727f33b..234e289f00 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -1418,7 +1418,22 @@ cannot change to old working directory: %s; disabling paranoia mode"), } /* The preparations are done. */ - execv ("/proc/self/exe", argv); +#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); + } /* If we come here, we will never be able to re-exec. */ dbg_log (_("re-exec failed: %s; disabling paranoia mode"), |