Also include a bunch of upstream patches to make things build. Signed-off-by: Daniel Golle <daniel@makrotopia.org>lilik-openwrt-22.03
@ -0,0 +1,58 @@ | |||
From 4446d990f39b4b39a2988c49faac4d1f8a71e31f Mon Sep 17 00:00:00 2001 | |||
From: Christian Grothoff <christian@grothoff.org> | |||
Date: Sun, 15 Dec 2019 23:26:12 +0100 | |||
Subject: [PATCH 02/12] fix sigpipe crash | |||
--- | |||
src/util/gnunet-qr.c | 14 ++++++++++++-- | |||
1 file changed, 12 insertions(+), 2 deletions(-) | |||
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c | |||
index be28a6e53..cdeea4db1 100644 | |||
--- a/src/util/gnunet-qr.c | |||
+++ b/src/util/gnunet-qr.c | |||
@@ -30,7 +30,7 @@ | |||
#include "gnunet_util_lib.h" | |||
#define LOG(fmt, ...) \ | |||
- if (verbose == true) \ | |||
+ if (verbose) \ | |||
printf (fmt, ## __VA_ARGS__) | |||
/** | |||
@@ -41,7 +41,7 @@ static char *device = "/dev/video0"; | |||
/** | |||
* --verbose option | |||
*/ | |||
-static int verbose = false; | |||
+static unsigned int verbose; | |||
/** | |||
* --silent option | |||
@@ -79,6 +79,11 @@ maint_child_death (void *cls) | |||
if ((GNUNET_OK != GNUNET_OS_process_status (p, &type, &exit_code)) || | |||
(type != GNUNET_OS_PROCESS_EXITED)) | |||
GNUNET_break (0 == GNUNET_OS_process_kill (p, GNUNET_TERM_SIG)); | |||
+ if (NULL != sigpipe) | |||
+ { | |||
+ GNUNET_DISK_pipe_close (sigpipe); | |||
+ sigpipe = NULL; | |||
+ } | |||
GNUNET_OS_process_destroy (p); | |||
} | |||
@@ -126,6 +131,11 @@ gnunet_uri (void *cls, | |||
return; | |||
} | |||
GNUNET_free (subsystem); | |||
+ sigpipe = GNUNET_DISK_pipe (GNUNET_NO, | |||
+ GNUNET_NO, | |||
+ GNUNET_NO, | |||
+ GNUNET_NO); | |||
+ GNUNET_assert (NULL != sigpipe); | |||
rt = GNUNET_SCHEDULER_add_read_file ( | |||
GNUNET_TIME_UNIT_FOREVER_REL, | |||
GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ), | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,25 @@ | |||
From d7fcff4a8995dab26ae87d9a3048282cbe639014 Mon Sep 17 00:00:00 2001 | |||
From: "Schanzenbach, Martin" <mschanzenbach@posteo.de> | |||
Date: Mon, 16 Dec 2019 09:33:36 +0100 | |||
Subject: [PATCH 03/12] fix mysql build | |||
--- | |||
src/my/my.c | 2 +- | |||
1 file changed, 1 insertion(+), 1 deletion(-) | |||
diff --git a/src/my/my.c b/src/my/my.c | |||
index a4099d088..256f71742 100644 | |||
--- a/src/my/my.c | |||
+++ b/src/my/my.c | |||
@@ -239,7 +239,7 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, | |||
mysql_stmt_free_result (stmt); | |||
for (unsigned int j = 0; j < i; j++) | |||
if (NULL != rs[j].cleaner) | |||
- rs[j].cleaner (rs[j].cls, | |||
+ rs[j].cleaner (rs[j].conv_cls, | |||
rs[j].dst); | |||
return GNUNET_SYSERR; | |||
} | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,335 @@ | |||
From 7d28a76ad5f6fc5db4a207fbd81a31b70cdb3866 Mon Sep 17 00:00:00 2001 | |||
From: "Schanzenbach, Martin" <mschanzenbach@posteo.de> | |||
Date: Mon, 16 Dec 2019 15:50:56 +0100 | |||
Subject: [PATCH 04/12] add changelog | |||
--- | |||
ChangeLog | 3 ++ | |||
po/POTFILES.in | 96 +++++++++++++++++++++++++------------------------- | |||
2 files changed, 51 insertions(+), 48 deletions(-) | |||
diff --git a/ChangeLog b/ChangeLog | |||
index be0e21e7b..3942f91de 100644 | |||
--- a/ChangeLog | |||
+++ b/ChangeLog | |||
@@ -1,3 +1,6 @@ | |||
+Mon Dec 16 09:33:36 2019 +0100 | |||
+ Fixed mysql build -schanzen | |||
+ | |||
Sun Dec 15 12:36:48 2019 +0100 | |||
Released gnunet 0.12.0 -schanzen | |||
diff --git a/po/POTFILES.in b/po/POTFILES.in | |||
index 8489f49c3..441d0f91d 100644 | |||
--- a/po/POTFILES.in | |||
+++ b/po/POTFILES.in | |||
@@ -10,13 +10,21 @@ src/arm/arm_monitor_api.c | |||
src/arm/gnunet-arm.c | |||
src/arm/gnunet-service-arm.c | |||
src/arm/mockup-service.c | |||
+src/ats-tests/ats-testing-experiment.c | |||
+src/ats-tests/ats-testing-log.c | |||
+src/ats-tests/ats-testing-preferences.c | |||
+src/ats-tests/ats-testing-traffic.c | |||
+src/ats-tests/ats-testing.c | |||
+src/ats-tests/gnunet-ats-sim.c | |||
+src/ats-tests/gnunet-solver-eval.c | |||
+src/ats-tool/gnunet-ats.c | |||
src/ats/ats_api_connectivity.c | |||
src/ats/ats_api_performance.c | |||
src/ats/ats_api_scanner.c | |||
src/ats/ats_api_scheduling.c | |||
src/ats/gnunet-ats-solver-eval.c | |||
-src/ats/gnunet-service-ats_addresses.c | |||
src/ats/gnunet-service-ats.c | |||
+src/ats/gnunet-service-ats_addresses.c | |||
src/ats/gnunet-service-ats_connectivity.c | |||
src/ats/gnunet-service-ats_normalization.c | |||
src/ats/gnunet-service-ats_performance.c | |||
@@ -25,14 +33,6 @@ src/ats/gnunet-service-ats_preferences.c | |||
src/ats/gnunet-service-ats_reservations.c | |||
src/ats/gnunet-service-ats_scheduling.c | |||
src/ats/plugin_ats_proportional.c | |||
-src/ats-tests/ats-testing.c | |||
-src/ats-tests/ats-testing-experiment.c | |||
-src/ats-tests/ats-testing-log.c | |||
-src/ats-tests/ats-testing-preferences.c | |||
-src/ats-tests/ats-testing-traffic.c | |||
-src/ats-tests/gnunet-ats-sim.c | |||
-src/ats-tests/gnunet-solver-eval.c | |||
-src/ats-tool/gnunet-ats.c | |||
src/auction/gnunet-auction-create.c | |||
src/auction/gnunet-auction-info.c | |||
src/auction/gnunet-auction-join.c | |||
@@ -49,8 +49,8 @@ src/cadet/cadet_api_list_peers.c | |||
src/cadet/cadet_api_list_tunnels.c | |||
src/cadet/cadet_test_lib.c | |||
src/cadet/desirability_table.c | |||
-src/cadet/gnunet-cadet.c | |||
src/cadet/gnunet-cadet-profiler.c | |||
+src/cadet/gnunet-cadet.c | |||
src/cadet/gnunet-service-cadet.c | |||
src/cadet/gnunet-service-cadet_channel.c | |||
src/cadet/gnunet-service-cadet_connection.c | |||
@@ -66,15 +66,15 @@ src/consensus/gnunet-service-consensus.c | |||
src/consensus/plugin_block_consensus.c | |||
src/conversation/conversation_api.c | |||
src/conversation/conversation_api_call.c | |||
-src/conversation/gnunet-conversation.c | |||
src/conversation/gnunet-conversation-test.c | |||
-src/conversation/gnunet_gst.c | |||
-src/conversation/gnunet_gst_test.c | |||
-src/conversation/gnunet-helper-audio-playback.c | |||
+src/conversation/gnunet-conversation.c | |||
src/conversation/gnunet-helper-audio-playback-gst.c | |||
-src/conversation/gnunet-helper-audio-record.c | |||
+src/conversation/gnunet-helper-audio-playback.c | |||
src/conversation/gnunet-helper-audio-record-gst.c | |||
+src/conversation/gnunet-helper-audio-record.c | |||
src/conversation/gnunet-service-conversation.c | |||
+src/conversation/gnunet_gst.c | |||
+src/conversation/gnunet_gst_test.c | |||
src/conversation/microphone.c | |||
src/conversation/plugin_gnsrecord_conversation.c | |||
src/conversation/speaker.c | |||
@@ -104,7 +104,6 @@ src/dht/dht_api.c | |||
src/dht/dht_test_lib.c | |||
src/dht/gnunet-dht-get.c | |||
src/dht/gnunet-dht-monitor.c | |||
-src/dht/gnunet_dht_profiler.c | |||
src/dht/gnunet-dht-put.c | |||
src/dht/gnunet-service-dht.c | |||
src/dht/gnunet-service-dht_clients.c | |||
@@ -113,6 +112,7 @@ src/dht/gnunet-service-dht_hello.c | |||
src/dht/gnunet-service-dht_neighbours.c | |||
src/dht/gnunet-service-dht_nse.c | |||
src/dht/gnunet-service-dht_routing.c | |||
+src/dht/gnunet_dht_profiler.c | |||
src/dht/plugin_block_dht.c | |||
src/dns/dns_api.c | |||
src/dns/gnunet-dns-monitor.c | |||
@@ -147,8 +147,8 @@ src/fs/gnunet-auto-share.c | |||
src/fs/gnunet-daemon-fsprofiler.c | |||
src/fs/gnunet-directory.c | |||
src/fs/gnunet-download.c | |||
-src/fs/gnunet-fs.c | |||
src/fs/gnunet-fs-profiler.c | |||
+src/fs/gnunet-fs.c | |||
src/fs/gnunet-helper-fs-publish.c | |||
src/fs/gnunet-publish.c | |||
src/fs/gnunet-search.c | |||
@@ -168,9 +168,9 @@ src/gns/gns_tld_api.c | |||
src/gns/gnunet-bcd.c | |||
src/gns/gnunet-dns2gns.c | |||
src/gns/gnunet-gns-benchmark.c | |||
-src/gns/gnunet-gns.c | |||
src/gns/gnunet-gns-import.c | |||
src/gns/gnunet-gns-proxy.c | |||
+src/gns/gnunet-gns.c | |||
src/gns/gnunet-service-gns.c | |||
src/gns/gnunet-service-gns_interceptor.c | |||
src/gns/gnunet-service-gns_resolver.c | |||
@@ -186,8 +186,8 @@ src/gnsrecord/gnsrecord_serialization.c | |||
src/gnsrecord/plugin_gnsrecord_dns.c | |||
src/hello/address.c | |||
src/hello/gnunet-hello.c | |||
-src/hello/hello.c | |||
src/hello/hello-ng.c | |||
+src/hello/hello.c | |||
src/hostlist/gnunet-daemon-hostlist.c | |||
src/hostlist/gnunet-daemon-hostlist_client.c | |||
src/hostlist/gnunet-daemon-hostlist_server.c | |||
@@ -212,8 +212,8 @@ src/namecache/namecache_api.c | |||
src/namecache/plugin_namecache_flat.c | |||
src/namecache/plugin_namecache_postgres.c | |||
src/namecache/plugin_namecache_sqlite.c | |||
-src/namestore/gnunet-namestore.c | |||
src/namestore/gnunet-namestore-fcfsd.c | |||
+src/namestore/gnunet-namestore.c | |||
src/namestore/gnunet-service-namestore.c | |||
src/namestore/gnunet-zoneimport.c | |||
src/namestore/namestore_api.c | |||
@@ -239,17 +239,17 @@ src/nat/gnunet-service-nat_mini.c | |||
src/nat/gnunet-service-nat_stun.c | |||
src/nat/nat_api.c | |||
src/nat/nat_api_stun.c | |||
-src/nse/gnunet-nse.c | |||
src/nse/gnunet-nse-profiler.c | |||
+src/nse/gnunet-nse.c | |||
src/nse/gnunet-service-nse.c | |||
src/nse/nse_api.c | |||
src/nt/nt.c | |||
-src/peerinfo/gnunet-service-peerinfo.c | |||
-src/peerinfo/peerinfo_api.c | |||
-src/peerinfo/peerinfo_api_notify.c | |||
src/peerinfo-tool/gnunet-peerinfo.c | |||
src/peerinfo-tool/gnunet-peerinfo_plugins.c | |||
src/peerinfo-tool/plugin_rest_peerinfo.c | |||
+src/peerinfo/gnunet-service-peerinfo.c | |||
+src/peerinfo/peerinfo_api.c | |||
+src/peerinfo/peerinfo_api_notify.c | |||
src/peerstore/gnunet-peerstore.c | |||
src/peerstore/gnunet-service-peerstore.c | |||
src/peerstore/peerstore_api.c | |||
@@ -297,22 +297,22 @@ src/revocation/gnunet-revocation.c | |||
src/revocation/gnunet-service-revocation.c | |||
src/revocation/plugin_block_revocation.c | |||
src/revocation/revocation_api.c | |||
-src/rps/gnunet-rps.c | |||
src/rps/gnunet-rps-profiler.c | |||
+src/rps/gnunet-rps.c | |||
src/rps/gnunet-service-rps.c | |||
src/rps/gnunet-service-rps_custommap.c | |||
src/rps/gnunet-service-rps_sampler.c | |||
src/rps/gnunet-service-rps_sampler_elem.c | |||
src/rps/gnunet-service-rps_view.c | |||
-src/rps/rps_api.c | |||
src/rps/rps-sampler_client.c | |||
src/rps/rps-sampler_common.c | |||
src/rps/rps-test_util.c | |||
+src/rps/rps_api.c | |||
src/scalarproduct/gnunet-scalarproduct.c | |||
-src/scalarproduct/gnunet-service-scalarproduct_alice.c | |||
-src/scalarproduct/gnunet-service-scalarproduct_bob.c | |||
src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c | |||
src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c | |||
+src/scalarproduct/gnunet-service-scalarproduct_alice.c | |||
+src/scalarproduct/gnunet-service-scalarproduct_bob.c | |||
src/scalarproduct/scalarproduct_api.c | |||
src/secretsharing/gnunet-secretsharing-profiler.c | |||
src/secretsharing/gnunet-service-secretsharing.c | |||
@@ -338,15 +338,16 @@ src/statistics/gnunet-statistics.c | |||
src/statistics/statistics_api.c | |||
src/template/gnunet-service-template.c | |||
src/template/gnunet-template.c | |||
+src/testbed-logger/gnunet-service-testbed-logger.c | |||
+src/testbed-logger/testbed_logger_api.c | |||
src/testbed/generate-underlay-topology.c | |||
src/testbed/gnunet-daemon-latency-logger.c | |||
src/testbed/gnunet-daemon-testbed-blacklist.c | |||
src/testbed/gnunet-daemon-testbed-underlay.c | |||
src/testbed/gnunet-helper-testbed.c | |||
-src/testbed/gnunet_mpi_test.c | |||
src/testbed/gnunet-service-test-barriers.c | |||
-src/testbed/gnunet-service-testbed_barriers.c | |||
src/testbed/gnunet-service-testbed.c | |||
+src/testbed/gnunet-service-testbed_barriers.c | |||
src/testbed/gnunet-service-testbed_cache.c | |||
src/testbed/gnunet-service-testbed_connectionpool.c | |||
src/testbed/gnunet-service-testbed_cpustatus.c | |||
@@ -354,20 +355,19 @@ src/testbed/gnunet-service-testbed_links.c | |||
src/testbed/gnunet-service-testbed_meminfo.c | |||
src/testbed/gnunet-service-testbed_oc.c | |||
src/testbed/gnunet-service-testbed_peers.c | |||
-src/testbed/gnunet_testbed_mpi_spawn.c | |||
src/testbed/gnunet-testbed-profiler.c | |||
-src/testbed-logger/gnunet-service-testbed-logger.c | |||
-src/testbed-logger/testbed_logger_api.c | |||
-src/testbed/testbed_api_barriers.c | |||
+src/testbed/gnunet_mpi_test.c | |||
+src/testbed/gnunet_testbed_mpi_spawn.c | |||
src/testbed/testbed_api.c | |||
+src/testbed/testbed_api_barriers.c | |||
src/testbed/testbed_api_hosts.c | |||
src/testbed/testbed_api_operations.c | |||
src/testbed/testbed_api_peers.c | |||
src/testbed/testbed_api_sd.c | |||
src/testbed/testbed_api_services.c | |||
src/testbed/testbed_api_statistics.c | |||
-src/testbed/testbed_api_testbed.c | |||
src/testbed/testbed_api_test.c | |||
+src/testbed/testbed_api_testbed.c | |||
src/testbed/testbed_api_topology.c | |||
src/testbed/testbed_api_underlay.c | |||
src/testing/gnunet-testing.c | |||
@@ -379,34 +379,40 @@ src/transport/gnunet-communicator-tcp.c | |||
src/transport/gnunet-communicator-udp.c | |||
src/transport/gnunet-communicator-unix.c | |||
src/transport/gnunet-helper-transport-bluetooth.c | |||
-src/transport/gnunet-helper-transport-wlan.c | |||
src/transport/gnunet-helper-transport-wlan-dummy.c | |||
+src/transport/gnunet-helper-transport-wlan.c | |||
src/transport/gnunet-service-tng.c | |||
-src/transport/gnunet-service-transport_ats.c | |||
src/transport/gnunet-service-transport.c | |||
+src/transport/gnunet-service-transport_ats.c | |||
src/transport/gnunet-service-transport_hello.c | |||
src/transport/gnunet-service-transport_manipulation.c | |||
src/transport/gnunet-service-transport_neighbours.c | |||
src/transport/gnunet-service-transport_plugins.c | |||
src/transport/gnunet-service-transport_validation.c | |||
-src/transport/gnunet-transport.c | |||
src/transport/gnunet-transport-profiler.c | |||
src/transport/gnunet-transport-wlan-receiver.c | |||
src/transport/gnunet-transport-wlan-sender.c | |||
+src/transport/gnunet-transport.c | |||
src/transport/plugin_transport_http_client.c | |||
src/transport/plugin_transport_http_common.c | |||
src/transport/plugin_transport_http_server.c | |||
src/transport/plugin_transport_smtp.c | |||
src/transport/plugin_transport_tcp.c | |||
src/transport/plugin_transport_template.c | |||
-src/transport/plugin_transport_udp_broadcasting.c | |||
src/transport/plugin_transport_udp.c | |||
+src/transport/plugin_transport_udp_broadcasting.c | |||
src/transport/plugin_transport_unix.c | |||
src/transport/plugin_transport_wlan.c | |||
src/transport/tcp_connection_legacy.c | |||
src/transport/tcp_server_legacy.c | |||
src/transport/tcp_server_mst_legacy.c | |||
src/transport/tcp_service_legacy.c | |||
+src/transport/transport-testing-filenames.c | |||
+src/transport/transport-testing-loggers.c | |||
+src/transport/transport-testing-main.c | |||
+src/transport/transport-testing-send.c | |||
+src/transport/transport-testing.c | |||
+src/transport/transport-testing2.c | |||
src/transport/transport_api2_application.c | |||
src/transport/transport_api2_communication.c | |||
src/transport/transport_api2_core.c | |||
@@ -419,12 +425,6 @@ src/transport/transport_api_manipulation.c | |||
src/transport/transport_api_monitor_peers.c | |||
src/transport/transport_api_monitor_plugins.c | |||
src/transport/transport_api_offer_hello.c | |||
-src/transport/transport-testing2.c | |||
-src/transport/transport-testing.c | |||
-src/transport/transport-testing-filenames.c | |||
-src/transport/transport-testing-loggers.c | |||
-src/transport/transport-testing-main.c | |||
-src/transport/transport-testing-send.c | |||
src/util/bandwidth.c | |||
src/util/benchmark.c | |||
src/util/bio.c | |||
@@ -437,8 +437,8 @@ src/util/configuration_loader.c | |||
src/util/container_bloomfilter.c | |||
src/util/container_heap.c | |||
src/util/container_meta_data.c | |||
-src/util/container_multihashmap32.c | |||
src/util/container_multihashmap.c | |||
+src/util/container_multihashmap32.c | |||
src/util/container_multipeermap.c | |||
src/util/container_multishortmap.c | |||
src/util/container_multiuuidmap.c | |||
@@ -462,8 +462,8 @@ src/util/dnsparser.c | |||
src/util/dnsstub.c | |||
src/util/getopt.c | |||
src/util/getopt_helpers.c | |||
-src/util/gnunet-config.c | |||
src/util/gnunet-config-diff.c | |||
+src/util/gnunet-config.c | |||
src/util/gnunet-ecc.c | |||
src/util/gnunet-qr.c | |||
src/util/gnunet-resolver.c | |||
@@ -500,8 +500,8 @@ src/vpn/gnunet-helper-vpn.c | |||
src/vpn/gnunet-service-vpn.c | |||
src/vpn/gnunet-vpn.c | |||
src/vpn/vpn_api.c | |||
-src/zonemaster/gnunet-service-zonemaster.c | |||
src/zonemaster/gnunet-service-zonemaster-monitor.c | |||
+src/zonemaster/gnunet-service-zonemaster.c | |||
src/fs/fs_api.h | |||
src/testbed/testbed_api.h | |||
src/testbed/testbed_api_operations.h | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,26 @@ | |||
From 73ee949868200082b7e9131d2f410f289fd1c416 Mon Sep 17 00:00:00 2001 | |||
From: Christian Grothoff <christian@grothoff.org> | |||
Date: Mon, 16 Dec 2019 17:17:46 +0100 | |||
Subject: [PATCH 05/12] sort using C locale for a more stable sort | |||
--- | |||
bin/pogen.sh | 4 ++++ | |||
1 file changed, 4 insertions(+) | |||
diff --git a/bin/pogen.sh b/bin/pogen.sh | |||
index 453e0b1d8..b97ef046a 100755 | |||
--- a/bin/pogen.sh | |||
+++ b/bin/pogen.sh | |||
@@ -1,5 +1,9 @@ | |||
#!/bin/sh | |||
# This script is in the public domain. | |||
+ | |||
+# Set language domain to C for a more stable sort! | |||
+export LANG=C | |||
+ | |||
find src -name "*.c" | grep -v \# | grep -v /test_ | grep -v /perf_ | grep -v _old | grep -v chat | grep -v .libs/ | sort > po/POTFILES.in | |||
grep -l _\( `find src -name "*.h"` | grep -v "platform.h" | grep -v _old | grep -v chat | sort >> po/POTFILES.in | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,78 @@ | |||
From 01e118581d800cf7c1b6f03b27679b45448fb82c Mon Sep 17 00:00:00 2001 | |||
From: Christian Grothoff <christian@grothoff.org> | |||
Date: Mon, 16 Dec 2019 17:29:38 +0100 | |||
Subject: [PATCH 06/12] enhance gnunet-qr to support passing arguments beyond | |||
just the URI to commands | |||
--- | |||
src/namestore/namestore.conf.in | 2 +- | |||
src/util/gnunet-qr.c | 40 +++++++++++++++++++++++++-------- | |||
2 files changed, 32 insertions(+), 10 deletions(-) | |||
diff --git a/src/namestore/namestore.conf.in b/src/namestore/namestore.conf.in | |||
index b5fb45abc..e6cc74aec 100644 | |||
--- a/src/namestore/namestore.conf.in | |||
+++ b/src/namestore/namestore.conf.in | |||
@@ -36,7 +36,7 @@ TEMPORARY_TABLE = NO | |||
ASYNC_COMMIT = NO | |||
[uri] | |||
-gns = gnunet-namestore | |||
+gns = gnunet-namestore -u | |||
[fcfsd] | |||
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c | |||
index cdeea4db1..2dcfc12db 100644 | |||
--- a/src/util/gnunet-qr.c | |||
+++ b/src/util/gnunet-qr.c | |||
@@ -141,15 +141,37 @@ gnunet_uri (void *cls, | |||
GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ), | |||
&maint_child_death, | |||
NULL); | |||
- p = GNUNET_OS_start_process (GNUNET_NO, | |||
- 0, | |||
- NULL, | |||
- NULL, | |||
- NULL, | |||
- program, | |||
- program, | |||
- orig_uri, | |||
- NULL); | |||
+ { | |||
+ char **argv = NULL; | |||
+ unsigned int argc = 0; | |||
+ char *u = GNUNET_strdup (orig_uri); | |||
+ | |||
+ GNUNET_array_append (argv, | |||
+ argc, | |||
+ GNUNET_strdup (program)); | |||
+ for (const char *tok = strtok (u, " "); | |||
+ NULL != tok; | |||
+ tok = strtok (NULL, " ")) | |||
+ GNUNET_array_append (argv, | |||
+ argc, | |||
+ GNUNET_strdup (tok)); | |||
+ GNUNET_array_append (argv, | |||
+ argc, | |||
+ NULL); | |||
+ p = GNUNET_OS_start_process_vap (GNUNET_NO, | |||
+ 0, | |||
+ NULL, | |||
+ NULL, | |||
+ NULL, | |||
+ program, | |||
+ argv); | |||
+ for (unsigned int i = 0; i<argc; i++) | |||
+ GNUNET_free (argv[i]); | |||
+ GNUNET_array_grow (argv, | |||
+ argc, | |||
+ 0); | |||
+ GNUNET_free (orig_uri); | |||
+ } | |||
GNUNET_free (program); | |||
if (NULL == p) | |||
GNUNET_SCHEDULER_cancel (rt); | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,25 @@ | |||
From a6380e0e3c37fad3c8920dbb250878b680342b06 Mon Sep 17 00:00:00 2001 | |||
From: Christian Grothoff <christian@grothoff.org> | |||
Date: Tue, 17 Dec 2019 12:45:02 +0100 | |||
Subject: [PATCH 07/12] fix variable confusion | |||
--- | |||
src/util/gnunet-qr.c | 2 +- | |||
1 file changed, 1 insertion(+), 1 deletion(-) | |||
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c | |||
index 2dcfc12db..122b81f39 100644 | |||
--- a/src/util/gnunet-qr.c | |||
+++ b/src/util/gnunet-qr.c | |||
@@ -170,7 +170,7 @@ gnunet_uri (void *cls, | |||
GNUNET_array_grow (argv, | |||
argc, | |||
0); | |||
- GNUNET_free (orig_uri); | |||
+ GNUNET_free (u); | |||
} | |||
GNUNET_free (program); | |||
if (NULL == p) | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,126 @@ | |||
From d3332b0876af7e4cea1e582e30613d6460b5de3c Mon Sep 17 00:00:00 2001 | |||
From: Christian Grothoff <christian@grothoff.org> | |||
Date: Tue, 17 Dec 2019 13:13:09 +0100 | |||
Subject: [PATCH 08/12] fix gnunet-qr logic | |||
--- | |||
src/util/gnunet-qr.c | 50 +++++++++++++++++++++++++++++++++++++------- | |||
1 file changed, 42 insertions(+), 8 deletions(-) | |||
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c | |||
index 122b81f39..cd23c3a9c 100644 | |||
--- a/src/util/gnunet-qr.c | |||
+++ b/src/util/gnunet-qr.c | |||
@@ -58,12 +58,21 @@ static long unsigned int exit_code = 1; | |||
*/ | |||
static struct GNUNET_OS_Process *p; | |||
+/** | |||
+ * Child signal handler. | |||
+ */ | |||
+static struct GNUNET_SIGNAL_Context *shc_chld; | |||
/** | |||
* Pipe used to communicate child death via signal. | |||
*/ | |||
static struct GNUNET_DISK_PipeHandle *sigpipe; | |||
+/** | |||
+ * Process ID of this process at the time we installed the various | |||
+ * signal handlers. | |||
+ */ | |||
+static pid_t my_pid; | |||
/** | |||
* Task triggered whenever we receive a SIGCHLD (child | |||
@@ -79,6 +88,8 @@ maint_child_death (void *cls) | |||
if ((GNUNET_OK != GNUNET_OS_process_status (p, &type, &exit_code)) || | |||
(type != GNUNET_OS_PROCESS_EXITED)) | |||
GNUNET_break (0 == GNUNET_OS_process_kill (p, GNUNET_TERM_SIG)); | |||
+ GNUNET_SIGNAL_handler_uninstall (shc_chld); | |||
+ shc_chld = NULL; | |||
if (NULL != sigpipe) | |||
{ | |||
GNUNET_DISK_pipe_close (sigpipe); | |||
@@ -88,6 +99,25 @@ maint_child_death (void *cls) | |||
} | |||
+/** | |||
+ * Signal handler called for signals that causes us to wait for the child process. | |||
+ */ | |||
+static void | |||
+sighandler_chld () | |||
+{ | |||
+ static char c; | |||
+ int old_errno = errno; /* backup errno */ | |||
+ | |||
+ if (getpid () != my_pid) | |||
+ _exit (1); /* we have fork'ed since the signal handler was created, | |||
+ * ignore the signal, see https://gnunet.org/vfork discussion */ | |||
+ GNUNET_DISK_file_write (GNUNET_DISK_pipe_handle | |||
+ (sigpipe, GNUNET_DISK_PIPE_END_WRITE), | |||
+ &c, sizeof(c)); | |||
+ errno = old_errno; | |||
+} | |||
+ | |||
+ | |||
/** | |||
* Dispatch URIs to the appropriate GNUnet helper process | |||
* | |||
@@ -141,40 +171,44 @@ gnunet_uri (void *cls, | |||
GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ), | |||
&maint_child_death, | |||
NULL); | |||
+ my_pid = getpid (); | |||
+ shc_chld = GNUNET_SIGNAL_handler_install (SIGCHLD, | |||
+ &sighandler_chld); | |||
+ | |||
{ | |||
char **argv = NULL; | |||
unsigned int argc = 0; | |||
- char *u = GNUNET_strdup (orig_uri); | |||
+ char *u = GNUNET_strdup (program); | |||
- GNUNET_array_append (argv, | |||
- argc, | |||
- GNUNET_strdup (program)); | |||
for (const char *tok = strtok (u, " "); | |||
NULL != tok; | |||
tok = strtok (NULL, " ")) | |||
GNUNET_array_append (argv, | |||
argc, | |||
GNUNET_strdup (tok)); | |||
+ GNUNET_array_append (argv, | |||
+ argc, | |||
+ GNUNET_strdup (orig_uri)); | |||
GNUNET_array_append (argv, | |||
argc, | |||
NULL); | |||
p = GNUNET_OS_start_process_vap (GNUNET_NO, | |||
- 0, | |||
+ GNUNET_OS_INHERIT_STD_ALL, | |||
NULL, | |||
NULL, | |||
NULL, | |||
- program, | |||
+ argv[0], | |||
argv); | |||
- for (unsigned int i = 0; i<argc; i++) | |||
+ for (unsigned int i = 0; i<argc - 1; i++) | |||
GNUNET_free (argv[i]); | |||
GNUNET_array_grow (argv, | |||
argc, | |||
0); | |||
GNUNET_free (u); | |||
} | |||
- GNUNET_free (program); | |||
if (NULL == p) | |||
GNUNET_SCHEDULER_cancel (rt); | |||
+ GNUNET_free (program); | |||
} | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,28 @@ | |||
From 44fa79619fcd3a612031931f50723b016b677bf7 Mon Sep 17 00:00:00 2001 | |||
From: Christian Grothoff <christian@grothoff.org> | |||
Date: Tue, 17 Dec 2019 13:15:40 +0100 | |||
Subject: [PATCH 09/12] nice log message | |||
--- | |||
src/namestore/gnunet-namestore.c | 5 ++++- | |||
1 file changed, 4 insertions(+), 1 deletion(-) | |||
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c | |||
index df2b49a62..4c8fd5ce8 100644 | |||
--- a/src/namestore/gnunet-namestore.c | |||
+++ b/src/namestore/gnunet-namestore.c | |||
@@ -1305,7 +1305,10 @@ default_ego_cb (void *cls, | |||
get_default = NULL; | |||
if (NULL == ego) | |||
{ | |||
- fprintf (stderr, _ ("No default ego configured in identity service\n")); | |||
+ fprintf (stderr, | |||
+ _ ("No default identity configured for `namestore' subsystem\n" | |||
+ "Run gnunet-identity -s namestore -e $NAME to set the default to $NAME\n" | |||
+ "Run gnunet-identity -d to get a list of choices for $NAME\n")); | |||
GNUNET_SCHEDULER_shutdown (); | |||
ret = -1; | |||
return; | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,25 @@ | |||
From b3e6c45fcc78c75ea97bff528f34bd96089abdbf Mon Sep 17 00:00:00 2001 | |||
From: Christian Grothoff <christian@grothoff.org> | |||
Date: Wed, 18 Dec 2019 10:01:46 +0100 | |||
Subject: [PATCH 10/12] set expriation to 1 year for URLs added via QR code | |||
--- | |||
src/namestore/namestore.conf.in | 2 +- | |||
1 file changed, 1 insertion(+), 1 deletion(-) | |||
diff --git a/src/namestore/namestore.conf.in b/src/namestore/namestore.conf.in | |||
index e6cc74aec..39de06c6d 100644 | |||
--- a/src/namestore/namestore.conf.in | |||
+++ b/src/namestore/namestore.conf.in | |||
@@ -36,7 +36,7 @@ TEMPORARY_TABLE = NO | |||
ASYNC_COMMIT = NO | |||
[uri] | |||
-gns = gnunet-namestore -u | |||
+gns = gnunet-namestore -u -e 1a | |||
[fcfsd] | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,25 @@ | |||
From c80982c74a02eab0a457fb9a3c3671956b2909ee Mon Sep 17 00:00:00 2001 | |||
From: Christian Grothoff <christian@grothoff.org> | |||
Date: Wed, 18 Dec 2019 15:27:27 +0100 | |||
Subject: [PATCH 11/12] better put -u last | |||
--- | |||
src/namestore/namestore.conf.in | 2 +- | |||
1 files changed, 1 insertions(+), 1 deletions(-) | |||
diff --git a/src/namestore/namestore.conf.in b/src/namestore/namestore.conf.in | |||
index 39de06c6d..733e4e2f8 100644 | |||
--- a/src/namestore/namestore.conf.in | |||
+++ b/src/namestore/namestore.conf.in | |||
@@ -36,7 +36,7 @@ TEMPORARY_TABLE = NO | |||
ASYNC_COMMIT = NO | |||
[uri] | |||
-gns = gnunet-namestore -u -e 1a | |||
+gns = gnunet-namestore -e 1a -u | |||
[fcfsd] | |||
-- | |||
2.24.1 | |||
@ -0,0 +1,215 @@ | |||
From f0f45c5113bdc7a6ac0e009b491fdb63d6d6a79a Mon Sep 17 00:00:00 2001 | |||
From: Florian Dold <florian.dold@gmail.com> | |||
Date: Thu, 19 Dec 2019 12:55:00 +0100 | |||
Subject: [PATCH 12/12] switch to new date format (#5862) | |||
--- | |||
src/json/json_generator.c | 44 ++++++++++--------- | |||
src/json/json_helper.c | 90 +++++++++++++++++++++------------------ | |||
2 files changed, 72 insertions(+), 62 deletions(-) | |||
diff --git a/src/json/json_generator.c b/src/json/json_generator.c | |||
index 6373d65d8..89fd53265 100644 | |||
--- a/src/json/json_generator.c | |||
+++ b/src/json/json_generator.c | |||
@@ -59,20 +59,22 @@ json_t * | |||
GNUNET_JSON_from_time_abs (struct GNUNET_TIME_Absolute stamp) | |||
{ | |||
json_t *j; | |||
- char *mystr; | |||
- int ret; | |||
GNUNET_assert (GNUNET_OK == | |||
GNUNET_TIME_round_abs (&stamp)); | |||
+ | |||
+ j = json_object (); | |||
+ | |||
if (stamp.abs_value_us == GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us) | |||
- return json_string ("/never/"); | |||
- ret = GNUNET_asprintf (&mystr, | |||
- "/Date(%llu)/", | |||
- (unsigned long long) (stamp.abs_value_us / (1000LL | |||
- * 1000LL))); | |||
- GNUNET_assert (ret > 0); | |||
- j = json_string (mystr); | |||
- GNUNET_free (mystr); | |||
+ { | |||
+ json_object_set_new (j, | |||
+ "t_ms", | |||
+ json_string ("never")); | |||
+ return j; | |||
+ } | |||
+ json_object_set_new (j, | |||
+ "t_ms", | |||
+ json_integer ((json_int_t) (stamp.abs_value_us / 1000LL))); | |||
return j; | |||
} | |||
@@ -100,20 +102,22 @@ json_t * | |||
GNUNET_JSON_from_time_rel (struct GNUNET_TIME_Relative stamp) | |||
{ | |||
json_t *j; | |||
- char *mystr; | |||
- int ret; | |||
GNUNET_assert (GNUNET_OK == | |||
GNUNET_TIME_round_rel (&stamp)); | |||
+ | |||
+ j = json_object (); | |||
+ | |||
if (stamp.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) | |||
- return json_string ("/forever/"); | |||
- ret = GNUNET_asprintf (&mystr, | |||
- "/Delay(%llu)/", | |||
- (unsigned long long) (stamp.rel_value_us / (1000LL | |||
- * 1000LL))); | |||
- GNUNET_assert (ret > 0); | |||
- j = json_string (mystr); | |||
- GNUNET_free (mystr); | |||
+ { | |||
+ json_object_set_new (j, | |||
+ "d_ms", | |||
+ json_string ("forever")); | |||
+ return j; | |||
+ } | |||
+ json_object_set_new (j, | |||
+ "d_ms", | |||
+ json_integer ((json_int_t) (stamp.rel_value_us / 1000LL))); | |||
return j; | |||
} | |||
diff --git a/src/json/json_helper.c b/src/json/json_helper.c | |||
index a9b933762..e7711a03e 100644 | |||
--- a/src/json/json_helper.c | |||
+++ b/src/json/json_helper.c | |||
@@ -561,41 +561,42 @@ parse_abs_time (void *cls, | |||
struct GNUNET_JSON_Specification *spec) | |||
{ | |||
struct GNUNET_TIME_Absolute *abs = spec->ptr; | |||
- const char *val; | |||
+ json_t *json_t_ms; | |||
unsigned long long int tval; | |||
- val = json_string_value (root); | |||
- if (NULL == val) | |||
+ if (!json_is_object (root)) | |||
{ | |||
GNUNET_break_op (0); | |||
return GNUNET_SYSERR; | |||
} | |||
- if ((0 == strcasecmp (val, | |||
- "/forever/")) || | |||
- (0 == strcasecmp (val, | |||
- "/end of time/")) || | |||
- (0 == strcasecmp (val, | |||
- "/never/"))) | |||
- { | |||
- *abs = GNUNET_TIME_UNIT_FOREVER_ABS; | |||
+ json_t_ms = json_object_get (root, "t_ms"); | |||
+ if (json_is_integer (json_t_ms)) | |||
+ { | |||
+ tval = json_integer_value (json_t_ms); | |||
+ /* Time is in milliseconds in JSON, but in microseconds in GNUNET_TIME_Absolute */ | |||
+ abs->abs_value_us = tval * 1000LL; | |||
+ if ((abs->abs_value_us) / 1000LL != tval) | |||
+ { | |||
+ /* Integer overflow */ | |||
+ GNUNET_break_op (0); | |||
+ return GNUNET_SYSERR; | |||
+ } | |||
return GNUNET_OK; | |||
} | |||
- if (1 != sscanf (val, | |||
- "/Date(%llu)/", | |||
- &tval)) | |||
+ if (json_is_string (json_t_ms)) | |||
{ | |||
+ const char *val; | |||
+ val = json_string_value (json_t_ms); | |||
+ if ((0 == strcasecmp (val, "never"))) | |||
+ { | |||
+ *abs = GNUNET_TIME_UNIT_FOREVER_ABS; | |||
+ return GNUNET_OK; | |||
+ } | |||
GNUNET_break_op (0); | |||
return GNUNET_SYSERR; | |||
} | |||
- /* Time is in seconds in JSON, but in microseconds in GNUNET_TIME_Absolute */ | |||
- abs->abs_value_us = tval * 1000LL * 1000LL; | |||
- if ((abs->abs_value_us) / 1000LL / 1000LL != tval) | |||
- { | |||
- /* Integer overflow */ | |||
- GNUNET_break_op (0); | |||
- return GNUNET_SYSERR; | |||
- } | |||
- return GNUNET_OK; | |||
+ GNUNET_break_op (0); | |||
+ return GNUNET_SYSERR; | |||
} | |||
@@ -715,37 +716,42 @@ parse_rel_time (void *cls, | |||
struct GNUNET_JSON_Specification *spec) | |||
{ | |||
struct GNUNET_TIME_Relative *rel = spec->ptr; | |||
- const char *val; | |||
+ json_t *json_d_ms; | |||
unsigned long long int tval; | |||
- val = json_string_value (root); | |||
- if (NULL == val) | |||
+ if (!json_is_object (root)) | |||
{ | |||
GNUNET_break_op (0); | |||
return GNUNET_SYSERR; | |||
} | |||
- if ((0 == strcasecmp (val, | |||
- "/forever/"))) | |||
- { | |||
- *rel = GNUNET_TIME_UNIT_FOREVER_REL; | |||
+ json_d_ms = json_object_get (root, "d_ms"); | |||
+ if (json_is_integer (json_d_ms)) | |||
+ { | |||
+ tval = json_integer_value (json_d_ms); | |||
+ /* Time is in milliseconds in JSON, but in microseconds in GNUNET_TIME_Absolute */ | |||
+ rel->rel_value_us = tval * 1000LL; | |||
+ if ((rel->rel_value_us) / 1000LL != tval) | |||
+ { | |||
+ /* Integer overflow */ | |||
+ GNUNET_break_op (0); | |||
+ return GNUNET_SYSERR; | |||
+ } | |||
return GNUNET_OK; | |||
} | |||
- if (1 != sscanf (val, | |||
- "/Delay(%llu)/", | |||
- &tval)) | |||
- { | |||
- GNUNET_break_op (0); | |||
- return GNUNET_SYSERR; | |||
- } | |||
- /* Time is in seconds in JSON, but in microseconds in GNUNET_TIME_Relative */ | |||
- rel->rel_value_us = tval * 1000LL * 1000LL; | |||
- if ((rel->rel_value_us) / 1000LL / 1000LL != tval) | |||
+ if (json_is_string (json_d_ms)) | |||
{ | |||
- /* Integer overflow */ | |||
+ const char *val; | |||
+ val = json_string_value (json_d_ms); | |||
+ if ((0 == strcasecmp (val, "forever"))) | |||
+ { | |||
+ *rel = GNUNET_TIME_UNIT_FOREVER_REL; | |||
+ return GNUNET_OK; | |||
+ } | |||
GNUNET_break_op (0); | |||
return GNUNET_SYSERR; | |||
} | |||
- return GNUNET_OK; | |||
+ GNUNET_break_op (0); | |||
+ return GNUNET_SYSERR; | |||
} | |||
-- | |||
2.24.1 | |||