diff options
author | lurchi <lurchi@strangeplace.net> | 2018-11-26 19:04:02 +0100 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2019-06-27 18:22:24 +0200 |
commit | 7aba81537bfb410ab71db1702dbf2f1104b5d39f (patch) | |
tree | 8b99ed390080ec22b4ab8958f74a05a61591abd0 | |
parent | e9a48fc54a426debfac840e5b1c228047133ef10 (diff) | |
download | gnunet-7aba81537bfb410ab71db1702dbf2f1104b5d39f.tar.gz gnunet-7aba81537bfb410ab71db1702dbf2f1104b5d39f.zip |
consider HELPER_PATH for setuid binaries
-rw-r--r-- | src/dns/gnunet-service-dns.c | 18 | ||||
-rw-r--r-- | src/exit/gnunet-daemon-exit.c | 16 | ||||
-rw-r--r-- | src/nat/gnunet-service-nat.c | 6 | ||||
-rw-r--r-- | src/nat/gnunet-service-nat_helper.c | 34 | ||||
-rw-r--r-- | src/nat/gnunet-service-nat_helper.h | 10 | ||||
-rw-r--r-- | src/vpn/gnunet-service-vpn.c | 22 |
6 files changed, 84 insertions, 22 deletions
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index a63205ebf..6666ff61a 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c | |||
@@ -1055,6 +1055,7 @@ run (void *cls, | |||
1055 | char *ipv6addr; | 1055 | char *ipv6addr; |
1056 | char *ipv6prefix; | 1056 | char *ipv6prefix; |
1057 | char *dns_exit; | 1057 | char *dns_exit; |
1058 | char *helper_path; | ||
1058 | char *binary; | 1059 | char *binary; |
1059 | int nortsetup; | 1060 | int nortsetup; |
1060 | 1061 | ||
@@ -1082,7 +1083,13 @@ run (void *cls, | |||
1082 | _("need a valid IPv4 or IPv6 address\n")); | 1083 | _("need a valid IPv4 or IPv6 address\n")); |
1083 | GNUNET_free_non_null (dns_exit); | 1084 | GNUNET_free_non_null (dns_exit); |
1084 | } | 1085 | } |
1085 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-dns"); | 1086 | helper_path = NULL; |
1087 | GNUNET_CONFIGURATION_get_value_string (cfg, | ||
1088 | "DNS", | ||
1089 | "HELPER_PATH", | ||
1090 | &helper_path); | ||
1091 | binary = GNUNET_OS_get_binary_path ("gnunet-helper-dns", helper_path); | ||
1092 | GNUNET_free_non_null (helper_path); | ||
1086 | if (GNUNET_YES != | 1093 | if (GNUNET_YES != |
1087 | GNUNET_OS_check_helper_binary (binary, | 1094 | GNUNET_OS_check_helper_binary (binary, |
1088 | GNUNET_YES, | 1095 | GNUNET_YES, |
@@ -1095,7 +1102,6 @@ run (void *cls, | |||
1095 | GNUNET_free (binary); | 1102 | GNUNET_free (binary); |
1096 | return; | 1103 | return; |
1097 | } | 1104 | } |
1098 | GNUNET_free (binary); | ||
1099 | 1105 | ||
1100 | helper_argv[0] = GNUNET_strdup ("gnunet-dns"); | 1106 | helper_argv[0] = GNUNET_strdup ("gnunet-dns"); |
1101 | if (GNUNET_SYSERR == | 1107 | if (GNUNET_SYSERR == |
@@ -1106,6 +1112,7 @@ run (void *cls, | |||
1106 | { | 1112 | { |
1107 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1113 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1108 | "No entry 'IFNAME' in configuration!\n"); | 1114 | "No entry 'IFNAME' in configuration!\n"); |
1115 | GNUNET_free (binary); | ||
1109 | GNUNET_SCHEDULER_shutdown (); | 1116 | GNUNET_SCHEDULER_shutdown (); |
1110 | return; | 1117 | return; |
1111 | } | 1118 | } |
@@ -1118,6 +1125,7 @@ run (void *cls, | |||
1118 | { | 1125 | { |
1119 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1126 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1120 | "No entry 'IPV6ADDR' in configuration!\n"); | 1127 | "No entry 'IPV6ADDR' in configuration!\n"); |
1128 | GNUNET_free (binary); | ||
1121 | GNUNET_SCHEDULER_shutdown (); | 1129 | GNUNET_SCHEDULER_shutdown (); |
1122 | return; | 1130 | return; |
1123 | } | 1131 | } |
@@ -1130,6 +1138,7 @@ run (void *cls, | |||
1130 | { | 1138 | { |
1131 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1139 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1132 | "No entry 'IPV6PREFIX' in configuration!\n"); | 1140 | "No entry 'IPV6PREFIX' in configuration!\n"); |
1141 | GNUNET_free (binary); | ||
1133 | GNUNET_SCHEDULER_shutdown (); | 1142 | GNUNET_SCHEDULER_shutdown (); |
1134 | return; | 1143 | return; |
1135 | } | 1144 | } |
@@ -1143,6 +1152,7 @@ run (void *cls, | |||
1143 | { | 1152 | { |
1144 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1153 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1145 | "No entry 'IPV4ADDR' in configuration!\n"); | 1154 | "No entry 'IPV4ADDR' in configuration!\n"); |
1155 | GNUNET_free (binary); | ||
1146 | GNUNET_SCHEDULER_shutdown (); | 1156 | GNUNET_SCHEDULER_shutdown (); |
1147 | return; | 1157 | return; |
1148 | } | 1158 | } |
@@ -1153,6 +1163,7 @@ run (void *cls, | |||
1153 | { | 1163 | { |
1154 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1164 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1155 | "No entry 'IPV4MASK' in configuration!\n"); | 1165 | "No entry 'IPV4MASK' in configuration!\n"); |
1166 | GNUNET_free (binary); | ||
1156 | GNUNET_SCHEDULER_shutdown (); | 1167 | GNUNET_SCHEDULER_shutdown (); |
1157 | return; | 1168 | return; |
1158 | } | 1169 | } |
@@ -1167,10 +1178,11 @@ run (void *cls, | |||
1167 | 1178 | ||
1168 | helper_argv[7] = NULL; | 1179 | helper_argv[7] = NULL; |
1169 | hijacker = GNUNET_HELPER_start (GNUNET_NO, | 1180 | hijacker = GNUNET_HELPER_start (GNUNET_NO, |
1170 | "gnunet-helper-dns", | 1181 | binary, |
1171 | helper_argv, | 1182 | helper_argv, |
1172 | &process_helper_messages, | 1183 | &process_helper_messages, |
1173 | NULL, NULL); | 1184 | NULL, NULL); |
1185 | GNUNET_free (binary); | ||
1174 | } | 1186 | } |
1175 | 1187 | ||
1176 | 1188 | ||
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index fc29849b5..f1478d574 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c | |||
@@ -3778,6 +3778,7 @@ run (void *cls, | |||
3778 | }; | 3778 | }; |
3779 | struct GNUNET_HashCode port; | 3779 | struct GNUNET_HashCode port; |
3780 | char *policy; | 3780 | char *policy; |
3781 | char *helper_path; | ||
3781 | char *binary; | 3782 | char *binary; |
3782 | char *regex; | 3783 | char *regex; |
3783 | char *prefixed_regex; | 3784 | char *prefixed_regex; |
@@ -3797,7 +3798,14 @@ run (void *cls, | |||
3797 | GNUNET_SCHEDULER_shutdown (); | 3798 | GNUNET_SCHEDULER_shutdown (); |
3798 | return; | 3799 | return; |
3799 | } | 3800 | } |
3800 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit"); | 3801 | helper_path = NULL; |
3802 | GNUNET_CONFIGURATION_get_value_string (cfg, | ||
3803 | "exit", | ||
3804 | "HELPER_PATH", | ||
3805 | &helper_path); | ||
3806 | binary = GNUNET_OS_get_binary_path ("gnunet-helper-exit", | ||
3807 | helper_path); | ||
3808 | GNUNET_free_non_null (helper_path); | ||
3801 | if (GNUNET_YES != | 3809 | if (GNUNET_YES != |
3802 | GNUNET_OS_check_helper_binary (binary, | 3810 | GNUNET_OS_check_helper_binary (binary, |
3803 | GNUNET_YES, | 3811 | GNUNET_YES, |
@@ -3812,7 +3820,6 @@ run (void *cls, | |||
3812 | global_ret = 1; | 3820 | global_ret = 1; |
3813 | return; | 3821 | return; |
3814 | } | 3822 | } |
3815 | GNUNET_free (binary); | ||
3816 | GNUNET_SCHEDULER_add_shutdown (&cleanup, | 3823 | GNUNET_SCHEDULER_add_shutdown (&cleanup, |
3817 | NULL); | 3824 | NULL); |
3818 | stats = GNUNET_STATISTICS_create ("exit", | 3825 | stats = GNUNET_STATISTICS_create ("exit", |
@@ -3820,6 +3827,7 @@ run (void *cls, | |||
3820 | cadet_handle = GNUNET_CADET_connect (cfg); | 3827 | cadet_handle = GNUNET_CADET_connect (cfg); |
3821 | if (NULL == cadet_handle) | 3828 | if (NULL == cadet_handle) |
3822 | { | 3829 | { |
3830 | GNUNET_free (binary); | ||
3823 | GNUNET_SCHEDULER_shutdown (); | 3831 | GNUNET_SCHEDULER_shutdown (); |
3824 | return; | 3832 | return; |
3825 | } | 3833 | } |
@@ -3827,6 +3835,7 @@ run (void *cls, | |||
3827 | if (GNUNET_OK != | 3835 | if (GNUNET_OK != |
3828 | setup_exit_helper_args ()) | 3836 | setup_exit_helper_args ()) |
3829 | { | 3837 | { |
3838 | GNUNET_free (binary); | ||
3830 | GNUNET_SCHEDULER_shutdown (); | 3839 | GNUNET_SCHEDULER_shutdown (); |
3831 | return; | 3840 | return; |
3832 | } | 3841 | } |
@@ -3923,11 +3932,12 @@ run (void *cls, | |||
3923 | } | 3932 | } |
3924 | } | 3933 | } |
3925 | helper_handle = GNUNET_HELPER_start (GNUNET_NO, | 3934 | helper_handle = GNUNET_HELPER_start (GNUNET_NO, |
3926 | "gnunet-helper-exit", | 3935 | binary, |
3927 | exit_argv, | 3936 | exit_argv, |
3928 | &message_token, | 3937 | &message_token, |
3929 | NULL, | 3938 | NULL, |
3930 | NULL); | 3939 | NULL); |
3940 | GNUNET_free (binary); | ||
3931 | } | 3941 | } |
3932 | 3942 | ||
3933 | 3943 | ||
diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c index 8d771f474..2498a990a 100644 --- a/src/nat/gnunet-service-nat.c +++ b/src/nat/gnunet-service-nat.c | |||
@@ -1063,7 +1063,8 @@ run_scan (void *cls) | |||
1063 | sizeof (*s4))); | 1063 | sizeof (*s4))); |
1064 | pos->hc = GN_start_gnunet_nat_server_ (&s4->sin_addr, | 1064 | pos->hc = GN_start_gnunet_nat_server_ (&s4->sin_addr, |
1065 | &reversal_callback, | 1065 | &reversal_callback, |
1066 | pos); | 1066 | pos, |
1067 | cfg); | ||
1067 | } | 1068 | } |
1068 | } | 1069 | } |
1069 | } | 1070 | } |
@@ -1826,7 +1827,8 @@ handle_request_connection_reversal (void *cls, | |||
1826 | GNUNET_break_op (AF_INET == r4.sin_family); | 1827 | GNUNET_break_op (AF_INET == r4.sin_family); |
1827 | ret = GN_request_connection_reversal (&l4.sin_addr, | 1828 | ret = GN_request_connection_reversal (&l4.sin_addr, |
1828 | ntohs (l4.sin_port), | 1829 | ntohs (l4.sin_port), |
1829 | &r4.sin_addr); | 1830 | &r4.sin_addr, |
1831 | cfg); | ||
1830 | if (GNUNET_OK != ret) | 1832 | if (GNUNET_OK != ret) |
1831 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1833 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1832 | _("Connection reversal request failed\n")); | 1834 | _("Connection reversal request failed\n")); |
diff --git a/src/nat/gnunet-service-nat_helper.c b/src/nat/gnunet-service-nat_helper.c index 56090bcea..d2ef934a6 100644 --- a/src/nat/gnunet-service-nat_helper.c +++ b/src/nat/gnunet-service-nat_helper.c | |||
@@ -74,6 +74,11 @@ struct HelperContext | |||
74 | * stdout file handle (for reading) for the gnunet-helper-nat-server process | 74 | * stdout file handle (for reading) for the gnunet-helper-nat-server process |
75 | */ | 75 | */ |
76 | const struct GNUNET_DISK_FileHandle *server_stdout_handle; | 76 | const struct GNUNET_DISK_FileHandle *server_stdout_handle; |
77 | |||
78 | /** | ||
79 | * Handle to the GNUnet configuration | ||
80 | */ | ||
81 | const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
77 | }; | 82 | }; |
78 | 83 | ||
79 | 84 | ||
@@ -217,6 +222,7 @@ static void | |||
217 | restart_nat_server (void *cls) | 222 | restart_nat_server (void *cls) |
218 | { | 223 | { |
219 | struct HelperContext *h = cls; | 224 | struct HelperContext *h = cls; |
225 | char *helper_path; | ||
220 | char *binary; | 226 | char *binary; |
221 | char ia[INET_ADDRSTRLEN]; | 227 | char ia[INET_ADDRSTRLEN]; |
222 | 228 | ||
@@ -227,8 +233,13 @@ restart_nat_server (void *cls) | |||
227 | ia, | 233 | ia, |
228 | sizeof (ia))); | 234 | sizeof (ia))); |
229 | /* Start the server process */ | 235 | /* Start the server process */ |
230 | binary | 236 | helper_path = NULL; |
231 | = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-server"); | 237 | GNUNET_CONFIGURATION_get_value_string (h->cfg, |
238 | "NAT", | ||
239 | "HELPER_PATH", | ||
240 | &helper_path); | ||
241 | binary = GNUNET_OS_get_binary_path ("gnunet-helper-nat-server", helper_path); | ||
242 | GNUNET_free_non_null (helper_path); | ||
232 | if (GNUNET_YES != | 243 | if (GNUNET_YES != |
233 | GNUNET_OS_check_helper_binary (binary, | 244 | GNUNET_OS_check_helper_binary (binary, |
234 | GNUNET_YES, | 245 | GNUNET_YES, |
@@ -298,12 +309,14 @@ restart_nat_server (void *cls) | |||
298 | * @param internal_address | 309 | * @param internal_address |
299 | * @param cb function to call if we receive a request | 310 | * @param cb function to call if we receive a request |
300 | * @param cb_cls closure for @a cb | 311 | * @param cb_cls closure for @a cb |
312 | * @param cfg Handle to the GNUnet configuration | ||
301 | * @return NULL on error | 313 | * @return NULL on error |
302 | */ | 314 | */ |
303 | struct HelperContext * | 315 | struct HelperContext * |
304 | GN_start_gnunet_nat_server_ (const struct in_addr *internal_address, | 316 | GN_start_gnunet_nat_server_ (const struct in_addr *internal_address, |
305 | GN_ReversalCallback cb, | 317 | GN_ReversalCallback cb, |
306 | void *cb_cls) | 318 | void *cb_cls, |
319 | const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
307 | { | 320 | { |
308 | struct HelperContext *h; | 321 | struct HelperContext *h; |
309 | 322 | ||
@@ -311,6 +324,7 @@ GN_start_gnunet_nat_server_ (const struct in_addr *internal_address, | |||
311 | h->cb = cb; | 324 | h->cb = cb; |
312 | h->cb_cls = cb_cls; | 325 | h->cb_cls = cb_cls; |
313 | h->internal_address = *internal_address; | 326 | h->internal_address = *internal_address; |
327 | h->cfg = cfg; | ||
314 | restart_nat_server (h); | 328 | restart_nat_server (h); |
315 | if (NULL == h->server_stdout) | 329 | if (NULL == h->server_stdout) |
316 | { | 330 | { |
@@ -366,18 +380,21 @@ GN_stop_gnunet_nat_server_ (struct HelperContext *h) | |||
366 | * @param internal_address out internal address to use | 380 | * @param internal_address out internal address to use |
367 | * @param internal_port port to use | 381 | * @param internal_port port to use |
368 | * @param remote_v4 the address of the peer (IPv4-only) | 382 | * @param remote_v4 the address of the peer (IPv4-only) |
383 | * @param cfg handle to the GNUnet configuration | ||
369 | * @return #GNUNET_SYSERR on error, | 384 | * @return #GNUNET_SYSERR on error, |
370 | * #GNUNET_OK otherwise | 385 | * #GNUNET_OK otherwise |
371 | */ | 386 | */ |
372 | int | 387 | int |
373 | GN_request_connection_reversal (const struct in_addr *internal_address, | 388 | GN_request_connection_reversal (const struct in_addr *internal_address, |
374 | uint16_t internal_port, | 389 | uint16_t internal_port, |
375 | const struct in_addr *remote_v4) | 390 | const struct in_addr *remote_v4, |
391 | const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
376 | { | 392 | { |
377 | char intv4[INET_ADDRSTRLEN]; | 393 | char intv4[INET_ADDRSTRLEN]; |
378 | char remv4[INET_ADDRSTRLEN]; | 394 | char remv4[INET_ADDRSTRLEN]; |
379 | char port_as_string[6]; | 395 | char port_as_string[6]; |
380 | struct GNUNET_OS_Process *proc; | 396 | struct GNUNET_OS_Process *proc; |
397 | char *helper_path; | ||
381 | char *binary; | 398 | char *binary; |
382 | 399 | ||
383 | if (NULL == inet_ntop (AF_INET, | 400 | if (NULL == inet_ntop (AF_INET, |
@@ -407,8 +424,13 @@ GN_request_connection_reversal (const struct in_addr *internal_address, | |||
407 | intv4, | 424 | intv4, |
408 | remv4, | 425 | remv4, |
409 | internal_port); | 426 | internal_port); |
410 | binary | 427 | helper_path = NULL; |
411 | = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-client"); | 428 | GNUNET_CONFIGURATION_get_value_string (cfg, |
429 | "PATHS", | ||
430 | "SETUID_PATHS", | ||
431 | &helper_path); | ||
432 | binary = GNUNET_OS_get_binary_path ("gnunet-helper-nat-client", helper_path); | ||
433 | GNUNET_free_non_null (helper_path); | ||
412 | proc | 434 | proc |
413 | = GNUNET_OS_start_process (GNUNET_NO, | 435 | = GNUNET_OS_start_process (GNUNET_NO, |
414 | 0, | 436 | 0, |
diff --git a/src/nat/gnunet-service-nat_helper.h b/src/nat/gnunet-service-nat_helper.h index d9294d949..e2f7e3355 100644 --- a/src/nat/gnunet-service-nat_helper.h +++ b/src/nat/gnunet-service-nat_helper.h | |||
@@ -53,12 +53,14 @@ typedef void | |||
53 | * @param internal_address | 53 | * @param internal_address |
54 | * @param cb function to call if we receive a request | 54 | * @param cb function to call if we receive a request |
55 | * @param cb_cls closure for @a cb | 55 | * @param cb_cls closure for @a cb |
56 | * @param cfg Handle to the GNUnet configuration | ||
56 | * @return NULL on error | 57 | * @return NULL on error |
57 | */ | 58 | */ |
58 | struct HelperContext * | 59 | struct HelperContext * |
59 | GN_start_gnunet_nat_server_ (const struct in_addr *internal_address, | 60 | GN_start_gnunet_nat_server_ (const struct in_addr *internal_address, |
60 | GN_ReversalCallback cb, | 61 | GN_ReversalCallback cb, |
61 | void *cb_cls); | 62 | void *cb_cls, |
63 | const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
62 | 64 | ||
63 | 65 | ||
64 | /** | 66 | /** |
@@ -77,15 +79,17 @@ GN_stop_gnunet_nat_server_ (struct HelperContext *h); | |||
77 | * that peer to connect to us (connection reversal). | 79 | * that peer to connect to us (connection reversal). |
78 | * | 80 | * |
79 | * @param internal_address out internal address to use | 81 | * @param internal_address out internal address to use |
80 | * @param internal_port internal port to use | 82 | * @param internal_port port to use |
81 | * @param remote_v4 the address of the peer (IPv4-only) | 83 | * @param remote_v4 the address of the peer (IPv4-only) |
84 | * @param cfg handle to the GNUnet configuration | ||
82 | * @return #GNUNET_SYSERR on error, | 85 | * @return #GNUNET_SYSERR on error, |
83 | * #GNUNET_OK otherwise | 86 | * #GNUNET_OK otherwise |
84 | */ | 87 | */ |
85 | int | 88 | int |
86 | GN_request_connection_reversal (const struct in_addr *internal_address, | 89 | GN_request_connection_reversal (const struct in_addr *internal_address, |
87 | uint16_t internal_port, | 90 | uint16_t internal_port, |
88 | const struct in_addr *sa); | 91 | const struct in_addr *remote_v4, |
92 | const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
89 | 93 | ||
90 | 94 | ||
91 | /* end of gnunet-service-nat_helper.h */ | 95 | /* end of gnunet-service-nat_helper.h */ |
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index 91bc13fd8..7f9209b67 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c | |||
@@ -2934,10 +2934,17 @@ run (void *cls, | |||
2934 | char *ipv4mask; | 2934 | char *ipv4mask; |
2935 | struct in_addr v4; | 2935 | struct in_addr v4; |
2936 | struct in6_addr v6; | 2936 | struct in6_addr v6; |
2937 | char *helper_path; | ||
2937 | char *binary; | 2938 | char *binary; |
2938 | 2939 | ||
2939 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-vpn"); | 2940 | cfg = cfg_; |
2940 | 2941 | helper_path = NULL; | |
2942 | GNUNET_CONFIGURATION_get_value_string (cfg, | ||
2943 | "VPN", | ||
2944 | "HELPER_PATH", | ||
2945 | &helper_path); | ||
2946 | binary = GNUNET_OS_get_binary_path ("gnunet-helper-vpn", helper_path); | ||
2947 | GNUNET_free_non_null (helper_path); | ||
2941 | if (GNUNET_YES != | 2948 | if (GNUNET_YES != |
2942 | GNUNET_OS_check_helper_binary (binary, | 2949 | GNUNET_OS_check_helper_binary (binary, |
2943 | GNUNET_YES, | 2950 | GNUNET_YES, |
@@ -2953,8 +2960,6 @@ run (void *cls, | |||
2953 | anything either */ | 2960 | anything either */ |
2954 | return; | 2961 | return; |
2955 | } | 2962 | } |
2956 | GNUNET_free (binary); | ||
2957 | cfg = cfg_; | ||
2958 | stats = GNUNET_STATISTICS_create ("vpn", cfg); | 2963 | stats = GNUNET_STATISTICS_create ("vpn", cfg); |
2959 | if (GNUNET_OK != | 2964 | if (GNUNET_OK != |
2960 | GNUNET_CONFIGURATION_get_value_number (cfg, | 2965 | GNUNET_CONFIGURATION_get_value_number (cfg, |
@@ -2980,6 +2985,7 @@ run (void *cls, | |||
2980 | GNUNET_CONFIGURATION_get_value_string (cfg, "VPN", "IFNAME", &ifname)) | 2985 | GNUNET_CONFIGURATION_get_value_string (cfg, "VPN", "IFNAME", &ifname)) |
2981 | { | 2986 | { |
2982 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "VPN", "IFNAME"); | 2987 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "VPN", "IFNAME"); |
2988 | GNUNET_free (binary); | ||
2983 | GNUNET_SCHEDULER_shutdown (); | 2989 | GNUNET_SCHEDULER_shutdown (); |
2984 | return; | 2990 | return; |
2985 | } | 2991 | } |
@@ -2995,6 +3001,7 @@ run (void *cls, | |||
2995 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV6ADDR", | 3001 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV6ADDR", |
2996 | _("Must specify valid IPv6 address")); | 3002 | _("Must specify valid IPv6 address")); |
2997 | GNUNET_SCHEDULER_shutdown (); | 3003 | GNUNET_SCHEDULER_shutdown (); |
3004 | GNUNET_free (binary); | ||
2998 | GNUNET_free_non_null (ipv6addr); | 3005 | GNUNET_free_non_null (ipv6addr); |
2999 | return; | 3006 | return; |
3000 | } | 3007 | } |
@@ -3006,6 +3013,7 @@ run (void *cls, | |||
3006 | { | 3013 | { |
3007 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV6PREFIX"); | 3014 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV6PREFIX"); |
3008 | GNUNET_SCHEDULER_shutdown (); | 3015 | GNUNET_SCHEDULER_shutdown (); |
3016 | GNUNET_free (binary); | ||
3009 | GNUNET_free_non_null (ipv6prefix_s); | 3017 | GNUNET_free_non_null (ipv6prefix_s); |
3010 | return; | 3018 | return; |
3011 | } | 3019 | } |
@@ -3018,6 +3026,7 @@ run (void *cls, | |||
3018 | { | 3026 | { |
3019 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV4MASK", | 3027 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV4MASK", |
3020 | _("Must specify valid IPv6 mask")); | 3028 | _("Must specify valid IPv6 mask")); |
3029 | GNUNET_free (binary); | ||
3021 | GNUNET_SCHEDULER_shutdown (); | 3030 | GNUNET_SCHEDULER_shutdown (); |
3022 | return; | 3031 | return; |
3023 | } | 3032 | } |
@@ -3039,6 +3048,7 @@ run (void *cls, | |||
3039 | { | 3048 | { |
3040 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV4ADDR", | 3049 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV4ADDR", |
3041 | _("Must specify valid IPv4 address")); | 3050 | _("Must specify valid IPv4 address")); |
3051 | GNUNET_free (binary); | ||
3042 | GNUNET_SCHEDULER_shutdown (); | 3052 | GNUNET_SCHEDULER_shutdown (); |
3043 | GNUNET_free_non_null (ipv4addr); | 3053 | GNUNET_free_non_null (ipv4addr); |
3044 | return; | 3054 | return; |
@@ -3053,6 +3063,7 @@ run (void *cls, | |||
3053 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV4MASK", | 3063 | GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV4MASK", |
3054 | _("Must specify valid IPv4 mask")); | 3064 | _("Must specify valid IPv4 mask")); |
3055 | GNUNET_SCHEDULER_shutdown (); | 3065 | GNUNET_SCHEDULER_shutdown (); |
3066 | GNUNET_free (binary); | ||
3056 | GNUNET_free_non_null (ipv4mask); | 3067 | GNUNET_free_non_null (ipv4mask); |
3057 | return; | 3068 | return; |
3058 | } | 3069 | } |
@@ -3070,8 +3081,9 @@ run (void *cls, | |||
3070 | cadet_handle = GNUNET_CADET_connect (cfg_); | 3081 | cadet_handle = GNUNET_CADET_connect (cfg_); |
3071 | // FIXME never opens ports??? | 3082 | // FIXME never opens ports??? |
3072 | helper_handle = GNUNET_HELPER_start (GNUNET_NO, | 3083 | helper_handle = GNUNET_HELPER_start (GNUNET_NO, |
3073 | "gnunet-helper-vpn", vpn_argv, | 3084 | binary, vpn_argv, |
3074 | &message_token, NULL, NULL); | 3085 | &message_token, NULL, NULL); |
3086 | GNUNET_free (binary); | ||
3075 | GNUNET_SCHEDULER_add_shutdown (&cleanup, | 3087 | GNUNET_SCHEDULER_add_shutdown (&cleanup, |
3076 | NULL); | 3088 | NULL); |
3077 | } | 3089 | } |