aboutsummaryrefslogtreecommitdiff
path: root/src/arm/gnunet-service-arm.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-01 20:00:51 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-01 20:00:51 +0000
commit92e8e09d4c906964ece19869b0346113126d5255 (patch)
tree6bb77bef84bfc6a52dd591b5cb4fa88e5777af55 /src/arm/gnunet-service-arm.c
parent97a8a1d497ef954ea1c929208fd2a362df5ec6cb (diff)
downloadgnunet-92e8e09d4c906964ece19869b0346113126d5255.tar.gz
gnunet-92e8e09d4c906964ece19869b0346113126d5255.zip
fix #4546
Diffstat (limited to 'src/arm/gnunet-service-arm.c')
-rw-r--r--src/arm/gnunet-service-arm.c50
1 files changed, 37 insertions, 13 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index 152a358fc..5014faa15 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -450,26 +450,50 @@ start_process (struct ServiceList *sl,
450 if (GNUNET_OK != 450 if (GNUNET_OK !=
451 GNUNET_CONFIGURATION_get_value_string (cfg, sl->name, "OPTIONS", 451 GNUNET_CONFIGURATION_get_value_string (cfg, sl->name, "OPTIONS",
452 &options)) 452 &options))
453 options = NULL;
454 else
455 options = GNUNET_CONFIGURATION_expand_dollar (cfg, options);
456 {
457 char *new_options;
458 char *optpos;
459 char *fin_options;
460
461 fin_options = GNUNET_strdup (final_option);
462 /* replace '{}' with service name */
463 while (NULL != (optpos = strstr (fin_options, "{}")))
464 {
465 /* terminate string at opening parenthesis */
466 *optpos = 0;
467 GNUNET_asprintf (&new_options,
468 "%s%s%s",
469 fin_options,
470 sl->name,
471 optpos + 2);
472 GNUNET_free (fin_options);
473 fin_options = new_options;
474 }
475 if (NULL != options)
453 { 476 {
454 char *new_options; 477 /* combine "fin_options" with "options" */
455 char *optpos; 478 optpos = options;
456 options = GNUNET_strdup (final_option); 479 GNUNET_asprintf (&options,
457 /* replace '{}' with service name */ 480 "%s %s",
458 while (NULL != (optpos = strstr (options, "{}"))) 481 optpos,
459 { 482 fin_options);
460 /* terminate string at opening parenthesis */ 483 GNUNET_free (optpos);
461 *optpos = 0;
462 GNUNET_asprintf (&new_options, "%s%s%s", options, sl->name, optpos + 2);
463 GNUNET_free (options);
464 options = new_options;
465 }
466 options = GNUNET_CONFIGURATION_expand_dollar (cfg, options);
467 } 484 }
485 else
486 {
487 /* only have "fin_options", use that */
488 options = fin_options;
489 }
490 }
468 use_debug = GNUNET_CONFIGURATION_get_value_yesno (cfg, sl->name, "DEBUG"); 491 use_debug = GNUNET_CONFIGURATION_get_value_yesno (cfg, sl->name, "DEBUG");
469 492
470 { 493 {
471 const char *service_type = NULL; 494 const char *service_type = NULL;
472 const char *choices[] = { "GNUNET", "SIMPLE", NULL }; 495 const char *choices[] = { "GNUNET", "SIMPLE", NULL };
496
473 is_simple_service = GNUNET_NO; 497 is_simple_service = GNUNET_NO;
474 if ( (GNUNET_OK == 498 if ( (GNUNET_OK ==
475 GNUNET_CONFIGURATION_get_value_choice (cfg, 499 GNUNET_CONFIGURATION_get_value_choice (cfg,