diff options
Diffstat (limited to 'src/setup/gnunet-setup.c')
-rw-r--r-- | src/setup/gnunet-setup.c | 53 |
1 files changed, 5 insertions, 48 deletions
diff --git a/src/setup/gnunet-setup.c b/src/setup/gnunet-setup.c index 547f7441..1f5bc0a4 100644 --- a/src/setup/gnunet-setup.c +++ b/src/setup/gnunet-setup.c | |||
@@ -330,7 +330,7 @@ load_options () | |||
330 | /** | 330 | /** |
331 | * Write final configuration to disk. | 331 | * Write final configuration to disk. |
332 | * | 332 | * |
333 | * @return GNUNET_OK on success | 333 | * @return #GNUNET_OK on success |
334 | */ | 334 | */ |
335 | static int | 335 | static int |
336 | write_configuration () | 336 | write_configuration () |
@@ -602,54 +602,11 @@ run (void *cls, | |||
602 | 602 | ||
603 | option_cfg_name = GNUNET_GTK_main_loop_get_configuration_file (ml); | 603 | option_cfg_name = GNUNET_GTK_main_loop_get_configuration_file (ml); |
604 | cfg = GNUNET_CONFIGURATION_create (); | 604 | cfg = GNUNET_CONFIGURATION_create (); |
605 | 605 | if (GNUNET_YES == | |
606 | #ifndef MINGW | 606 | GNUNET_DISK_file_test (option_cfg_name)) |
607 | if ( (0 != my_uid) && | ||
608 | (NULL != gnunet_pw) && | ||
609 | (my_uid != gnunet_pw->pw_uid) ) | ||
610 | { | ||
611 | /* load system defaults, system/'gnunet' user's configuration and THEN | ||
612 | our configuration file */ | ||
613 | if (GNUNET_YES == | ||
614 | GNUNET_DISK_file_test ("/etc/gnunet.conf")) | ||
615 | { | ||
616 | (void) GNUNET_CONFIGURATION_load (cfg, "/etc/gnunet.conf"); | ||
617 | } | ||
618 | else | ||
619 | { | ||
620 | #if HAVE_GETPWNAM | ||
621 | struct passwd *pw; | ||
622 | |||
623 | pw = getpwnam ("gnunet"); | ||
624 | if (NULL != pw) | ||
625 | { | ||
626 | char *gnunet_user_cfgname; | ||
627 | |||
628 | GNUNET_asprintf (&gnunet_user_cfgname, | ||
629 | "%s%s%s", | ||
630 | pw->pw_dir, | ||
631 | DIR_SEPARATOR_STR, | ||
632 | ".config/gnunet.conf"); | ||
633 | if (GNUNET_YES == | ||
634 | GNUNET_DISK_file_test (gnunet_user_cfgname)) | ||
635 | (void) GNUNET_CONFIGURATION_load (cfg, gnunet_user_cfgname); | ||
636 | GNUNET_free (gnunet_user_cfgname); | ||
637 | } | ||
638 | #endif | ||
639 | } | ||
640 | if (GNUNET_YES == | ||
641 | GNUNET_DISK_file_test (option_cfg_name)) | ||
642 | (void) GNUNET_CONFIGURATION_parse (cfg, | ||
643 | option_cfg_name); | ||
644 | } | ||
645 | else | ||
646 | #endif | ||
647 | { | ||
648 | /* only load system defaults and our configuration file */ | ||
649 | if (GNUNET_YES == | ||
650 | GNUNET_DISK_file_test (option_cfg_name)) | ||
651 | (void) GNUNET_CONFIGURATION_load (cfg, option_cfg_name); | 607 | (void) GNUNET_CONFIGURATION_load (cfg, option_cfg_name); |
652 | } | 608 | else |
609 | (void) GNUNET_CONFIGURATION_load (cfg, NULL); | ||
653 | main_window = GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_dialog")); | 610 | main_window = GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_dialog")); |
654 | main_window = GNUNET_GTK_plug_me ("GNUNET_FS_GTK_PLUG", | 611 | main_window = GNUNET_GTK_plug_me ("GNUNET_FS_GTK_PLUG", |
655 | main_window); | 612 | main_window); |