2009-02-20 08:46:43 +01:00
|
|
|
Index: nscd/aicache.c
|
|
|
|
===================================================================
|
|
|
|
--- nscd/aicache.c.orig
|
|
|
|
+++ nscd/aicache.c
|
2009-05-27 12:39:38 +02:00
|
|
|
@@ -515,9 +515,15 @@ next_nip:
|
2009-02-20 08:46:43 +01:00
|
|
|
if (fd != -1)
|
|
|
|
TEMP_FAILURE_RETRY (send (fd, ¬found, total, MSG_NOSIGNAL));
|
|
|
|
|
2009-05-27 12:39:38 +02:00
|
|
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1);
|
2009-02-20 08:46:43 +01:00
|
|
|
/* If we cannot permanently store the result, so be it. */
|
|
|
|
- if (dataset != NULL)
|
|
|
|
+ if (db->negtimeout == 0)
|
|
|
|
+ {
|
|
|
|
+ /* Mark the old entry as obsolete. */
|
|
|
|
+ if (dh != NULL)
|
|
|
|
+ dh->usable = false;
|
|
|
|
+ dataset = NULL;
|
|
|
|
+ }
|
2009-05-27 12:39:38 +02:00
|
|
|
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) == NULL)
|
2009-02-20 08:46:43 +01:00
|
|
|
{
|
|
|
|
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
|
|
|
|
dataset->head.recsize = total;
|
|
|
|
Index: nscd/grpcache.c
|
|
|
|
===================================================================
|
|
|
|
--- nscd/grpcache.c.orig
|
|
|
|
+++ nscd/grpcache.c
|
|
|
|
@@ -113,10 +113,14 @@ cache_addgr (struct database_dyn *db, in
|
|
|
|
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
|
|
|
MSG_NOSIGNAL));
|
|
|
|
|
|
|
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
2009-05-27 12:39:38 +02:00
|
|
|
- 1);
|
2009-02-20 08:46:43 +01:00
|
|
|
/* If we cannot permanently store the result, so be it. */
|
|
|
|
- if (dataset != NULL)
|
|
|
|
+ if (db->negtimeout == 0)
|
|
|
|
+ {
|
|
|
|
+ /* Mark the old entry as obsolete. */
|
|
|
|
+ if (dh != NULL)
|
|
|
|
+ dh->usable = false;
|
|
|
|
+ }
|
2009-05-27 12:39:38 +02:00
|
|
|
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) == NULL)
|
2009-02-20 08:46:43 +01:00
|
|
|
{
|
|
|
|
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
|
|
|
|
dataset->head.recsize = total;
|
|
|
|
Index: nscd/hstcache.c
|
|
|
|
===================================================================
|
|
|
|
--- nscd/hstcache.c.orig
|
|
|
|
+++ nscd/hstcache.c
|
|
|
|
@@ -119,10 +119,14 @@ cache_addhst (struct database_dyn *db, i
|
|
|
|
MSG_NOSIGNAL)) != total)
|
|
|
|
all_written = false;
|
|
|
|
|
|
|
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
2009-05-27 12:39:38 +02:00
|
|
|
- 1);
|
2009-02-20 08:46:43 +01:00
|
|
|
/* If we cannot permanently store the result, so be it. */
|
|
|
|
- if (dataset != NULL)
|
|
|
|
+ if (db->negtimeout == 0)
|
|
|
|
+ {
|
|
|
|
+ /* Mark the old entry as obsolete. */
|
|
|
|
+ if (dh != NULL)
|
|
|
|
+ dh->usable = false;
|
|
|
|
+ }
|
2009-05-27 12:39:38 +02:00
|
|
|
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) == NULL)
|
2009-02-20 08:46:43 +01:00
|
|
|
{
|
|
|
|
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
|
|
|
|
dataset->head.recsize = total;
|
|
|
|
Index: nscd/initgrcache.c
|
|
|
|
===================================================================
|
|
|
|
--- nscd/initgrcache.c.orig
|
|
|
|
+++ nscd/initgrcache.c
|
|
|
|
@@ -197,10 +197,14 @@ addinitgroupsX (struct database_dyn *db,
|
|
|
|
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
|
|
|
MSG_NOSIGNAL));
|
|
|
|
|
|
|
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
2009-05-27 12:39:38 +02:00
|
|
|
- 1);
|
2009-02-20 08:46:43 +01:00
|
|
|
/* If we cannot permanently store the result, so be it. */
|
|
|
|
- if (dataset != NULL)
|
|
|
|
+ if (db->negtimeout == 0)
|
|
|
|
+ {
|
|
|
|
+ /* Mark the old entry as obsolete. */
|
|
|
|
+ if (dh != NULL)
|
|
|
|
+ dh->usable = false;
|
|
|
|
+ }
|
2009-05-27 12:39:38 +02:00
|
|
|
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) == NULL)
|
2009-02-20 08:46:43 +01:00
|
|
|
{
|
|
|
|
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
|
|
|
|
dataset->head.recsize = total;
|
|
|
|
Index: nscd/pwdcache.c
|
|
|
|
===================================================================
|
|
|
|
--- nscd/pwdcache.c.orig
|
|
|
|
+++ nscd/pwdcache.c
|
|
|
|
@@ -120,10 +120,14 @@ cache_addpw (struct database_dyn *db, in
|
|
|
|
written = TEMP_FAILURE_RETRY (send (fd, ¬found, total,
|
|
|
|
MSG_NOSIGNAL));
|
|
|
|
|
|
|
|
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
|
2009-05-27 12:39:38 +02:00
|
|
|
- 1);
|
2009-02-20 08:46:43 +01:00
|
|
|
/* If we cannot permanently store the result, so be it. */
|
|
|
|
- if (dataset != NULL)
|
|
|
|
+ if (db->negtimeout == 0)
|
|
|
|
+ {
|
|
|
|
+ /* Mark the old entry as obsolete. */
|
|
|
|
+ if (dh != NULL)
|
|
|
|
+ dh->usable = false;
|
|
|
|
+ }
|
2009-05-27 12:39:38 +02:00
|
|
|
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) == NULL)
|
2009-02-20 08:46:43 +01:00
|
|
|
{
|
|
|
|
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
|
|
|
|
dataset->head.recsize = total;
|