aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--nscd/connections.c10
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b2c0c81aec..e5552901f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-01-08 Ulrich Drepper <drepper@cygnus.com>
+
+ * nscd/connections.c (handle_request): Handle systems without
+ SO_PEERCRED.
+ (nscd_run): Likewise.
+
2000-01-07 Andreas Jaeger <aj@suse.de>
Add support for Berkeley db 3.0.x and merge db support:
diff --git a/nscd/connections.c b/nscd/connections.c
index c0686e8415..cee32b8de0 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -1,5 +1,5 @@
/* Inner loops of cache daemon.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -350,6 +350,9 @@ cannot handle old request version %d; current version is %d"),
struct ucred caller;
socklen_t optlen = sizeof (caller);
+ /* Some systems have no SO_PEERCRED implementation. They don't
+ care about security so we don't as well. */
+#ifdef SO_PEERCRED
if (getsockopt (fd, SOL_SOCKET, SO_PEERCRED, &caller, &optlen) < 0)
{
char buf[256];
@@ -359,6 +362,7 @@ cannot handle old request version %d; current version is %d"),
}
else
if (caller.uid == 0)
+#endif
{
if (req->type == GETSTAT)
send_stats (fd, dbs);
@@ -433,6 +437,9 @@ nscd_run (void *p)
continue;
}
+ /* Some systems have no SO_PEERCRED implementation. They don't
+ care about security so we don't as well. */
+#ifdef SO_PEERCRED
if (secure_in_use)
{
struct ucred caller;
@@ -451,6 +458,7 @@ nscd_run (void *p)
|| secure[serv2db[req.type]])
uid = caller.uid;
}
+#endif
/* It should not be possible to crash the nscd with a silly
request (i.e., a terribly large key. We limit the size