Index: gnunet-setup.c =================================================================== --- gnunet-setup.c (revision 24652) +++ gnunet-setup.c (working copy) @@ -66,9 +66,12 @@ /** * Flag to enable privilege escalation. */ + + +#ifndef MINGW static int do_gksu; +#endif - /** * Show all configuration options, even if we are run * as a normal user and a 'gnunet' user exists and thus @@ -446,6 +449,8 @@ } + +#ifndef MINGW /** * Try elevating user priviledges to run as user 'gnunet' or 'root'. * @@ -471,8 +476,8 @@ GNUNET_OS_process_destroy (proc); return GNUNET_OK; } +#endif - /** * Actual main method that sets up the configuration window. * @@ -483,9 +488,11 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GtkWidget *main_window; +#ifndef MINGW uid_t my_uid; struct passwd *gnunet_pw; + my_uid = getuid (); gnunet_pw = getpwnam ("gnunet"); if ( (0 != do_gksu) && @@ -497,12 +504,16 @@ GNUNET_GTK_main_loop_quit (cls); return; } +#endif + ml = cls; if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL)) return; cfgName = GNUNET_GTK_main_loop_get_configuration_file (ml); cfg = GNUNET_CONFIGURATION_create (); + +#ifndef MINGW if ( (0 != my_uid) && (NULL != gnunet_pw) && (my_uid != gnunet_pw->pw_uid) && @@ -536,6 +547,7 @@ (void) GNUNET_CONFIGURATION_parse (cfg, cfgName); } else +#endif { /* only load system defaults and our configuration file */ (void) GNUNET_CONFIGURATION_load (cfg, cfgName); @@ -551,6 +563,7 @@ &start_namestore, NULL); load_options (); GNUNET_SETUP_gns_init (); +#ifndef MINGW if ( (0 != my_uid) && (NULL != gnunet_pw) && (my_uid != gnunet_pw->pw_uid) && @@ -565,6 +578,7 @@ gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_vpn_vbox"))); gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_namestore_vbox"))); } +#endif gtk_widget_show (main_window); gtk_window_present (GTK_WINDOW (main_window)); } @@ -581,9 +595,11 @@ main (int argc, char *const *argv) { struct GNUNET_GETOPT_CommandLineOption options[] = { +#ifndef MINGW { 'e', "elevate-priviledges", NULL, gettext_noop ("run as user 'gnunet', if necessary by executing gksu to elevate rights"), 0, &GNUNET_GETOPT_set_one, &do_gksu }, +#endif { 'f', "force-full-setup", NULL, 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"), 0, &GNUNET_GETOPT_set_one, &force_full_setup },