diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 13:29:44 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 13:29:44 +0000 |
commit | 13a4ee0bb4ccb6691729bde67233f5ca66209c7c (patch) | |
tree | 72d62fed4d091a1f38c021d9c3eab5e50044e8c4 /nscd | |
parent | 0923a2c896f09795cca4a6d800a336a56b0ee42c (diff) |
[BZ #4745]
[BZ #4586]
[BZ #4702]
[BZ #4525]
[BZ #4514]
[BZ #4512]
Merge selected bugfixes from the trunk.
Diffstat (limited to 'nscd')
-rw-r--r-- | nscd/aicache.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/nscd/aicache.c b/nscd/aicache.c index bccac3abbc..4640b4df94 100644 --- a/nscd/aicache.c +++ b/nscd/aicache.c @@ -1,5 +1,5 @@ /* Cache handling for host lookup. - Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. @@ -78,6 +78,15 @@ 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; @@ -254,10 +263,8 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, total = sizeof (*dataset) + naddrs + addrslen + canonlen; - /* 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) + /* Now we can allocate the data structure. */ + if (he == NULL) { dataset = (struct dataset *) mempool_alloc (db, total @@ -446,6 +453,11 @@ 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. */ |