summaryrefslogtreecommitdiff
path: root/nscd/nscd.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-10-04 08:56:18 +0000
committerJakub Jelinek <jakub@redhat.com>2004-10-04 08:56:18 +0000
commit85148842d401edf64f9edee7e5819a947c289ed2 (patch)
tree42f228e998070f60c3bdb2018c9921b221a6851b /nscd/nscd.c
parent6d96590587deec027c04fe576f11cff0f445eb32 (diff)
Updated to fedora-glibc-20041004T0747cvs/fedora-glibc-2_3_3-64
Diffstat (limited to 'nscd/nscd.c')
-rw-r--r--nscd/nscd.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/nscd/nscd.c b/nscd/nscd.c
index 2a4cb2291d..15a7ea2530 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -79,6 +79,13 @@ time_t start_time;
uintptr_t pagesize_m1;
+int paranoia;
+time_t restart_time;
+time_t restart_interval = RESTART_INTERVAL;
+const char *oldcwd;
+uid_t old_uid;
+gid_t old_gid;
+
static int check_pid (const char *file);
static int write_pid (const char *file);
@@ -255,6 +262,9 @@ main (int argc, char **argv)
signal (SIGTTIN, SIG_IGN);
signal (SIGTSTP, SIG_IGN);
}
+ else
+ /* In foreground mode we are not paranoid. */
+ paranoia = 0;
/* Start the SELinux AVC. */
if (selinux_enabled)
@@ -422,6 +432,7 @@ nscd_open_socket (void)
return sock;
}
+
/* Cleanup. */
void
termination_handler (int signum)
@@ -469,7 +480,11 @@ check_pid (const char *file)
n = fscanf (fp, "%d", &pid);
fclose (fp);
- if (n != 1 || kill (pid, 0) == 0)
+ /* If we cannot parse the file default to assuming nscd runs.
+ If the PID is alive, assume it is running. That all unless
+ the PID is the same as the current process' since tha latter
+ can mean we re-exec. */
+ if ((n != 1 || kill (pid, 0) == 0) && pid != getpid ())
return 1;
}