added privilege testing parameters for helper-vpn, exit and nat-client.
authorChristian Fuchs <christian.fuchs@cfuchs.net>
Fri, 19 Apr 2013 14:50:35 +0000 (14:50 +0000)
committerChristian Fuchs <christian.fuchs@cfuchs.net>
Fri, 19 Apr 2013 14:50:35 +0000 (14:50 +0000)
todo: nat-server

src/exit/gnunet-daemon-exit.c
src/nat/nat.c
src/nat/nat_auto.c
src/pt/test_gnunet_vpn.c
src/vpn/gnunet-service-vpn.c

index 20f240b0d3f52ee9444539775f9a32cd3b894342..72522e1218c3df738ffbee3908907ff0cbf1d543 100644 (file)
@@ -3344,7 +3344,7 @@ run (void *cls, char *const *args GNUNET_UNUSED,
   {
     binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit");
     if (GNUNET_YES !=
-       GNUNET_OS_check_helper_binary (binary, GNUNET_YES, NULL)) // FIXME: CF: add test-parameters
+       GNUNET_OS_check_helper_binary (binary, GNUNET_YES, "-d gnunet-vpn - - - 169.1.3.3.7 255.255.255.0")) //no nat, ipv4 only
     {
       GNUNET_free (binary);
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
index e1ec880280dbf10127b1503633626ae7678edfe3..84ca2efa2296eb47ff5fb2540f62babca5e6c3f6 100644 (file)
@@ -1183,7 +1183,7 @@ GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp,
   binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-client");
   if ((GNUNET_YES == h->enable_nat_client) &&
       (GNUNET_YES !=
-       GNUNET_OS_check_helper_binary (binary, GNUNET_YES, NULL))) // FIXME: CF: add test-parameters
+       GNUNET_OS_check_helper_binary (binary, GNUNET_YES, "-d 127.0.0.1 127.0.0.2 42"))) // none of these parameters are actually used in privilege testing mode
   {
     h->enable_nat_client = GNUNET_NO;
     LOG (GNUNET_ERROR_TYPE_WARNING,
index edb2bb8417dd2865d7d7dd96da7e0e9174e48ed6..0c5bec11844760458a98f29ef12589a2582b13fb 100644 (file)
@@ -461,7 +461,7 @@ test_icmp_client (struct GNUNET_NAT_AutoHandle *ah)
        (GNUNET_YES !=
         GNUNET_CONFIGURATION_get_value_yesno (ah->cfg, "nat", "BEHIND_NAT")) &&
        (GNUNET_YES ==
-        GNUNET_OS_check_helper_binary (binary, GNUNET_YES, NULL))); // FIXME: CF: add test-parameters
+        GNUNET_OS_check_helper_binary (binary, GNUNET_YES, "-d 127.0.0.1 127.0.0.2 42"))); // none of these parameters are actually used in privilege testing mode
   GNUNET_free_non_null (tmp);
   GNUNET_free (binary);
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
index 52899d190f42b8784d33de09fee6863bbab4274c..c8c7317fc7be44598173cd42e8a83da3fb46beca 100644 (file)
@@ -410,12 +410,12 @@ main (int argc, char *const *argv)
     return 0;\r
   }\r
 #endif\r
-  vpn_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-vpn.exe");\r
-  exit_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit.exe");\r
+  vpn_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-vpn");\r
+  exit_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit");\r
   fprintf (stderr,"%s\n", vpn_binary);\r
   fprintf (stderr,"%s\n", exit_binary);\r
-  if ((GNUNET_YES != (ret = GNUNET_OS_check_helper_binary (vpn_binary, GNUNET_YES, NULL))) || // FIXME: CF: add test-parameters\r
-      (GNUNET_YES != (ret = GNUNET_OS_check_helper_binary (exit_binary, GNUNET_YES, NULL)))) // FIXME: CF: add test-parameters\r
+  if ((GNUNET_YES != (ret = GNUNET_OS_check_helper_binary (vpn_binary, GNUNET_YES, "-d gnunet-vpn - - 169.1.3.3.7 255.255.255.0"))) || //ipv4 only please!\r
+      (GNUNET_YES != (ret = GNUNET_OS_check_helper_binary (exit_binary, GNUNET_YES, "-d gnunet-vpn - - - 169.1.3.3.7 255.255.255.0")))) //no nat, ipv4 only\r
   {\r
     GNUNET_free (vpn_binary);\r
     GNUNET_free (exit_binary);\r
index a7a1ca213d4c41666ef1133abfc02dfeab3d59b7..61bd977bc8486f0e464e0c820aca2ec537d58bfc 100644 (file)
@@ -3062,7 +3062,7 @@ run (void *cls,
   binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-vpn");
 
   if (GNUNET_YES !=
-      GNUNET_OS_check_helper_binary (binary, GNUNET_YES, NULL)) // FIXME: CF: add test-parameters
+      GNUNET_OS_check_helper_binary (binary, GNUNET_YES, "-d gnunet-vpn - - 169.1.3.3.7 255.255.255.0")) //ipv4 only please!
   {
     fprintf (stderr,
             "`%s' is not SUID, refusing to run.\n",