aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/namestore/gnunet-service-namestore.c25
-rw-r--r--src/zonemaster/gnunet-service-zonemaster-monitor.c4
-rw-r--r--src/zonemaster/gnunet-service-zonemaster.c5
3 files changed, 16 insertions, 18 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 2096c7bce..7669e90f5 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -1542,12 +1542,12 @@ handle_record_store (void *cls, const struct RecordStoreMessage *rp_msg)
1542 "Creating %u records for name `%s'\n", 1542 "Creating %u records for name `%s'\n",
1543 (unsigned int) rd_count, 1543 (unsigned int) rd_count,
1544 conv_name); 1544 conv_name);
1545 if ((0 == rd_count) && 1545 if ((GNUNET_NO == GSN_database->lookup_records (GSN_database->cls,
1546 (GNUNET_NO == GSN_database->lookup_records (GSN_database->cls,
1547 &rp_msg->private_key, 1546 &rp_msg->private_key,
1548 conv_name, 1547 conv_name,
1549 &lookup_tombstone_it, 1548 &lookup_tombstone_it,
1550 &tombstone))) 1549 &tombstone)) &&
1550 (rd_count == 0))
1551 { 1551 {
1552 /* This name does not exist, so cannot be removed */ 1552 /* This name does not exist, so cannot be removed */
1553 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1553 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1573,19 +1573,17 @@ handle_record_store (void *cls, const struct RecordStoreMessage *rp_msg)
1573 have_tombstone = GNUNET_NO; 1573 have_tombstone = GNUNET_NO;
1574 for (unsigned int i = 0; i < rd_count; i++) 1574 for (unsigned int i = 0; i < rd_count; i++)
1575 { 1575 {
1576 rd_clean[rd_clean_off] = rd[i];
1577 if (GNUNET_YES == GNUNET_GNSRECORD_is_critical (rd[i].record_type))
1578 rd_clean[rd_clean_off].flags |= GNUNET_GNSRECORD_RF_CRITICAL;
1579 /* Do not allow to set tombstone records unless zonemaster */ 1576 /* Do not allow to set tombstone records unless zonemaster */
1580 if (GNUNET_GNSRECORD_TYPE_TOMBSTONE == rd[i].record_type) 1577 if (GNUNET_GNSRECORD_TYPE_TOMBSTONE == rd[i].record_type)
1581 { 1578 {
1582 if (1 == ntohs (rp_msg->is_zonemaster)) 1579 if (1 != ntohs (rp_msg->is_zonemaster))
1583 { 1580 continue;
1584 have_tombstone = GNUNET_YES; 1581 have_tombstone = GNUNET_YES;
1585 rd_clean_off++;
1586 }
1587 continue;
1588 } 1582 }
1583 rd_clean[rd_clean_off] = rd[i];
1584 if (GNUNET_YES == GNUNET_GNSRECORD_is_critical (rd[i].record_type))
1585 rd_clean[rd_clean_off].flags |= GNUNET_GNSRECORD_RF_CRITICAL;
1586
1589 if ((0 == strcmp (GNUNET_GNS_EMPTY_LABEL_AT, conv_name)) || 1587 if ((0 == strcmp (GNUNET_GNS_EMPTY_LABEL_AT, conv_name)) ||
1590 (GNUNET_GNSRECORD_TYPE_NICK != rd[i].record_type)) 1588 (GNUNET_GNSRECORD_TYPE_NICK != rd[i].record_type))
1591 rd_clean_off++; 1589 rd_clean_off++;
@@ -1598,7 +1596,8 @@ handle_record_store (void *cls, const struct RecordStoreMessage *rp_msg)
1598 } 1596 }
1599 } 1597 }
1600 /* At this point we are either zonemaster and have set a new tombstone 1598 /* At this point we are either zonemaster and have set a new tombstone
1601 * (have_tombstone) or we are not zonemaster and we may want to 1599 * (have_tombstone)
1600 * or we are not zonemaster and we may want to
1602 * add the old tombstone (if there was any and if it is not already 1601 * add the old tombstone (if there was any and if it is not already
1603 * old). 1602 * old).
1604 */ 1603 */
diff --git a/src/zonemaster/gnunet-service-zonemaster-monitor.c b/src/zonemaster/gnunet-service-zonemaster-monitor.c
index 081398f0e..b51d1cb97 100644
--- a/src/zonemaster/gnunet-service-zonemaster-monitor.c
+++ b/src/zonemaster/gnunet-service-zonemaster-monitor.c
@@ -265,13 +265,13 @@ convert_records_for_export (const struct GNUNET_GNSRECORD_Data *rd,
265 now = GNUNET_TIME_absolute_get (); 265 now = GNUNET_TIME_absolute_get ();
266 for (unsigned int i = 0; i < rd_count; i++) 266 for (unsigned int i = 0; i < rd_count; i++)
267 { 267 {
268 if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE))
269 continue;
270 if (GNUNET_GNSRECORD_TYPE_TOMBSTONE == rd[i].record_type) 268 if (GNUNET_GNSRECORD_TYPE_TOMBSTONE == rd[i].record_type)
271 { 269 {
272 tombstone = rd[i].data; 270 tombstone = rd[i].data;
273 continue; 271 continue;
274 } 272 }
273 if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE))
274 continue;
275 if ((0 == (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) && 275 if ((0 == (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) &&
276 (rd[i].expiration_time < now.abs_value_us)) 276 (rd[i].expiration_time < now.abs_value_us))
277 continue; /* record already expired, skip it */ 277 continue; /* record already expired, skip it */
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c
index e478ceeab..3a8ac4be1 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -596,14 +596,13 @@ convert_records_for_export (const struct GNUNET_GNSRECORD_Data *rd,
596 now = GNUNET_TIME_absolute_get (); 596 now = GNUNET_TIME_absolute_get ();
597 for (unsigned int i = 0; i < rd_count; i++) 597 for (unsigned int i = 0; i < rd_count; i++)
598 { 598 {
599 if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE))
600 continue;
601 /* Should always be private but just to be sure */
602 if (GNUNET_GNSRECORD_TYPE_TOMBSTONE == rd[i].record_type) 599 if (GNUNET_GNSRECORD_TYPE_TOMBSTONE == rd[i].record_type)
603 { 600 {
604 tombstone = rd[i].data; 601 tombstone = rd[i].data;
605 continue; 602 continue;
606 } 603 }
604 if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE))
605 continue;
607 if ((0 == (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) && 606 if ((0 == (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) &&
608 (rd[i].expiration_time < now.abs_value_us)) 607 (rd[i].expiration_time < now.abs_value_us))
609 continue; /* record already expired, skip it */ 608 continue; /* record already expired, skip it */