2 This file is part of GNUnet.
3 (C) 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file src/util/configuration.c
23 * @brief configuration management
25 * @author Christian Grothoff
29 #include "gnunet_common.h"
30 #include "gnunet_configuration_lib.h"
31 #include "gnunet_crypto_lib.h"
32 #include "gnunet_disk_lib.h"
33 #include "gnunet_os_lib.h"
34 #include "gnunet_strings_lib.h"
38 * @brief configuration entry
44 * This is a linked list.
46 struct ConfigEntry *next;
54 * current, commited value
61 * @brief configuration section
66 * This is a linked list.
68 struct ConfigSection *next;
71 * entries in the section
73 struct ConfigEntry *entries;
83 * @brief configuration data
85 struct GNUNET_CONFIGURATION_Handle
88 * Configuration sections.
90 struct ConfigSection *sections;
93 * Modification indication since last save
94 * GNUNET_NO if clean, GNUNET_YES if dirty,
95 * GNUNET_SYSERR on error (i.e. last save failed)
103 * Create a GNUNET_CONFIGURATION_Handle.
105 * @return fresh configuration object
107 struct GNUNET_CONFIGURATION_Handle *
108 GNUNET_CONFIGURATION_create ()
110 return GNUNET_malloc (sizeof (struct GNUNET_CONFIGURATION_Handle));
115 * Destroy configuration object.
117 * @param cfg configuration to destroy
120 GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg)
122 struct ConfigSection *sec;
123 struct ConfigEntry *ent;
125 while (NULL != (sec = cfg->sections))
127 cfg->sections = sec->next;
128 while (NULL != (ent = sec->entries))
130 sec->entries = ent->next;
131 GNUNET_free (ent->key);
132 GNUNET_free_non_null (ent->val);
135 GNUNET_free (sec->name);
143 * Parse a configuration file, add all of the options in the
144 * file to the configuration environment.
146 * @param cfg configuration to update
147 * @param filename name of the configuration file
148 * @return GNUNET_OK on success, GNUNET_SYSERR on error
151 GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
152 const char *filename)
166 fn = GNUNET_STRINGS_filename_expand (filename);
167 dirty = cfg->dirty; /* back up value! */
168 if (NULL == (fp = FOPEN (fn, "r")))
170 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fopen", fn);
172 return GNUNET_SYSERR;
176 section = GNUNET_strdup ("");
177 memset (line, 0, 256);
179 while (NULL != fgets (line, 255, fp))
182 for (i = 0; i < 255; i++)
185 if (line[0] == '\n' || line[0] == '#' || line[0] == '%' ||
189 for (i = 0; (i < 255 && line[i] != 0); i++)
190 if (line[i] != ' ' && line[i] != '\n' && line[i] != '\r')
194 /* remove tailing whitespace */
195 for (i = strlen (line) - 1; (i >= 0) && (isspace (line[i])); i--)
197 if (1 == sscanf (line, "@INLINE@ %191[^\n]", value))
200 if (0 != GNUNET_CONFIGURATION_parse (cfg, value))
201 ret = GNUNET_SYSERR; /* failed to parse included config */
203 else if (1 == sscanf (line, "[%99[^]]]", value))
206 GNUNET_free (section);
207 section = GNUNET_strdup (value);
209 else if (2 == sscanf (line, " %63[^= ] = %191[^\n]", tag, value))
213 i = strlen (value) - 1;
214 while ((i >= 0) && (isspace (value[i])))
221 while ((value[i] != '\0') && (value[i] != '"'))
231 GNUNET_CONFIGURATION_set_value_string (cfg,
232 section, tag, &value[i]);
234 else if (1 == sscanf (line, " %63[^= ] =[^\n]", tag))
237 GNUNET_CONFIGURATION_set_value_string (cfg, section, tag, "");
242 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
244 ("Syntax error in configuration file `%s' at line %u.\n"),
250 GNUNET_assert (0 == fclose (fp));
251 /* restore dirty flag - anything we set in the meantime
254 GNUNET_free (section);
260 * Test if there are configuration options that were
261 * changed since the last save.
263 * @param cfg configuration to inspect
264 * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed)
267 GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg)
274 * Write configuration file.
276 * @param cfg configuration to write
277 * @param filename where to write the configuration
278 * @return GNUNET_OK on success, GNUNET_SYSERR on error
281 GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
282 const char *filename)
284 struct ConfigSection *sec;
285 struct ConfigEntry *ent;
292 fn = GNUNET_STRINGS_filename_expand (filename);
293 GNUNET_DISK_directory_create_for_file (fn);
294 if (NULL == (fp = FOPEN (fn, "w")))
296 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fopen", fn);
298 return GNUNET_SYSERR;
305 if (0 > fprintf (fp, "[%s]\n", sec->name))
313 if (ent->val != NULL)
315 val = GNUNET_malloc (strlen (ent->val) * 2 + 1);
316 strcpy (val, ent->val);
317 while (NULL != (pos = strstr (val, "\n")))
319 memmove (&pos[2], &pos[1], strlen (&pos[1]));
323 if (0 > fprintf (fp, "%s = %s\n", ent->key, val))
335 if (0 > fprintf (fp, "\n"))
343 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "fprintf", filename);
344 GNUNET_assert (0 == fclose (fp));
347 cfg->dirty = GNUNET_SYSERR; /* last write failed */
348 return GNUNET_SYSERR;
350 cfg->dirty = GNUNET_NO; /* last write succeeded */
356 * Iterate over all options in the configuration.
358 * @param cfg configuration to inspect
359 * @param iter function to call on each option
360 * @param iter_cls closure for iter
363 GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
364 GNUNET_CONFIGURATION_Iterator iter,
367 struct ConfigSection *spos;
368 struct ConfigEntry *epos;
370 spos = cfg->sections;
373 epos = spos->entries;
376 iter (iter_cls, spos->name, epos->key, epos->val);
385 * Copy a configuration value to the given target configuration.
386 * Overwrites existing entries.
388 * @param cls the destination configuration (struct GNUNET_CONFIGURATION_Handle*)
389 * @param section section for the value
390 * @param option option name of the value
391 * @param value value to copy
394 copy_entry (void *cls,
395 const char *section, const char *option, const char *value)
397 struct GNUNET_CONFIGURATION_Handle *dst = cls;
398 GNUNET_CONFIGURATION_set_value_string (dst, section, option, value);
403 * Duplicate an existing configuration object.
405 * @param cfg configuration to duplicate
406 * @return duplicate configuration
408 struct GNUNET_CONFIGURATION_Handle *
409 GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg)
411 struct GNUNET_CONFIGURATION_Handle *ret;
413 ret = GNUNET_CONFIGURATION_create ();
414 GNUNET_CONFIGURATION_iterate (cfg, ©_entry, ret);
423 * @param section FIXME
424 * @return matching entry, NULL if not found
426 static struct ConfigSection *
427 findSection (const struct GNUNET_CONFIGURATION_Handle *cfg,
430 struct ConfigSection *pos;
433 while ((pos != NULL) && (0 != strcasecmp (section, pos->name)))
443 * @param section FIXME
445 * @return matching entry, NULL if not found
447 static struct ConfigEntry *
448 findEntry (const struct GNUNET_CONFIGURATION_Handle *cfg,
449 const char *section, const char *key)
451 struct ConfigSection *sec;
452 struct ConfigEntry *pos;
454 sec = findSection (cfg, section);
458 while ((pos != NULL) && (0 != strcasecmp (key, pos->key)))
465 * A callback function, compares entries from two configurations (default against a new configuration)
466 * and write the diffs in a diff-configuration object (the callback object).
467 * @param cls the diff configuration (ConfigurationDiffHandle*)
468 * @param section section for the value (of the default conf.)
469 * @param option option name of the value (of the default conf.)
470 * @param value value to copy (of the default conf.)
479 struct ConfigSection *secNew;
480 struct ConfigEntry *entNew;
481 GNUNNET_CONFIGURATION_Diff_Handle* cfgDiff = (GNUNNET_CONFIGURATION_Diff_Handle*)cls;
483 secNew = findSection(cfgDiff->cfgNew, section);
484 entNew = findEntry(cfgDiff->cfgNew, section, option);
485 if (secNew && strcmp(entNew->val, value) != 0) {
486 /* Value in the new configuration has been changed */
487 /* Add the changed value to the diff configuration object */
488 struct ConfigEntry *diffEntry = NULL;
489 struct ConfigSection *diffSection = NULL;
491 diffSection = cfgDiff->cfgDiff->sections;
492 if (diffSection == NULL) {
494 diffSection = GNUNET_malloc(sizeof(struct ConfigSection));
495 memcpy(diffSection, secNew, sizeof(struct ConfigSection));
496 cfgDiff->cfgDiff->sections = diffSection;
497 diffSection->entries = NULL;
498 diffSection->next = NULL;
501 while ((strcmp(diffSection->name, secNew->name) != 0) && (diffSection->next != NULL)) {
502 diffSection = diffSection->next;
504 if (strcmp(diffSection->name, secNew->name) != 0) {
505 /* Section not found in diffs configuration */
506 diffSection->next = GNUNET_malloc(sizeof(struct ConfigSection));
507 memcpy(diffSection->next, secNew, sizeof(struct ConfigSection));
508 diffSection->next->entries = NULL;
509 diffSection->next->next = NULL;
512 diffEntry = diffSection->entries;
516 if (diffEntry == NULL) {
518 diffEntry = GNUNET_malloc(sizeof(struct ConfigEntry));
519 memcpy(diffEntry, entNew, sizeof(struct ConfigEntry));
520 if (diffSection->next == NULL)
521 /* The first Entry of the first Section */
522 diffSection->entries = diffEntry;
524 /* The first entry of the non-first Section */
525 diffSection->next->entries = diffEntry;
526 diffEntry->next = NULL;
529 while (diffEntry->next != NULL) {
530 diffEntry = diffEntry->next;
532 diffEntry->next = GNUNET_malloc(sizeof(struct ConfigEntry));
533 memcpy(diffEntry->next, entNew, sizeof(struct ConfigEntry));
534 diffEntry->next->next = NULL;
541 * Write only configuration entries that have been changed to configuration file
542 * @param cfgDefault default configuration
543 * @param cfgNew new configuration
544 * @param filename where to write the configuration diff between default and new
545 * @return GNUNET_OK on success, GNUNET_SYSERR on error
548 GNUNET_CONFIGURATION_write_diffs(
549 struct GNUNET_CONFIGURATION_Handle *cfgDefault,
550 struct GNUNET_CONFIGURATION_Handle *cfgNew,
554 GNUNNET_CONFIGURATION_Diff_Handle *diffHandle =
555 GNUNET_malloc(sizeof(GNUNNET_CONFIGURATION_Diff_Handle));
556 diffHandle->cfgDiff = GNUNET_CONFIGURATION_create();
557 diffHandle->cfgDiff->sections = NULL;
558 diffHandle->cfgNew = cfgNew;
559 GNUNET_CONFIGURATION_iterate(cfgDefault, compareEntries, diffHandle);
561 return GNUNET_CONFIGURATION_write(diffHandle->cfgDiff, filename);
566 * Set a configuration value that should be a string.
568 * @param cfg configuration to update
569 * @param section section of interest
570 * @param option option of interest
571 * @param value value to set
574 GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle
577 const char *option, const char *value)
579 struct ConfigSection *sec;
580 struct ConfigEntry *e;
582 e = findEntry (cfg, section, option);
585 GNUNET_free_non_null (e->val);
586 e->val = GNUNET_strdup (value);
589 sec = findSection (cfg, section);
592 sec = GNUNET_malloc (sizeof (struct ConfigSection));
593 sec->name = GNUNET_strdup (section);
594 sec->next = cfg->sections;
597 e = GNUNET_malloc (sizeof (struct ConfigEntry));
598 e->key = GNUNET_strdup (option);
599 e->val = GNUNET_strdup (value);
600 e->next = sec->entries;
606 * Set a configuration value that should be a number.
608 * @param cfg configuration to update
609 * @param section section of interest
610 * @param option option of interest
611 * @param number value to set
614 GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle
615 *cfg, const char *section,
617 unsigned long long number)
620 GNUNET_snprintf (s, 64, "%llu", number);
621 GNUNET_CONFIGURATION_set_value_string (cfg, section, option, s);
626 * Get a configuration value that should be a number.
628 * @param cfg configuration to inspect
629 * @param section section of interest
630 * @param option option of interest
631 * @param number where to store the numeric value of the option
632 * @return GNUNET_OK on success, GNUNET_SYSERR on error
635 GNUNET_CONFIGURATION_get_value_number (const struct
636 GNUNET_CONFIGURATION_Handle *cfg,
639 unsigned long long *number)
641 struct ConfigEntry *e;
643 e = findEntry (cfg, section, option);
645 return GNUNET_SYSERR;
646 if (1 != SSCANF (e->val, "%llu", number))
647 return GNUNET_SYSERR;
653 * Get a configuration value that should be a relative time.
655 * @param cfg configuration to inspect
656 * @param section section of interest
657 * @param option option of interest
658 * @param time set to the time value stored in the configuration
659 * @return GNUNET_OK on success, GNUNET_SYSERR on error
662 GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
663 *cfg, const char *section,
665 struct GNUNET_TIME_Relative *time)
667 unsigned long long num;
670 ret = GNUNET_CONFIGURATION_get_value_number (cfg, section, option, &num);
671 if (ret == GNUNET_OK)
672 time->value = (uint64_t) num;
678 * Get a configuration value that should be a string.
680 * @param cfg configuration to inspect
681 * @param section section of interest
682 * @param option option of interest
683 * @param value will be set to a freshly allocated configuration
684 * value, or NULL if option is not specified
685 * @return GNUNET_OK on success, GNUNET_SYSERR on error
688 GNUNET_CONFIGURATION_get_value_string (const struct
689 GNUNET_CONFIGURATION_Handle *cfg,
691 const char *option, char **value)
693 struct ConfigEntry *e;
695 e = findEntry (cfg, section, option);
696 if ((e == NULL) || (e->val == NULL))
699 return GNUNET_SYSERR;
701 *value = GNUNET_strdup (e->val);
707 * Get a configuration value that should be in a set of
710 * @param cfg configuration to inspect
711 * @param section section of interest
712 * @param option option of interest
713 * @param choices NULL-terminated list of legal values
714 * @param value will be set to an entry in the legal list,
715 * or NULL if option is not specified and no default given
716 * @return GNUNET_OK on success, GNUNET_SYSERR on error
719 GNUNET_CONFIGURATION_get_value_choice (const struct
720 GNUNET_CONFIGURATION_Handle *cfg,
723 const char **choices,
726 struct ConfigEntry *e;
729 e = findEntry (cfg, section, option);
731 return GNUNET_SYSERR;
733 while (choices[i] != NULL)
735 if (0 == strcasecmp (choices[i], e->val))
739 if (choices[i] == NULL)
741 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
742 _("Configuration value '%s' for '%s'"
743 " in section '%s' is not in set of legal choices\n"),
744 e->val, option, section);
745 return GNUNET_SYSERR;
753 * Test if we have a value for a particular option
754 * @param cfg configuration to inspect
755 * @param section section of interest
756 * @param option option of interest
757 * @return GNUNET_YES if so, GNUNET_NO if not.
760 GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle
761 *cfg, const char *section,
764 struct ConfigEntry *e;
765 if ((NULL == (e = findEntry (cfg, section, option))) || (e->val == NULL))
772 * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR"
773 * where either in the "PATHS" section or the environtment
774 * "FOO" is set to "DIRECTORY".
776 * @param cfg configuration to use for path expansion
777 * @param orig string to $-expand (will be freed!)
778 * @return $-expanded string
781 GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle
793 while ((orig[i] != '/') && (orig[i] != '\\') && (orig[i] != '\0'))
804 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg,
808 if (NULL == (env = getenv (&orig[1])))
810 orig[i] = DIR_SEPARATOR;
813 prefix = GNUNET_strdup (env);
815 result = GNUNET_malloc (strlen (prefix) + strlen (post) + 2);
816 strcpy (result, prefix);
817 if ((strlen (prefix) == 0) ||
818 ((prefix[strlen (prefix) - 1] != DIR_SEPARATOR) && (strlen (post) > 0)))
819 strcat (result, DIR_SEPARATOR_STR);
820 strcat (result, post);
821 GNUNET_free (prefix);
828 * Get a configuration value that should be a string.
830 * @param cfg configuration to inspect
831 * @param section section of interest
832 * @param option option of interest
833 * @param value will be set to a freshly allocated configuration
834 * value, or NULL if option is not specified
835 * @return GNUNET_OK on success, GNUNET_SYSERR on error
838 GNUNET_CONFIGURATION_get_value_filename (const struct
839 GNUNET_CONFIGURATION_Handle *cfg,
841 const char *option, char **value)
847 ret = GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &tmp);
848 if (ret == GNUNET_SYSERR)
852 tmp = GNUNET_CONFIGURATION_expand_dollar (cfg, tmp);
853 *value = GNUNET_STRINGS_filename_expand (tmp);
867 * Get a configuration value that should be in a set of
868 * "GNUNET_YES" or "GNUNET_NO".
870 * @param cfg configuration to inspect
871 * @param section section of interest
872 * @param option option of interest
873 * @return GNUNET_YES, GNUNET_NO or GNUNET_SYSERR
876 GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle
877 *cfg, const char *section,
880 static const char *yesno[] = { "YES", "NO", NULL };
884 ret = GNUNET_CONFIGURATION_get_value_choice (cfg,
885 section, option, yesno, &val);
886 if (ret == GNUNET_SYSERR)
895 * Iterate over the set of filenames stored in a configuration value.
897 * @param cfg configuration to inspect
898 * @param section section of interest
899 * @param option option of interest
900 * @param cb function to call on each filename
901 * @param cb_cls closure for cb
902 * @return number of filenames iterated over, -1 on error
905 GNUNET_CONFIGURATION_iterate_value_filenames (const struct
906 GNUNET_CONFIGURATION_Handle
907 *cfg, const char *section,
909 GNUNET_FileNameCallback cb,
919 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &list))
921 GNUNET_assert (list != NULL);
926 while (pos[0] == ' ')
928 if (strlen (pos) == 0)
931 while ((end[0] != ' ') && (end[0] != '\0'))
939 memmove (end, &end[1], strlen (&end[1]) + 1);
941 /* illegal, but just keep it */
944 /* illegal, but just ignore that there was a '/' */
952 if (strlen (pos) > 0)
955 if ((cb != NULL) && (GNUNET_OK != cb (cb_cls, pos)))
977 escape_name (const char *value)
983 escaped = GNUNET_malloc (strlen (value) * 2 + 1);
984 memset (escaped, 0, strlen (value) * 2 + 1);
987 while (rpos[0] != '\0')
1010 * @param cls string we compare with (const char*)
1011 * @param fn filename we are currently looking at
1012 * @return GNUNET_OK if the names do not match, GNUNET_SYSERR if they do
1015 test_match (void *cls, const char *fn)
1017 const char *of = cls;
1018 return (0 == strcmp (of, fn)) ? GNUNET_SYSERR : GNUNET_OK;
1023 * Append a filename to a configuration value that
1024 * represents a list of filenames
1026 * @param cfg configuration to update
1027 * @param section section of interest
1028 * @param option option of interest
1029 * @param value filename to append
1030 * @return GNUNET_OK on success,
1031 * GNUNET_NO if the filename already in the list
1032 * GNUNET_SYSERR on error
1035 GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle
1037 const char *section,
1046 == GNUNET_CONFIGURATION_iterate_value_filenames (cfg,
1051 return GNUNET_NO; /* already exists */
1053 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &old))
1054 old = GNUNET_strdup ("");
1055 escaped = escape_name (value);
1056 nw = GNUNET_malloc (strlen (old) + strlen (escaped) + 2);
1059 strcat (nw, escaped);
1060 GNUNET_CONFIGURATION_set_value_string (cfg, section, option, nw);
1063 GNUNET_free (escaped);
1069 * Remove a filename from a configuration value that
1070 * represents a list of filenames
1072 * @param cfg configuration to update
1073 * @param section section of interest
1074 * @param option option of interest
1075 * @param value filename to remove
1076 * @return GNUNET_OK on success,
1077 * GNUNET_NO if the filename is not in the list,
1078 * GNUNET_SYSERR on error
1081 GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle
1083 const char *section,
1094 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &list))
1096 match = escape_name (value);
1100 while (pos[0] == ' ')
1102 if (strlen (pos) == 0)
1105 while ((end[0] != ' ') && (end[0] != '\0'))
1116 /* illegal, but just keep it */
1119 /* illegal, but just ignore that there was a '/' */
1127 if (strlen (pos) > 0)
1129 if (0 == strcmp (pos, match))
1131 memmove (pos, &end[1], strlen (&end[1]) + 1);
1134 pos[-1] = ' '; /* previously changed to "\0" */
1135 GNUNET_CONFIGURATION_set_value_string (cfg,
1136 section, option, list);
1138 GNUNET_free (match);
1147 GNUNET_free (match);
1153 * Load configuration (starts with defaults, then loads
1154 * system-specific configuration).
1156 * @param cfg configuration to update
1157 * @param filename name of the configuration file
1158 * @return GNUNET_OK on success, GNUNET_SYSERR on error
1161 GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
1162 const char *filename)
1167 ipath = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
1169 return GNUNET_SYSERR;
1171 GNUNET_asprintf (&baseconfig,
1172 "%s%s%s", ipath, DIR_SEPARATOR_STR, "defaults.conf");
1173 GNUNET_free (ipath);
1175 GNUNET_CONFIGURATION_parse (cfg, baseconfig)) ||
1176 (!((filename == NULL) ||
1177 (GNUNET_OK == GNUNET_CONFIGURATION_parse (cfg, filename)))))
1179 GNUNET_free (baseconfig);
1180 return GNUNET_SYSERR;
1182 GNUNET_free (baseconfig);
1183 if ((GNUNET_YES == GNUNET_CONFIGURATION_have_value (cfg,
1186 (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno (cfg,
1189 GNUNET_CRYPTO_random_disable_entropy_gathering ();
1195 /* end of configuration.c */