aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorChristian Ulrich <christian@ulrich.earth>2020-01-04 01:30:51 +0100
committerChristian Ulrich <christian@ulrich.earth>2020-01-04 01:30:51 +0100
commite7b3a8cdf0d10517fbfdcd247198ef6d36d5435e (patch)
tree27ee52f3b8f2767f63b565637c607789ddc40fc2 /src/vpn
parentdee0d325bf549ab79c019b233648e827eb9ce308 (diff)
downloadgnunet-e7b3a8cdf0d10517fbfdcd247198ef6d36d5435e.tar.gz
gnunet-e7b3a8cdf0d10517fbfdcd247198ef6d36d5435e.zip
use GNUNET_OS_get_suid_binary_path (was accidentally undone in merge f096bdce8)
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-service-vpn.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c
index 50c990b3a..62bc45e41 100644
--- a/src/vpn/gnunet-service-vpn.c
+++ b/src/vpn/gnunet-service-vpn.c
@@ -2940,7 +2940,8 @@ run (void *cls,
2940 struct in6_addr v6; 2940 struct in6_addr v6;
2941 char *binary; 2941 char *binary;
2942 2942
2943 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-vpn"); 2943 cfg = cfg_;
2944 binary = GNUNET_OS_get_suid_binary_path (cfg, "gnunet-helper-vpn");
2944 2945
2945 if (GNUNET_YES != 2946 if (GNUNET_YES !=
2946 GNUNET_OS_check_helper_binary ( 2947 GNUNET_OS_check_helper_binary (
@@ -2949,8 +2950,8 @@ run (void *cls,
2949 "-d gnunet-vpn - - 169.1.3.3.7 255.255.255.0")) // ipv4 only please! 2950 "-d gnunet-vpn - - 169.1.3.3.7 255.255.255.0")) // ipv4 only please!
2950 { 2951 {
2951 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 2952 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
2952 "`%s' is not SUID, refusing to run.\n", 2953 "`%s' is not SUID or the path is invalid, refusing to run.\n",
2953 "gnunet-helper-vpn"); 2954 binary);
2954 GNUNET_free (binary); 2955 GNUNET_free (binary);
2955 global_ret = 1; 2956 global_ret = 1;
2956 /* we won't "really" exit here, as the 'service' is still running; 2957 /* we won't "really" exit here, as the 'service' is still running;
@@ -2958,8 +2959,6 @@ run (void *cls,
2958 anything either */ 2959 anything either */
2959 return; 2960 return;
2960 } 2961 }
2961 GNUNET_free (binary);
2962 cfg = cfg_;
2963 stats = GNUNET_STATISTICS_create ("vpn", cfg); 2962 stats = GNUNET_STATISTICS_create ("vpn", cfg);
2964 if (GNUNET_OK != 2963 if (GNUNET_OK !=
2965 GNUNET_CONFIGURATION_get_value_number (cfg, 2964 GNUNET_CONFIGURATION_get_value_number (cfg,
@@ -2989,6 +2988,7 @@ run (void *cls,
2989 GNUNET_CONFIGURATION_get_value_string (cfg, "VPN", "IFNAME", &ifname)) 2988 GNUNET_CONFIGURATION_get_value_string (cfg, "VPN", "IFNAME", &ifname))
2990 { 2989 {
2991 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "VPN", "IFNAME"); 2990 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "VPN", "IFNAME");
2991 GNUNET_free (binary);
2992 GNUNET_SCHEDULER_shutdown (); 2992 GNUNET_SCHEDULER_shutdown ();
2993 return; 2993 return;
2994 } 2994 }
@@ -3006,6 +3006,7 @@ run (void *cls,
3006 "VPN", 3006 "VPN",
3007 "IPV6ADDR", 3007 "IPV6ADDR",
3008 _ ("Must specify valid IPv6 address")); 3008 _ ("Must specify valid IPv6 address"));
3009 GNUNET_free (binary);
3009 GNUNET_SCHEDULER_shutdown (); 3010 GNUNET_SCHEDULER_shutdown ();
3010 GNUNET_free_non_null (ipv6addr); 3011 GNUNET_free_non_null (ipv6addr);
3011 return; 3012 return;
@@ -3033,6 +3034,7 @@ run (void *cls,
3033 "VPN", 3034 "VPN",
3034 "IPV4MASK", 3035 "IPV4MASK",
3035 _ ("Must specify valid IPv6 mask")); 3036 _ ("Must specify valid IPv6 mask"));
3037 GNUNET_free (binary);
3036 GNUNET_SCHEDULER_shutdown (); 3038 GNUNET_SCHEDULER_shutdown ();
3037 return; 3039 return;
3038 } 3040 }
@@ -3058,6 +3060,7 @@ run (void *cls,
3058 "VPN", 3060 "VPN",
3059 "IPV4ADDR", 3061 "IPV4ADDR",
3060 _ ("Must specify valid IPv4 address")); 3062 _ ("Must specify valid IPv4 address"));
3063 GNUNET_free (binary);
3061 GNUNET_SCHEDULER_shutdown (); 3064 GNUNET_SCHEDULER_shutdown ();
3062 GNUNET_free_non_null (ipv4addr); 3065 GNUNET_free_non_null (ipv4addr);
3063 return; 3066 return;
@@ -3074,6 +3077,7 @@ run (void *cls,
3074 "VPN", 3077 "VPN",
3075 "IPV4MASK", 3078 "IPV4MASK",
3076 _ ("Must specify valid IPv4 mask")); 3079 _ ("Must specify valid IPv4 mask"));
3080 GNUNET_free (binary);
3077 GNUNET_SCHEDULER_shutdown (); 3081 GNUNET_SCHEDULER_shutdown ();
3078 GNUNET_free_non_null (ipv4mask); 3082 GNUNET_free_non_null (ipv4mask);
3079 return; 3083 return;
@@ -3093,11 +3097,12 @@ run (void *cls,
3093 cadet_handle = GNUNET_CADET_connect (cfg_); 3097 cadet_handle = GNUNET_CADET_connect (cfg_);
3094 // FIXME never opens ports??? 3098 // FIXME never opens ports???
3095 helper_handle = GNUNET_HELPER_start (GNUNET_NO, 3099 helper_handle = GNUNET_HELPER_start (GNUNET_NO,
3096 "gnunet-helper-vpn", 3100 binary,
3097 vpn_argv, 3101 vpn_argv,
3098 &message_token, 3102 &message_token,
3099 NULL, 3103 NULL,
3100 NULL); 3104 NULL);
3105 GNUNET_free (binary);
3101 GNUNET_SCHEDULER_add_shutdown (&cleanup, NULL); 3106 GNUNET_SCHEDULER_add_shutdown (&cleanup, NULL);
3102} 3107}
3103 3108