From a12ce44f6992d8249f779e95db730a9634571654 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 4 May 2003 07:00:44 +0000 Subject: Update. 2003-05-03 Ulrich Drepper * nscd/nscd.c (main): Parse config file right after parsing parameters. Then, if get_stats is true, call receive_print_stats. Drop parameter from nscd_init call. (get_stats): New variable. (parse_opt): Set get_stats, don't call receive_print_stats here. * nscd/nscd.h: Declare dbs, stat_user, and stat_uid. Adjust nscd_init prototype. * nscd/connections.c (stat_user, stat_uid): New variables. (dbs): Make global. (nscd_init): Don't read configuration file here. Drop parameter. (handle_request): Cleanup handling of non-database lookup requests. * nscd/nscd_conf.c (nscd_parse_file): Recognize stat-user entry. Get UID of the specified user. Use xstrdup instead of strdup. * nscd/nscd_stat.c (receive_print_stats): Check UID. If not zero, check stat_user. * nscd/Makefile (nscd-modules): Add xstrdup. * nscd/nscd.conf: Document stat-user entry. 2003-05-03 H.J. Lu * sysdeps/unix/sysv/linux/ia64/sysdep.h (__NR_semtimedop): Define if not defined. --- nscd/nscd.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'nscd/nscd.h') diff --git a/nscd/nscd.h b/nscd/nscd.h index 73c94a5..af7ae9a 100644 --- a/nscd/nscd.h +++ b/nscd/nscd.h @@ -89,6 +89,7 @@ struct database /* Global variables. */ +extern struct database dbs[lastdb]; extern const char *dbnames[lastdb]; extern const char *serv2str[LASTREQ]; @@ -99,13 +100,17 @@ extern const struct iovec hst_iov_disabled; /* Number of threads to run. */ extern int nthreads; -/* Tables for which we cache data with uid */ +/* Tables for which we cache data with uid. */ extern int secure[lastdb]; -extern int secure_in_use; /* Is one of the above 1 ? */ +extern int secure_in_use; /* Is one of the above 1? */ -/* User name to run server processes as */ +/* User name to run server processes as. */ extern const char *server_user; +/* Name and UID of user who is allowed to request statistics. */ +extern const char *stat_user; +extern uid_t stat_uid; + /* Time the server was started. */ extern time_t start_time; @@ -119,7 +124,7 @@ extern void termination_handler (int signum) __attribute__ ((__noreturn__)); extern int nscd_open_socket (void); /* connections.c */ -extern void nscd_init (const char *conffile); +extern void nscd_init (void); extern void close_sockets (void); extern void start_threads (void) __attribute__ ((__noreturn__)); -- cgit v1.1