diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2024-04-04 01:07:52 +0200 |
---|---|---|
committer | t3serakt <t3ss@posteo.de> | 2024-04-10 20:14:59 +0200 |
commit | 5585a8f3552abab7362bcf2398c283d45a259919 (patch) | |
tree | 7fa32e949620aef346246339c91f24d68811753e | |
parent | f649244d8d3d0925d3fc5deacf748b58a711bfd1 (diff) | |
download | gnunet-5585a8f3552abab7362bcf2398c283d45a259919.tar.gz gnunet-5585a8f3552abab7362bcf2398c283d45a259919.zip |
RECLAIM: verify cli does not issue tickets when missing attributes
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r-- | src/cli/reclaim/gnunet-reclaim.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/cli/reclaim/gnunet-reclaim.c b/src/cli/reclaim/gnunet-reclaim.c index efb2c2902..901dd6bf6 100644 --- a/src/cli/reclaim/gnunet-reclaim.c +++ b/src/cli/reclaim/gnunet-reclaim.c | |||
@@ -413,6 +413,9 @@ process_delete (void *cls, int success, const char *msg) | |||
413 | static void | 413 | static void |
414 | iter_finished (void *cls) | 414 | iter_finished (void *cls) |
415 | { | 415 | { |
416 | struct GNUNET_RECLAIM_AttributeListEntry *le; | ||
417 | char *attrs_tmp; | ||
418 | char *attr_str; | ||
416 | char *data; | 419 | char *data; |
417 | size_t data_size; | 420 | size_t data_size; |
418 | int type; | 421 | int type; |
@@ -426,6 +429,34 @@ iter_finished (void *cls) | |||
426 | 429 | ||
427 | if (issue_attrs) | 430 | if (issue_attrs) |
428 | { | 431 | { |
432 | attrs_tmp = GNUNET_strdup (issue_attrs); | ||
433 | attr_str = strtok (attrs_tmp, ","); | ||
434 | while (NULL != attr_str) | ||
435 | { | ||
436 | le = attr_list->list_head; | ||
437 | while (le) | ||
438 | { | ||
439 | if (0 == strcasecmp (attr_str, le->attribute->name)) | ||
440 | break; | ||
441 | |||
442 | le = le->next; | ||
443 | } | ||
444 | |||
445 | if (! le) | ||
446 | { | ||
447 | fprintf (stdout, "No such attribute ``%s''\n", attr_str); | ||
448 | break; | ||
449 | } | ||
450 | |||
451 | attr_str = strtok (NULL, ","); | ||
452 | } | ||
453 | GNUNET_free (attrs_tmp); | ||
454 | if (NULL != attr_str) | ||
455 | { | ||
456 | GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); | ||
457 | return; | ||
458 | } | ||
459 | |||
429 | reclaim_op = GNUNET_RECLAIM_ticket_issue (reclaim_handle, | 460 | reclaim_op = GNUNET_RECLAIM_ticket_issue (reclaim_handle, |
430 | pkey, | 461 | pkey, |
431 | &rp_key, | 462 | &rp_key, |