summaryrefslogtreecommitdiff
path: root/nscd
diff options
context:
space:
mode:
Diffstat (limited to 'nscd')
-rw-r--r--nscd/Makefile6
-rw-r--r--nscd/connections.c7
-rw-r--r--nscd/nscd.c7
-rw-r--r--nscd/nscd.init10
-rw-r--r--nscd/nscd_getai.c11
-rw-r--r--nscd/nscd_helper.c7
-rw-r--r--nscd/nscd_initgroups.c14
-rw-r--r--nscd/nscd_nischeck.c4
8 files changed, 47 insertions, 19 deletions
diff --git a/nscd/Makefile b/nscd/Makefile
index 70a35198c2..9c32c68681 100644
--- a/nscd/Makefile
+++ b/nscd/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1998, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1998,2000,2002,2003,2004,2005 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -56,6 +56,8 @@ nscd-modules += selinux
selinux-LIBS := -lselinux
endif
+LDLIBS-nscd = $(selinux-LIBS)
+
distribute := nscd.h nscd-client.h dbg_log.h \
$(addsuffix .c, $(filter-out xmalloc, $(nscd-modules))) \
nscd_nischeck.c nscd.conf nscd.init nscd_proto.h \
@@ -110,7 +112,7 @@ $(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o))
$(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
$(LDFLAGS) $(LDFLAGS-$(@F)) \
-L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
- -o $@ $^ $(selinux-LIBS) $(common-objpfx)libc_nonshared.a
+ -o $@ $^ $(LDLIBS-nscd) $(common-objpfx)libc_nonshared.a
endif
# This makes sure -DNOT_IN_libc is passed for all these modules.
diff --git a/nscd/connections.c b/nscd/connections.c
index aa760e0252..fe4989d6ef 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -1,5 +1,5 @@
/* Inner loops of cache daemon.
- Copyright (C) 1998-2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998-2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -605,7 +605,10 @@ send_ro_fd (struct database_dyn *db, char *key, int fd)
/* Send the control message. We repeat when we are interrupted but
everything else is ignored. */
- (void) TEMP_FAILURE_RETRY (sendmsg (fd, &msg, 0));
+#ifndef MSG_NOSIGNAL
+# define MSG_NOSIGNAL 0
+#endif
+ (void) TEMP_FAILURE_RETRY (sendmsg (fd, &msg, MSG_NOSIGNAL));
if (__builtin_expect (debug_level > 0, 0))
dbg_log (_("provide access to FD %d, for %s"), db->ro_fd, key);
diff --git a/nscd/nscd.c b/nscd/nscd.c
index 5cca127f91..3ae401f1f7 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2003, 2004 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@@ -403,7 +403,7 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2004");
+"), "2005");
fprintf (stream, gettext ("Written by %s.\n"),
"Thorsten Kukuk and Ulrich Drepper");
}
@@ -450,6 +450,9 @@ termination_handler (int signum)
/* Synchronize memory. */
for (int cnt = 0; cnt < lastdb; ++cnt)
{
+ if (!dbs[cnt].enabled)
+ continue;
+
/* Make sure nobody keeps using the database. */
dbs[cnt].head->timestamp = 0;
diff --git a/nscd/nscd.init b/nscd/nscd.init
index d5c1cb9ae3..23e20c3a82 100644
--- a/nscd/nscd.init
+++ b/nscd/nscd.init
@@ -88,9 +88,9 @@ case "$1" in
RETVAL=$?
;;
status)
- status nscd
+ status nscd
RETVAL=$?
- ;;
+ ;;
restart)
restart
RETVAL=$?
@@ -100,9 +100,11 @@ case "$1" in
RETVAL=$?
;;
reload)
- killproc /usr/sbin/nscd -HUP
+ echo -n $"Reloading $prog: "
+ killproc /usr/sbin/nscd -HUP
RETVAL=$?
- ;;
+ echo
+ ;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
RETVAL=1
diff --git a/nscd/nscd_getai.c b/nscd/nscd_getai.c
index 24b374b0dc..866f7b2a5f 100644
--- a/nscd/nscd_getai.c
+++ b/nscd/nscd_getai.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -78,7 +78,7 @@ __nscd_getai (const char *key, struct nscd_ai_result **result, int *h_errnop)
sizeof (ai_resp_mem));
if (sock == -1)
{
- /* nscd not running or wrong version or hosts caching disabled. */
+ /* nscd not running or wrong version. */
__nss_not_use_nscd_hosts = 1;
goto out;
}
@@ -151,6 +151,13 @@ __nscd_getai (const char *key, struct nscd_ai_result **result, int *h_errnop)
}
else
{
+ if (__builtin_expect (ai_resp->found == -1, 0))
+ {
+ /* The daemon does not cache this database. */
+ __nss_not_use_nscd_hosts = 1;
+ goto out_close;
+ }
+
/* Store the error number. */
*h_errnop = ai_resp->error;
diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c
index 0e16cb8aeb..ea4fb968db 100644
--- a/nscd/nscd_helper.c
+++ b/nscd/nscd_helper.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -138,7 +138,10 @@ get_mapping (request_type type, const char *key,
/* Failure or timeout. */
goto out_close2;
- if (TEMP_FAILURE_RETRY (__recvmsg (sock, &msg, 0)) != keylen)
+#ifndef MSG_NOSIGNAL
+# define MSG_NOSIGNAL 0
+#endif
+ if (TEMP_FAILURE_RETRY (__recvmsg (sock, &msg, MSG_NOSIGNAL)) != keylen)
goto out_close2;
mapfd = *(int *) CMSG_DATA (cmsg);
diff --git a/nscd/nscd_initgroups.c b/nscd/nscd_initgroups.c
index 2ea9e7f862..daddf2e164 100644
--- a/nscd/nscd_initgroups.c
+++ b/nscd/nscd_initgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -75,7 +75,7 @@ __nscd_getgrouplist (const char *user, gid_t group, long int *size,
sizeof (initgr_resp_mem));
if (sock == -1)
{
- /* nscd not running or wrong version or hosts caching disabled. */
+ /* nscd not running or wrong version. */
__nss_not_use_nscd_group = 1;
goto out;
}
@@ -101,7 +101,7 @@ __nscd_getgrouplist (const char *user, gid_t group, long int *size,
(initgr_resp->ngrps + 1) * sizeof (gid_t));
if (newp == NULL)
/* We cannot increase the buffer size. */
- goto out;
+ goto out_close;
*groupsp = newp;
*size = initgr_resp->ngrps + 1;
@@ -125,6 +125,13 @@ __nscd_getgrouplist (const char *user, gid_t group, long int *size,
}
else
{
+ if (__builtin_expect (initgr_resp->found == -1, 0))
+ {
+ /* The daemon does not cache this database. */
+ __nss_not_use_nscd_group = 1;
+ goto out_close;
+ }
+
/* No group found yet. */
retval = 0;
@@ -143,6 +150,7 @@ __nscd_getgrouplist (const char *user, gid_t group, long int *size,
(*groupsp)[retval++] = group;
}
+ out_close:
if (sock != -1)
close_not_cancel_no_status (sock);
out:
diff --git a/nscd/nscd_nischeck.c b/nscd/nscd_nischeck.c
index a6817cf79e..20f7bb0620 100644
--- a/nscd/nscd_nischeck.c
+++ b/nscd/nscd_nischeck.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (c) 1999, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1999.
@@ -91,6 +91,6 @@ print_version (FILE *stream, struct argp_state *state)
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2004");
+"), "2005");
fprintf (stream, gettext ("Written by %s.\n"), "Thorsten Kukuk");
}