diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-10-03 19:33:48 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-10-03 19:33:48 +0000 |
commit | 4401d759051714fcc016a146685f3c13bed49442 (patch) | |
tree | fb2a02b91616e460a2b1fcd6eb482a0b3db9d860 /nscd/nscd.h | |
parent | fc03df7aa6d9de00d09ddaf9c27074fb4ea6d3ef (diff) | |
download | glibc-4401d759051714fcc016a146685f3c13bed49442.tar.gz |
Update.
Implement paranoia mode.
* nscd/connections.c (nscd_init): Mark database and socket descriptors
as close on exec.
(restart): New function.
(restart_p): New function.
(nscd_run): Add missing descrement of nready in case readylist is
empty.
(main_loop_poll): Call restart_p and restart.
(main_loop_epoll): Likewise.
(begin_drop_privileges): Save original UID and GID.
* nscd/nscd.c: Define new variables paranoia, restart_time,
restart_interval, oldcwd, old_gid, old_uid.
(main): Disable paranoia mode if we are not forking.
(check_pid): When re-execing, the PID file contains the same PID as
the current process. Do not fail in this case.
* nscd/nscd.conf: Add paranoia and restart-interval entries.
* nscd/nscd.h: Define RESTART_INTERVAL. Declare new variables.
* nscd/nscd_conf.c: Parse paranoia and restart-internal configurations.
* nscd/nscd_stat.c: Print paranoia and restart-internal values.
Diffstat (limited to 'nscd/nscd.h')
-rw-r--r-- | nscd/nscd.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/nscd/nscd.h b/nscd/nscd.h index 3a9660d3ec..56073ebd0c 100644 --- a/nscd/nscd.h +++ b/nscd/nscd.h @@ -50,6 +50,10 @@ typedef enum #define DEFAULT_RELOAD_LIMIT 5 +/* Time before restarting the process in paranoia mode. */ +#define RESTART_INTERVAL (60 * 60) + + /* Structure describing dynamic part of one database. */ struct database_dyn { @@ -127,6 +131,19 @@ extern unsigned int reload_count; /* Pagesize minus one. */ extern uintptr_t pagesize_m1; +/* Nonzero if paranoia mode is enabled. */ +extern int paranoia; +/* Time after which the process restarts. */ +extern time_t restart_time; +/* How much time between restarts. */ +extern time_t restart_interval; +/* Old current working directory. */ +extern const char *oldcwd; +/* Old user and group ID. */ +extern uid_t old_uid; +extern gid_t old_gid; + + /* Prototypes for global functions. */ /* nscd.c */ |