diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-07-31 17:46:17 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-07-31 17:46:17 +0000 |
commit | 8833066b122427710a9e14a888ce6cfa862332d3 (patch) | |
tree | 29591019d695919417b3698618d6a342e97381d6 /nscd/aicache.c | |
parent | fedca46896bdb702cb988837a0c2c5447e72ba2b (diff) | |
download | glibc-8833066b122427710a9e14a888ce6cfa862332d3.tar.gz glibc-8833066b122427710a9e14a888ce6cfa862332d3.tar.xz glibc-8833066b122427710a9e14a888ce6cfa862332d3.zip |
Updated to fedora-glibc-20070731T1624 cvs/fedora-glibc-2_6_90-1
Diffstat (limited to 'nscd/aicache.c')
-rw-r--r-- | nscd/aicache.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/nscd/aicache.c b/nscd/aicache.c index 4640b4df94..0dc892bc74 100644 --- a/nscd/aicache.c +++ b/nscd/aicache.c @@ -1,11 +1,12 @@ /* Cache handling for host lookup. - Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation. + it under the terms of the GNU General Public License as published + by the Free Software Foundation; version 2 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -78,15 +79,6 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, dbg_log (_("Reloading \"%s\" in hosts cache!"), (char *) key); } -#if 0 - uid_t oldeuid = 0; - if (db->secure) - { - oldeuid = geteuid (); - pthread_seteuid_np (uid); - } -#endif - static service_user *hosts_database; service_user *nip = NULL; int no_more; @@ -263,8 +255,10 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, total = sizeof (*dataset) + naddrs + addrslen + canonlen; - /* Now we can allocate the data structure. */ - if (he == NULL) + /* Now we can allocate the data structure. If the TTL + of the entry is reported as zero do not cache the + entry at all. */ + if (ttl != 0 && he == NULL) { dataset = (struct dataset *) mempool_alloc (db, total @@ -453,11 +447,6 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, out: _res.options = old_res_options; -#if 0 - if (db->secure) - pthread_seteuid_np (oldeuid); -#endif - if (dataset != NULL && !alloca_used) { /* If necessary, we also propagate the data to disk. */ |