diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-12-21 14:42:18 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-12-21 14:42:18 +0000 |
commit | 159da73869b11137dd8c12c14266f1a2e18f223b (patch) | |
tree | 7349bf65dfd2ca93ec9268f41f5186ac269f7028 | |
parent | 8a3f6ada0a51722084e8ff7b8d9463f51e5d2cbe (diff) | |
download | gnunet-159da73869b11137dd8c12c14266f1a2e18f223b.tar.gz gnunet-159da73869b11137dd8c12c14266f1a2e18f223b.zip |
-check for helpers in libexec
-rw-r--r-- | src/dns/gnunet-service-dns.c | 9 | ||||
-rw-r--r-- | src/gns/test_gns_proxy.c | 7 | ||||
-rw-r--r-- | src/pt/test_gns_vpn.c | 20 |
3 files changed, 27 insertions, 9 deletions
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index aaa5f3dd1..5db14c56a 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c | |||
@@ -1272,18 +1272,21 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
1272 | struct in_addr dns_exit4; | 1272 | struct in_addr dns_exit4; |
1273 | struct in6_addr dns_exit6; | 1273 | struct in6_addr dns_exit6; |
1274 | char *dns_exit; | 1274 | char *dns_exit; |
1275 | char *binary; | ||
1275 | 1276 | ||
1276 | cfg = cfg_; | 1277 | cfg = cfg_; |
1278 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-dns"); | ||
1277 | if (GNUNET_YES != | 1279 | if (GNUNET_YES != |
1278 | GNUNET_OS_check_helper_binary ("gnunet-helper-dns")) | 1280 | GNUNET_OS_check_helper_binary (binary)) |
1279 | { | 1281 | { |
1280 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1282 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1281 | _("`%s' must be installed SUID, refusing to run\n"), | 1283 | _("`%s' must be installed SUID, refusing to run\n"), |
1282 | "gnunet-helper-dns"); | 1284 | binary); |
1283 | global_ret = 1; | 1285 | global_ret = 1; |
1286 | GNUNET_free (binary); | ||
1284 | return; | 1287 | return; |
1285 | } | 1288 | } |
1286 | 1289 | GNUNET_free (binary); | |
1287 | stats = GNUNET_STATISTICS_create ("dns", cfg); | 1290 | stats = GNUNET_STATISTICS_create ("dns", cfg); |
1288 | nc = GNUNET_SERVER_notification_context_create (server, 1); | 1291 | nc = GNUNET_SERVER_notification_context_create (server, 1); |
1289 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task, | 1292 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task, |
diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c index 545551411..4fcd2fd56 100644 --- a/src/gns/test_gns_proxy.c +++ b/src/gns/test_gns_proxy.c | |||
@@ -444,18 +444,21 @@ run (void *cls, | |||
444 | int | 444 | int |
445 | main (int argc, char *const *argv) | 445 | main (int argc, char *const *argv) |
446 | { | 446 | { |
447 | char *binary; | ||
447 | 448 | ||
448 | if (GNUNET_SYSERR == GNUNET_OS_check_helper_binary ("gnunet-gns-proxy")) | 449 | if (GNUNET_SYSERR == GNUNET_OS_check_helper_binary ("gnunet-gns-proxy")) |
449 | { | 450 | { |
450 | fprintf (stderr, "Proxy binary not in PATH... skipping!\n"); | 451 | fprintf (stderr, "Proxy binary not in PATH... skipping!\n"); |
451 | return 0; | 452 | return 0; |
452 | } | 453 | } |
453 | 454 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-dns"); | |
454 | if (GNUNET_YES != GNUNET_OS_check_helper_binary ("gnunet-helper-dns")) | 455 | if (GNUNET_YES != GNUNET_OS_check_helper_binary (binary)) |
455 | { | 456 | { |
456 | fprintf (stderr, "DNS helper binary has wrong permissions... skipping!\n"); | 457 | fprintf (stderr, "DNS helper binary has wrong permissions... skipping!\n"); |
458 | GNUNET_free (binary); | ||
457 | return 0; | 459 | return 0; |
458 | } | 460 | } |
461 | GNUNET_free (binary); | ||
459 | 462 | ||
460 | GNUNET_CRYPTO_rsa_setup_hostkey ("test_gns_proxy.conf"); | 463 | GNUNET_CRYPTO_rsa_setup_hostkey ("test_gns_proxy.conf"); |
461 | 464 | ||
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c index 32283bad4..dd21f9dcd 100644 --- a/src/pt/test_gns_vpn.c +++ b/src/pt/test_gns_vpn.c | |||
@@ -501,6 +501,9 @@ int | |||
501 | main (int argc, char *const *argv) | 501 | main (int argc, char *const *argv) |
502 | { | 502 | { |
503 | char *sbin_iptables; | 503 | char *sbin_iptables; |
504 | char *bin_vpn; | ||
505 | char *bin_exit; | ||
506 | char *bin_dns; | ||
504 | char *const iptables_args[] = | 507 | char *const iptables_args[] = |
505 | { | 508 | { |
506 | "iptables", "-t", "mangle", "-L", "-v", NULL | 509 | "iptables", "-t", "mangle", "-L", "-v", NULL |
@@ -535,20 +538,29 @@ main (int argc, char *const *argv) | |||
535 | return 0; | 538 | return 0; |
536 | } | 539 | } |
537 | 540 | ||
541 | bin_vpn = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-vpn"); | ||
542 | bin_exit = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-exit"); | ||
543 | bin_dns = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-dns"); | ||
538 | if ( (0 != geteuid ()) && | 544 | if ( (0 != geteuid ()) && |
539 | ( (GNUNET_YES != | 545 | ( (GNUNET_YES != |
540 | GNUNET_OS_check_helper_binary ("gnunet-helper-vpn")) || | 546 | GNUNET_OS_check_helper_binary (bin_vpn)) || |
541 | (GNUNET_YES != | 547 | (GNUNET_YES != |
542 | GNUNET_OS_check_helper_binary ("gnunet-helper-exit")) || | 548 | GNUNET_OS_check_helper_binary (bin_exit)) || |
543 | (GNUNET_YES != | 549 | (GNUNET_YES != |
544 | GNUNET_OS_check_helper_binary ("gnunet-helper-dns"))) ) | 550 | GNUNET_OS_check_helper_binary (bin_dns))) ) |
545 | { | 551 | { |
546 | fprintf (stderr, | 552 | fprintf (stderr, |
547 | "WARNING: gnunet-helper-{exit,vpn,dns} binaries in $PATH are not SUID, refusing to run test (as it would have to fail).\n"); | 553 | "WARNING: gnunet-helper-{exit,vpn,dns} binaries in $PATH are not SUID, refusing to run test (as it would have to fail).\n"); |
548 | fprintf (stderr, | 554 | fprintf (stderr, |
549 | "Change $PATH ('.' in $PATH before $GNUNET_PREFIX/bin is problematic) or permissions (run 'make install' as root) to fix this!\n"); | 555 | "Change $PATH ('.' in $PATH before $GNUNET_PREFIX/bin is problematic) or permissions (run 'make install' as root) to fix this!\n"); |
556 | GNUNET_free (bin_vpn); | ||
557 | GNUNET_free (bin_exit); | ||
558 | GNUNET_free (bin_dns); | ||
550 | return 0; | 559 | return 0; |
551 | } | 560 | } |
561 | GNUNET_free (bin_vpn); | ||
562 | GNUNET_free (bin_exit); | ||
563 | GNUNET_free (bin_dns); | ||
552 | GNUNET_CRYPTO_rsa_setup_hostkey ("test_gns_vpn.conf"); | 564 | GNUNET_CRYPTO_rsa_setup_hostkey ("test_gns_vpn.conf"); |
553 | 565 | ||
554 | dest_ip = "169.254.86.1"; | 566 | dest_ip = "169.254.86.1"; |