diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-10-04 08:56:18 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2004-10-04 08:56:18 +0000 |
commit | 85148842d401edf64f9edee7e5819a947c289ed2 (patch) | |
tree | 42f228e998070f60c3bdb2018c9921b221a6851b /nscd/nscd_conf.c | |
parent | 6d96590587deec027c04fe576f11cff0f445eb32 (diff) | |
download | glibc-85148842d401edf64f9edee7e5819a947c289ed2.tar glibc-85148842d401edf64f9edee7e5819a947c289ed2.tar.gz glibc-85148842d401edf64f9edee7e5819a947c289ed2.tar.bz2 glibc-85148842d401edf64f9edee7e5819a947c289ed2.zip |
Updated to fedora-glibc-20041004T0747cvs/fedora-glibc-2_3_3-64
Diffstat (limited to 'nscd/nscd_conf.c')
-rw-r--r-- | nscd/nscd_conf.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/nscd/nscd_conf.c b/nscd/nscd_conf.c index 8a312ff459..2bca368de6 100644 --- a/nscd/nscd_conf.c +++ b/nscd/nscd_conf.c @@ -18,13 +18,15 @@ 02111-1307 USA. */ #include <ctype.h> +#include <errno.h> +#include <libintl.h> #include <malloc.h> #include <pwd.h> #include <stdio.h> #include <stdio_ext.h> #include <stdlib.h> #include <string.h> -#include <libintl.h> +#include <unistd.h> #include <sys/param.h> #include <sys/types.h> @@ -182,6 +184,10 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb]) if (nthreads == -1) nthreads = MAX (atol (arg1), lastdb); } + else if (strcmp (entry, "max-threads") == 0) + { + max_nthreads = MAX (atol (arg1), lastdb); + } else if (strcmp (entry, "server-user") == 0) { if (!arg1) @@ -191,7 +197,7 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb]) } else if (strcmp (entry, "stat-user") == 0) { - if (!arg1) + if (arg1 == NULL) dbg_log (_("Must specify user name for stat-user option")); else { @@ -248,11 +254,45 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb]) dbg_log (_("invalid value for 'reload-count': %u"), count); } } + else if (strcmp (entry, "paranoia") == 0) + { + if (strcmp (arg1, "no") == 0) + paranoia = 0; + else if (strcmp (arg1, "yes") == 0) + paranoia = 1; + } + else if (strcmp (entry, "restart-interval") == 0) + { + if (arg1 != NULL) + restart_interval = atol (arg1); + else + dbg_log (_("Must specify value for restart-interval option")); + } else dbg_log (_("Unknown option: %s %s %s"), entry, arg1, arg2); } while (!feof_unlocked (fp)); + if (paranoia) + { + restart_time = time (NULL) + restart_interval; + + /* Save the old current workding directory if we are in paranoia + mode. We have to change back to it. */ + oldcwd = get_current_dir_name (); + if (oldcwd == NULL) + { + dbg_log (_("\ +cannot get current working directory: %s; disabling paranoia mode"), + strerror (errno)); + paranoia = 0; + } + } + + /* Enforce sanity. */ + if (max_nthreads < nthreads) + max_nthreads = nthreads; + /* Free the buffer. */ free (line); /* Close configuration file. */ |