diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-01-08 10:13:33 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-01-08 10:13:33 +0000 |
commit | cedc8559c3a3e276277ee9fae9e6329c412a7522 (patch) | |
tree | 9b40fc1e3b7b0910427db30d79e71cfea6f45782 /nscd/connections.c | |
parent | 9d8525f2a152bb949053b52e91ccae0562a0cbb8 (diff) | |
download | glibc-cedc8559c3a3e276277ee9fae9e6329c412a7522.tar glibc-cedc8559c3a3e276277ee9fae9e6329c412a7522.tar.gz glibc-cedc8559c3a3e276277ee9fae9e6329c412a7522.tar.bz2 glibc-cedc8559c3a3e276277ee9fae9e6329c412a7522.zip |
Update.
2000-01-08 Ulrich Drepper <drepper@cygnus.com>
* nscd/connections.c (handle_request): Handle systems without
SO_PEERCRED.
(nscd_run): Likewise.
Diffstat (limited to 'nscd/connections.c')
-rw-r--r-- | nscd/connections.c | 10 |
1 files changed, 9 insertions, 1 deletions
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 |