[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r24653 - gnunet-gtk/src/setup
From: |
gnunet |
Subject: |
[GNUnet-SVN] r24653 - gnunet-gtk/src/setup |
Date: |
Thu, 1 Nov 2012 11:59:57 +0100 |
Author: grothoff
Date: 2012-11-01 11:59:57 +0100 (Thu, 01 Nov 2012)
New Revision: 24653
Modified:
gnunet-gtk/src/setup/gnunet-setup.c
Log:
-bratao: w32 fix, patch from #2606
Modified: gnunet-gtk/src/setup/gnunet-setup.c
===================================================================
--- gnunet-gtk/src/setup/gnunet-setup.c 2012-10-31 22:54:06 UTC (rev 24652)
+++ gnunet-gtk/src/setup/gnunet-setup.c 2012-11-01 10:59:57 UTC (rev 24653)
@@ -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 },
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r24653 - gnunet-gtk/src/setup,
gnunet <=