View Issue Details

IDProjectCategoryView StatusLast Update
0002606gnunet-gtkgnunet-setuppublic2012-11-05 18:32
Reporterbratao Assigned ToChristian Grothoff  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformWIN32/MINGWOSWindowsOS Version8
Product VersionGit master 
Target Version0.9.4Fixed in Version0.9.4 
Summary0002606: GNUNet setup fails to compile on MINGW
DescriptionWe don't have those uid functions.
Patch attached.
TagsNo tags attached.
Attached Files
gnunet-setup.c.patch (2,769 bytes)   
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 },
gnunet-setup.c.patch (2,769 bytes)   

Activities

Issue History

Date Modified Username Field Change
2012-11-01 04:50 bratao New Issue
2012-11-01 04:50 bratao File Added: gnunet-setup.c.patch
2012-11-04 22:27 Christian Grothoff Status new => resolved
2012-11-04 22:27 Christian Grothoff Fixed in Version => 0.9.4
2012-11-04 22:27 Christian Grothoff Resolution open => fixed
2012-11-04 22:27 Christian Grothoff Assigned To => Christian Grothoff
2012-11-04 22:27 Christian Grothoff Product Version => Git master
2012-11-04 22:27 Christian Grothoff Target Version => 0.9.4
2012-11-05 18:32 Christian Grothoff Status resolved => closed