diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-04-01 09:58:45 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-04-01 09:58:45 +0000 |
commit | 28e0e4db61df4d4309a961e364ea9e2cb2ba5846 (patch) | |
tree | d10f5ac1977766b7ffabe30dd799ad7d5dbb2002 /src/dns | |
parent | d3df9ed4661a3f762cb92b40396037320cac4a33 (diff) | |
download | gnunet-28e0e4db61df4d4309a961e364ea9e2cb2ba5846.tar.gz gnunet-28e0e4db61df4d4309a961e364ea9e2cb2ba5846.zip |
-fixing #2243
Diffstat (limited to 'src/dns')
-rw-r--r-- | src/dns/gnunet-service-dns.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index 37d2fbca8..fbb27e4bc 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c | |||
@@ -290,6 +290,11 @@ struct TunnelState | |||
290 | 290 | ||
291 | 291 | ||
292 | /** | 292 | /** |
293 | * Global return value from 'main'. | ||
294 | */ | ||
295 | static int global_ret; | ||
296 | |||
297 | /** | ||
293 | * The configuration to use | 298 | * The configuration to use |
294 | */ | 299 | */ |
295 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 300 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
@@ -1552,6 +1557,16 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
1552 | struct in6_addr dns_exit6; | 1557 | struct in6_addr dns_exit6; |
1553 | 1558 | ||
1554 | cfg = cfg_; | 1559 | cfg = cfg_; |
1560 | if (GNUNET_YES != | ||
1561 | GNUNET_OS_check_helper_binary ("gnunet-helper-dns")) | ||
1562 | { | ||
1563 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
1564 | _("`%s' must be installed SUID, refusing to run\n"), | ||
1565 | "gnunet-helper-dns"); | ||
1566 | global_ret = 1; | ||
1567 | return; | ||
1568 | } | ||
1569 | |||
1555 | stats = GNUNET_STATISTICS_create ("dns", cfg); | 1570 | stats = GNUNET_STATISTICS_create ("dns", cfg); |
1556 | nc = GNUNET_SERVER_notification_context_create (server, 1); | 1571 | nc = GNUNET_SERVER_notification_context_create (server, 1); |
1557 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task, | 1572 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task, |
@@ -1662,7 +1677,7 @@ main (int argc, char *const *argv) | |||
1662 | { | 1677 | { |
1663 | return (GNUNET_OK == | 1678 | return (GNUNET_OK == |
1664 | GNUNET_SERVICE_run (argc, argv, "dns", GNUNET_SERVICE_OPTION_NONE, | 1679 | GNUNET_SERVICE_run (argc, argv, "dns", GNUNET_SERVICE_OPTION_NONE, |
1665 | &run, NULL)) ? 0 : 1; | 1680 | &run, NULL)) ? global_ret : 1; |
1666 | } | 1681 | } |
1667 | 1682 | ||
1668 | 1683 | ||