aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-11-01 22:18:42 +0000
committerChristian Grothoff <christian@grothoff.org>2012-11-01 22:18:42 +0000
commit0c4dec07cadc333a3a1eaca9e8dbac827185e4e7 (patch)
tree2c40d7555130a1d19be85931ac6c75ffdf6f08b8 /src
parente5b30eb25d2994dc45f7944c5b0f1ce129cd41c5 (diff)
downloadgnunet-0c4dec07cadc333a3a1eaca9e8dbac827185e4e7.tar.gz
gnunet-0c4dec07cadc333a3a1eaca9e8dbac827185e4e7.zip
-more libexec fixes
Diffstat (limited to 'src')
-rw-r--r--src/exit/gnunet-daemon-exit.c6
-rw-r--r--src/pt/test_gnunet_vpn.c16
2 files changed, 16 insertions, 6 deletions
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index a8c8d8922..30be57845 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -2999,16 +2999,20 @@ run (void *cls, char *const *args GNUNET_UNUSED,
2999 char *ipv6prefix_s; 2999 char *ipv6prefix_s;
3000 char *ipv4addr; 3000 char *ipv4addr;
3001 char *ipv4mask; 3001 char *ipv4mask;
3002 char *binary;
3002 3003
3004 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit");
3003 if (GNUNET_YES != 3005 if (GNUNET_YES !=
3004 GNUNET_OS_check_helper_binary ("gnunet-helper-exit")) 3006 GNUNET_OS_check_helper_binary (binary))
3005 { 3007 {
3008 GNUNET_free (binary);
3006 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 3009 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
3007 _("`%s' must be installed SUID, refusing to run\n"), 3010 _("`%s' must be installed SUID, refusing to run\n"),
3008 "gnunet-helper-exit"); 3011 "gnunet-helper-exit");
3009 global_ret = 1; 3012 global_ret = 1;
3010 return; 3013 return;
3011 } 3014 }
3015 GNUNET_free (binary);
3012 cfg = cfg_; 3016 cfg = cfg_;
3013 stats = GNUNET_STATISTICS_create ("exit", cfg); 3017 stats = GNUNET_STATISTICS_create ("exit", cfg);
3014 ipv4_exit = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "EXIT_IPV4"); 3018 ipv4_exit = GNUNET_CONFIGURATION_get_value_yesno (cfg, "exit", "EXIT_IPV4");
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c
index 8b9bb2b20..6f6723d72 100644
--- a/src/pt/test_gnunet_vpn.c
+++ b/src/pt/test_gnunet_vpn.c
@@ -395,6 +395,8 @@ main (int argc, char *const *argv)
395{ 395{
396 const char *type; 396 const char *type;
397 const char *bin; 397 const char *bin;
398 char *vpn_binary;
399 char *exit_binary;
398 400
399 if (0 != ACCESS ("/dev/net/tun", R_OK)) 401 if (0 != ACCESS ("/dev/net/tun", R_OK))
400 { 402 {
@@ -403,15 +405,19 @@ main (int argc, char *const *argv)
403 fprintf (stderr, "WARNING: System unable to run test, skipping.\n"); 405 fprintf (stderr, "WARNING: System unable to run test, skipping.\n");
404 return 0; 406 return 0;
405 } 407 }
406 if ((GNUNET_YES != GNUNET_OS_check_helper_binary ("gnunet-helper-vpn")) || 408 vpn_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-vpn");
407 (GNUNET_YES != GNUNET_OS_check_helper_binary ("gnunet-helper-exit"))) 409 exit_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit");
410 if ((GNUNET_YES != GNUNET_OS_check_helper_binary (vpn_binary)) ||
411 (GNUNET_YES != GNUNET_OS_check_helper_binary (exit_binary)))
408 { 412 {
413 GNUNET_free (vpn_binary);
414 GNUNET_free (exit_binary);
409 fprintf (stderr, 415 fprintf (stderr,
410 "WARNING: gnunet-helper-{exit,vpn} binaries in $PATH are not SUID, refusing to run test (as it would have to fail).\n"); 416 "WARNING: gnunet-helper-{exit,vpn} binaries are not SUID, refusing to run test (as it would have to fail).\n");
411 fprintf (stderr,
412 "Change $PATH ('.' in $PATH before $GNUNET_PREFIX/bin is problematic) or permissions (run 'make install' as root) to fix this!\n");
413 return 0; 417 return 0;
414 } 418 }
419 GNUNET_free (vpn_binary);
420 GNUNET_free (exit_binary);
415 GNUNET_CRYPTO_rsa_setup_hostkey ("test_gnunet_vpn.conf"); 421 GNUNET_CRYPTO_rsa_setup_hostkey ("test_gnunet_vpn.conf");
416 bin = argv[0]; 422 bin = argv[0];
417 if (NULL != strstr (bin, "lt-")) 423 if (NULL != strstr (bin, "lt-"))