gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r982 - GNUnet/src/conf


From: durner
Subject: [GNUnet-SVN] r982 - GNUnet/src/conf
Date: Fri, 24 Jun 2005 11:05:54 -0700 (PDT)

Author: durner
Date: 2005-06-24 11:05:48 -0700 (Fri, 24 Jun 2005)
New Revision: 982

Modified:
   GNUnet/src/conf/wizard.c
   GNUnet/src/conf/wizard_callbacks.c
   GNUnet/src/conf/wizard_curs.c
   GNUnet/src/conf/wizard_util.c
Log:
fixes

Modified: GNUnet/src/conf/wizard.c
===================================================================
--- GNUnet/src/conf/wizard.c    2005-06-24 15:38:05 UTC (rev 981)
+++ GNUnet/src/conf/wizard.c    2005-06-24 18:05:48 UTC (rev 982)
@@ -229,9 +229,8 @@
                        sym_get_tristate_value(sym) != no);
        }
        
-#ifdef WINDOWS
-       gtk_widget_set_sensitive(chkStart, TRUE);
-#endif
+       if (wiz_useradd_capable())
+               gtk_widget_set_sensitive(chkStart, TRUE);
 
        if (doAutoStart)
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chkStart), 1);   
        

Modified: GNUnet/src/conf/wizard_callbacks.c
===================================================================
--- GNUnet/src/conf/wizard_callbacks.c  2005-06-24 15:38:05 UTC (rev 981)
+++ GNUnet/src/conf/wizard_callbacks.c  2005-06-24 18:05:48 UTC (rev 982)
@@ -186,19 +186,25 @@
        {
                conf = realloc(conf, fileLen + 13);
                strcpy(conf, "/etc/gnunetd.conf");
-               if (ACCESS(conf, W_OK))
+               errno = 0;
+               /**
+                * 1. Do we have write permission to /etc/gnunetd.conf?
+                * 2. If it doesn't exists, check for write permission to /etc/
+                */
+               if (ACCESS(conf, W_OK) == 0 ||
+                       (errno == ENOENT && ACCESS("/etc/", W_OK) == 0))
                {
+                       confDir = strdup("/etc/");
+                       confFile = strdup("gnunetd.conf");
+               }
+               else
+               {
                        conf = realloc(conf, fileLen + 11);
                        strcpy(conf, "~/.gnunet/gnunetd.conf");
                        
                        confDir = strdup("~/.gnunet/");
                        confFile = strdup("gnunetd.conf");
-               }
-               else
-               {
-                       confDir = strdup("/etc/");
-                       confFile = strdup("gnunetd.conf");
-               }
+               }                        
        }
 
        sym_set_string_value(sym, confDir);
@@ -241,7 +247,7 @@
 
        if (!wiz_autostart(doAutoStart, user_name, group_name)) {
 #ifndef MINGW
-               showErr(_("Unable to make GNUnet start automatically:", 
STRERROR(errno)));
+               showErr(_("Unable to make GNUnet start automatically:"), 
STRERROR(errno));
 #endif
                return;
        }       

Modified: GNUnet/src/conf/wizard_curs.c
===================================================================
--- GNUnet/src/conf/wizard_curs.c       2005-06-24 15:38:05 UTC (rev 981)
+++ GNUnet/src/conf/wizard_curs.c       2005-06-24 18:05:48 UTC (rev 982)
@@ -68,6 +68,13 @@
   
   conf_read(NULL);
 
+  sym = sym_find("EXPERIMENTAL", "Meta");
+  sym_set_tristate_value(sym, yes);
+  sym = sym_find("ADVANCED", "Meta");
+  sym_set_tristate_value(sym, yes);
+  sym = sym_find("RARE", "Meta");
+  sym_set_tristate_value(sym, yes);
+
   init_dialog();
   init_wsize();
        dialog_clear();
@@ -493,20 +500,13 @@
        init_dialog();
        dialog_clear();
        
-  sym = sym_find("EXPERIMENTAL", "Meta");
-  sym_set_tristate_value(sym, no);
-  sym = sym_find("ADVANCED", "Meta");
-  sym_set_tristate_value(sym, no);
-  sym = sym_find("RARE", "Meta");
-  sym_set_tristate_value(sym, no);
-
        while(true) {
          /* Check write permission */
-         sym = sym_find("Meta", "config-daemon.in_CONF_DEF_DIR");
+         sym = sym_find("config-daemon.in_CONF_DEF_DIR", "Meta");
          sym_calc_value_ext(sym, 1);
          confDir = strdup(sym_get_string_value(sym));
        
-         symFile = sym_find("Meta", "config-daemon.in_CONF_DEF_FILE");
+         symFile = sym_find("config-daemon.in_CONF_DEF_FILE", "Meta");
          sym_calc_value_ext(symFile, 1);
          confFile = strdup(sym_get_string_value(symFile));
        
@@ -545,6 +545,13 @@
                free(confDir);
                free(confFile);
 
+         sym = sym_find("EXPERIMENTAL", "Meta");
+         sym_set_tristate_value(sym, no);
+         sym = sym_find("ADVANCED", "Meta");
+         sym_set_tristate_value(sym, no);
+         sym = sym_find("RARE", "Meta");
+         sym_set_tristate_value(sym, no);
+
                /* Write conf */
                if (conf_write() != 0) {
                        char *err, *prefix, *strerr;

Modified: GNUnet/src/conf/wizard_util.c
===================================================================
--- GNUnet/src/conf/wizard_util.c       2005-06-24 15:38:05 UTC (rev 981)
+++ GNUnet/src/conf/wizard_util.c       2005-06-24 18:05:48 UTC (rev 982)
@@ -342,8 +342,8 @@
                return 1;
        else
                /* TODO: useradd */
+#endif
                return 0;
-#endif
 }
 
 /**





reply via email to

[Prev in Thread] Current Thread [Next in Thread]