2004-09-13  Thorsten Kukuk  <kukuk@suse.de>

	* nscd/nscd_stat.c: Don't access dbs[cnt].head for disabled services.

	* nscd/nscd.init: Fix path to socket.
This commit is contained in:
Ulrich Drepper 2004-09-13 17:24:41 +00:00
parent 407c4b9a19
commit aadd7d9d26
4 changed files with 26 additions and 16 deletions

View File

@ -1,3 +1,9 @@
2004-09-13 Thorsten Kukuk <kukuk@suse.de>
* nscd/nscd_stat.c: Don't access dbs[cnt].head for disabled services.
* nscd/nscd.init: Fix path to socket.
2004-09-12 Ulrich Drepper <drepper@redhat.com>
* nscd/nscd_helper.c (get_mapping): Correctly check cmsg length.

View File

@ -62,7 +62,7 @@ stop () {
# nscd won't be able to remove these if it is running as
# a non-privileged user
rm -f /var/run/nscd/nscd.pid
rm -f /var/run/nscd/.socket
rm -f /var/run/nscd/socket
success $"$prog shutdown"
else
failure $"$prog shutdown"

View File

@ -141,11 +141,11 @@ get_mapping (request_type type, const char *key,
if (TEMP_FAILURE_RETRY (__recvmsg (sock, &msg, 0)) != keylen)
goto out_close2;
mapfd = *(int *) CMSG_DATA (cmsg);
if (CMSG_FIRSTHDR (&msg)->cmsg_len != CMSG_LEN (sizeof (int)))
goto out_close;
mapfd = *(int *) CMSG_DATA (cmsg);
struct stat64 st;
if (strcmp (resdata, key) != 0
|| fstat64 (mapfd, &st) != 0

View File

@ -88,25 +88,29 @@ send_stats (int fd, struct database_dyn dbs[lastdb])
for (cnt = 0; cnt < lastdb; ++cnt)
{
memset (&data.dbs[cnt], 0, sizeof (data.dbs[cnt]));
data.dbs[cnt].enabled = dbs[cnt].enabled;
data.dbs[cnt].check_file = dbs[cnt].check_file;
data.dbs[cnt].shared = dbs[cnt].shared;
data.dbs[cnt].persistent = dbs[cnt].persistent;
data.dbs[cnt].module = dbs[cnt].head->module;
data.dbs[cnt].postimeout = dbs[cnt].postimeout;
data.dbs[cnt].negtimeout = dbs[cnt].negtimeout;
data.dbs[cnt].poshit = dbs[cnt].head->poshit;
data.dbs[cnt].neghit = dbs[cnt].head->neghit;
data.dbs[cnt].posmiss = dbs[cnt].head->posmiss;
data.dbs[cnt].negmiss = dbs[cnt].head->negmiss;
data.dbs[cnt].nentries = dbs[cnt].head->nentries;
data.dbs[cnt].maxnentries = dbs[cnt].head->maxnentries;
data.dbs[cnt].datasize = dbs[cnt].head->data_size;
data.dbs[cnt].dataused = dbs[cnt].head->first_free;
data.dbs[cnt].maxnsearched = dbs[cnt].head->maxnsearched;
data.dbs[cnt].rdlockdelayed = dbs[cnt].head->rdlockdelayed;
data.dbs[cnt].wrlockdelayed = dbs[cnt].head->wrlockdelayed;
data.dbs[cnt].addfailed = dbs[cnt].head->addfailed;
if (dbs[cnt].head != NULL)
{
data.dbs[cnt].module = dbs[cnt].head->module;
data.dbs[cnt].poshit = dbs[cnt].head->poshit;
data.dbs[cnt].neghit = dbs[cnt].head->neghit;
data.dbs[cnt].posmiss = dbs[cnt].head->posmiss;
data.dbs[cnt].negmiss = dbs[cnt].head->negmiss;
data.dbs[cnt].nentries = dbs[cnt].head->nentries;
data.dbs[cnt].maxnentries = dbs[cnt].head->maxnentries;
data.dbs[cnt].datasize = dbs[cnt].head->data_size;
data.dbs[cnt].dataused = dbs[cnt].head->first_free;
data.dbs[cnt].maxnsearched = dbs[cnt].head->maxnsearched;
data.dbs[cnt].rdlockdelayed = dbs[cnt].head->rdlockdelayed;
data.dbs[cnt].wrlockdelayed = dbs[cnt].head->wrlockdelayed;
data.dbs[cnt].addfailed = dbs[cnt].head->addfailed;
}
}
if (TEMP_FAILURE_RETRY (write (fd, &data, sizeof (data))) != sizeof (data))