diff options
Diffstat (limited to 'src/setup/gnunet-setup.c')
-rw-r--r-- | src/setup/gnunet-setup.c | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/src/setup/gnunet-setup.c b/src/setup/gnunet-setup.c index d50cf39a..1ec84fe5 100644 --- a/src/setup/gnunet-setup.c +++ b/src/setup/gnunet-setup.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include "gnunet-setup.h" | 26 | #include "gnunet-setup.h" |
27 | #include "gnunet-setup-transport.h" | 27 | #include "gnunet-setup-transport.h" |
28 | #include "gnunet-setup-options.h" | 28 | #include "gnunet-setup-options.h" |
29 | #include "gnunet-setup-gns.h" | ||
30 | #include <gnunet/gnunet_constants.h> | 29 | #include <gnunet/gnunet_constants.h> |
31 | #include <regex.h> | 30 | #include <regex.h> |
32 | #if ENABLE_NLS | 31 | #if ENABLE_NLS |
@@ -79,13 +78,6 @@ static int do_autoconfig; | |||
79 | * Flag to enable privilege escalation. | 78 | * Flag to enable privilege escalation. |
80 | */ | 79 | */ |
81 | static int do_gksu; | 80 | static int do_gksu; |
82 | |||
83 | /** | ||
84 | * Show all configuration options, even if we are run | ||
85 | * as a normal user and a 'gnunet' user exists and thus | ||
86 | * most options should not apply to the normal user. | ||
87 | */ | ||
88 | static int force_full_setup; | ||
89 | #endif | 81 | #endif |
90 | 82 | ||
91 | 83 | ||
@@ -355,7 +347,7 @@ write_configuration () | |||
355 | 347 | ||
356 | 348 | ||
357 | /** | 349 | /** |
358 | * Actual main method that sets up the configuration window. | 350 | * Method run on shutdown. |
359 | * | 351 | * |
360 | * @param cls the main loop handle | 352 | * @param cls the main loop handle |
361 | * @param tc scheduler context | 353 | * @param tc scheduler context |
@@ -368,7 +360,6 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
368 | GNUNET_break (0); | 360 | GNUNET_break (0); |
369 | return; | 361 | return; |
370 | } | 362 | } |
371 | GNUNET_SETUP_gns_done (); | ||
372 | GNUNET_GTK_main_loop_quit (ml); | 363 | GNUNET_GTK_main_loop_quit (ml); |
373 | ml = NULL; | 364 | ml = NULL; |
374 | if (GNUNET_OK != write_configuration ()) | 365 | if (GNUNET_OK != write_configuration ()) |
@@ -409,7 +400,6 @@ GNUNET_SETUP_restart_namestore (void *cls, | |||
409 | { | 400 | { |
410 | if (GNUNET_OK != write_configuration ()) | 401 | if (GNUNET_OK != write_configuration ()) |
411 | return; /* no point in re-starting namestore ... */ | 402 | return; /* no point in re-starting namestore ... */ |
412 | GNUNET_SETUP_gns_done (); | ||
413 | if (NULL != namestore) | 403 | if (NULL != namestore) |
414 | { | 404 | { |
415 | GNUNET_break (0 == GNUNET_OS_process_kill (namestore, SIGTERM)); | 405 | GNUNET_break (0 == GNUNET_OS_process_kill (namestore, SIGTERM)); |
@@ -422,7 +412,6 @@ GNUNET_SETUP_restart_namestore (void *cls, | |||
422 | NULL, NULL, | 412 | NULL, NULL, |
423 | "gnunet-service-namestore", | 413 | "gnunet-service-namestore", |
424 | "gnunet-service-namestore", NULL); | 414 | "gnunet-service-namestore", NULL); |
425 | GNUNET_SETUP_gns_init (); | ||
426 | } | 415 | } |
427 | 416 | ||
428 | 417 | ||
@@ -588,8 +577,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
588 | #ifndef MINGW | 577 | #ifndef MINGW |
589 | if ( (0 != my_uid) && | 578 | if ( (0 != my_uid) && |
590 | (NULL != gnunet_pw) && | 579 | (NULL != gnunet_pw) && |
591 | (my_uid != gnunet_pw->pw_uid) && | 580 | (my_uid != gnunet_pw->pw_uid) ) |
592 | (0 == force_full_setup) ) | ||
593 | { | 581 | { |
594 | /* load system defaults, system/'gnunet' user's configuration and THEN | 582 | /* load system defaults, system/'gnunet' user's configuration and THEN |
595 | our configuration file */ | 583 | our configuration file */ |
@@ -638,24 +626,6 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
638 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, | 626 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, |
639 | &start_identity, NULL); | 627 | &start_identity, NULL); |
640 | load_options (); | 628 | load_options (); |
641 | GNUNET_SETUP_gns_init (); | ||
642 | #ifndef MINGW | ||
643 | if ( (0 != my_uid) && | ||
644 | (NULL != gnunet_pw) && | ||
645 | (my_uid != gnunet_pw->pw_uid) && | ||
646 | (0 == force_full_setup) ) | ||
647 | { | ||
648 | /* hide all options that are not for individual users; this | ||
649 | run is only for per-user options, not for per-peer options */ | ||
650 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_general_vbox"))); | ||
651 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_transport_main_frame"))); | ||
652 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_network_tab_vbox"))); | ||
653 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_fs_main_vbox"))); | ||
654 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_vpn_vbox"))); | ||
655 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_exit_vbox"))); | ||
656 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_namestore_vbox"))); | ||
657 | } | ||
658 | #endif | ||
659 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 629 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
660 | &cleanup_task, NULL); | 630 | &cleanup_task, NULL); |
661 | if (do_autoconfig) | 631 | if (do_autoconfig) |
@@ -688,9 +658,6 @@ main (int argc, char *const *argv) | |||
688 | { 'e', "elevate-priviledges", NULL, | 658 | { 'e', "elevate-priviledges", NULL, |
689 | gettext_noop ("run as user 'gnunet', if necessary by executing gksu to elevate rights"), | 659 | gettext_noop ("run as user 'gnunet', if necessary by executing gksu to elevate rights"), |
690 | 0, &GNUNET_GETOPT_set_one, &do_gksu }, | 660 | 0, &GNUNET_GETOPT_set_one, &do_gksu }, |
691 | { 'f', "force-full-setup", NULL, | ||
692 | gettext_noop ("force showing the full set of options, even if gnunet-setup is run as a normal user and as a user 'gnunet' exists on the system, most options should not apply to the normal user as GNUnet should be run by the 'gnunet' user"), | ||
693 | 0, &GNUNET_GETOPT_set_one, &force_full_setup }, | ||
694 | #endif | 661 | #endif |
695 | GNUNET_GETOPT_OPTION_END | 662 | GNUNET_GETOPT_OPTION_END |
696 | }; | 663 | }; |
@@ -698,7 +665,7 @@ main (int argc, char *const *argv) | |||
698 | 665 | ||
699 | if (GNUNET_OK == | 666 | if (GNUNET_OK == |
700 | GNUNET_GTK_main_loop_start ("gnunet-setup", "gnunet-setup", argc, argv, | 667 | GNUNET_GTK_main_loop_start ("gnunet-setup", "gnunet-setup", argc, argv, |
701 | options, "gnunet_setup_gtk_main_window.glade", | 668 | options, "gnunet_setup_main_window.glade", |
702 | &run)) | 669 | &run)) |
703 | ret = gret; | 670 | ret = gret; |
704 | else | 671 | else |