summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-08 16:45:32 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-08 16:45:32 +0200
commitb58605a79d955d97f3df8381a4df156d04d3f9cc (patch)
tree8f3eabbf1d08c78994dcaf96ea2089e3901c4427 /src
parent7fd4f1d8463e324ab850b6c3c92c045b68906efc (diff)
downloadexchange-b58605a79d955d97f3df8381a4df156d04d3f9cc.tar.gz
exchange-b58605a79d955d97f3df8381a4df156d04d3f9cc.tar.bz2
exchange-b58605a79d955d97f3df8381a4df156d04d3f9cc.zip
introduce TALER_OS_init() to safely handle static linkage
Diffstat (limited to 'src')
-rw-r--r--src/auditor/taler-auditor-dbinit.c8
-rw-r--r--src/auditor/taler-auditor-httpd.c1
-rw-r--r--src/auditor/taler-auditor-sync.c1
-rw-r--r--src/bank-lib/bank_api_admin.c5
-rw-r--r--src/bank-lib/fakebank.c4
-rw-r--r--src/exchange-tools/taler-auditor-offline.c8
-rw-r--r--src/exchange-tools/taler-exchange-dbinit.c8
-rw-r--r--src/exchange-tools/taler-exchange-offline.c1
-rw-r--r--src/exchange/taler-exchange-aggregator.c1
-rw-r--r--src/exchange/taler-exchange-closer.c1
-rw-r--r--src/exchange/taler-exchange-httpd.c1
-rw-r--r--src/exchange/taler-exchange-transfer.c1
-rw-r--r--src/exchange/taler-exchange-wirewatch.c1
-rw-r--r--src/include/taler_util.h7
-rw-r--r--src/util/taler-exchange-secmod-eddsa.c2
-rw-r--r--src/util/taler-exchange-secmod-rsa.c2
16 files changed, 36 insertions, 16 deletions
diff --git a/src/auditor/taler-auditor-dbinit.c b/src/auditor/taler-auditor-dbinit.c
index fe5e5310..ab97b739 100644
--- a/src/auditor/taler-auditor-dbinit.c
+++ b/src/auditor/taler-auditor-dbinit.c
@@ -136,14 +136,14 @@ main (int argc,
};
enum GNUNET_GenericReturnValue ret;
- /* force linker to link against libtalerutil; if we do
- not do this, the linker may "optimize" libtalerutil
- away and skip #TALER_OS_init(), which we do need */
- (void) TALER_project_data_default ();
if (GNUNET_OK !=
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return EXIT_INVALIDARGUMENT;
+ /* force linker to link against libtalerutil; if we do
+ not do this, the linker may "optimize" libtalerutil
+ away and skip #TALER_OS_init(), which we do need */
+ TALER_OS_init ();
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-auditor-dbinit",
diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c
index da17e769..57165ef0 100644
--- a/src/auditor/taler-auditor-httpd.c
+++ b/src/auditor/taler-auditor-httpd.c
@@ -571,6 +571,7 @@ main (int argc,
int fh = -1;
enum TALER_MHD_GlobalOptions go;
+ TALER_OS_init ();
{
int ret;
diff --git a/src/auditor/taler-auditor-sync.c b/src/auditor/taler-auditor-sync.c
index ad55d7cc..79135230 100644
--- a/src/auditor/taler-auditor-sync.c
+++ b/src/auditor/taler-auditor-sync.c
@@ -593,6 +593,7 @@ main (int argc,
GNUNET_GETOPT_OPTION_END
};
+ TALER_OS_init ();
TALER_gcrypt_init (); /* must trigger initialization manually at this point! */
{
int ret;
diff --git a/src/bank-lib/bank_api_admin.c b/src/bank-lib/bank_api_admin.c
index 2a8559b2..702b3187 100644
--- a/src/bank-lib/bank_api_admin.c
+++ b/src/bank-lib/bank_api_admin.c
@@ -129,6 +129,11 @@ handle_admin_add_incoming_finished (void *cls,
We should pass the JSON reply to the application */
ec = TALER_JSON_get_error_code (j);
break;
+ case MHD_HTTP_CONFLICT:
+ /* Nothign to verify, we used the same wire subject
+ twice? */
+ ec = TALER_JSON_get_error_code (j);
+ break;
case MHD_HTTP_INTERNAL_SERVER_ERROR:
/* Server had an internal issue; we should retry, but this API
leaves this to the application */
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index 0e726e77..8c5a90fe 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -824,7 +824,7 @@ make_admin_transfer (
if (NULL != t)
{
/* duplicate reserve public key not allowed */
- GNUNET_break (0);
+ GNUNET_break_op (0);
return GNUNET_NO;
}
@@ -1074,7 +1074,7 @@ handle_admin_add_incoming (struct TALER_FAKEBANK_Handle *h,
GNUNET_free (debit);
if (GNUNET_OK != ret)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Reserve public key not unique\n");
return TALER_MHD_reply_with_error (
connection,
diff --git a/src/exchange-tools/taler-auditor-offline.c b/src/exchange-tools/taler-auditor-offline.c
index 0fbd82ba..45bf271b 100644
--- a/src/exchange-tools/taler-auditor-offline.c
+++ b/src/exchange-tools/taler-auditor-offline.c
@@ -1454,14 +1454,14 @@ main (int argc,
};
enum GNUNET_GenericReturnValue ret;
- /* force linker to link against libtalerutil; if we do
- not do this, the linker may "optimize" libtalerutil
- away and skip #TALER_OS_init(), which we do need */
- (void) TALER_project_data_default ();
if (GNUNET_OK !=
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return EXIT_INVALIDARGUMENT;
+ /* force linker to link against libtalerutil; if we do
+ not do this, the linker may "optimize" libtalerutil
+ away and skip #TALER_OS_init(), which we do need */
+ TALER_OS_init ();
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-auditor-offline",
diff --git a/src/exchange-tools/taler-exchange-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c
index 3f5542b2..42794b35 100644
--- a/src/exchange-tools/taler-exchange-dbinit.c
+++ b/src/exchange-tools/taler-exchange-dbinit.c
@@ -120,14 +120,14 @@ main (int argc,
};
enum GNUNET_GenericReturnValue ret;
- /* force linker to link against libtalerutil; if we do
- not do this, the linker may "optimize" libtalerutil
- away and skip #TALER_OS_init(), which we do need */
- (void) TALER_project_data_default ();
if (GNUNET_OK !=
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return EXIT_INVALIDARGUMENT;
+ /* force linker to link against libtalerutil; if we do
+ not do this, the linker may "optimize" libtalerutil
+ away and skip #TALER_OS_init(), which we do need */
+ TALER_OS_init ();
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-exchange-dbinit",
diff --git a/src/exchange-tools/taler-exchange-offline.c b/src/exchange-tools/taler-exchange-offline.c
index 020c1140..4558f00b 100644
--- a/src/exchange-tools/taler-exchange-offline.c
+++ b/src/exchange-tools/taler-exchange-offline.c
@@ -3456,6 +3456,7 @@ main (int argc,
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return EXIT_INVALIDARGUMENT;
+ TALER_OS_init ();
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-exchange-offline",
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index a2ea65c3..5da0a809 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -1013,6 +1013,7 @@ main (int argc,
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return EXIT_INVALIDARGUMENT;
+ TALER_OS_init ();
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-exchange-aggregator",
diff --git a/src/exchange/taler-exchange-closer.c b/src/exchange/taler-exchange-closer.c
index d14bedac..89e43999 100644
--- a/src/exchange/taler-exchange-closer.c
+++ b/src/exchange/taler-exchange-closer.c
@@ -547,6 +547,7 @@ main (int argc,
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return EXIT_INVALIDARGUMENT;
+ TALER_OS_init ();
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-exchange-closer",
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index ca058f0b..d0d8b953 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -1669,6 +1669,7 @@ main (int argc,
int fh = -1;
enum TALER_MHD_GlobalOptions go;
+ TALER_OS_init ();
ret = GNUNET_GETOPT_run ("taler-exchange-httpd",
options,
argc, argv);
diff --git a/src/exchange/taler-exchange-transfer.c b/src/exchange/taler-exchange-transfer.c
index a242547b..56794343 100644
--- a/src/exchange/taler-exchange-transfer.c
+++ b/src/exchange/taler-exchange-transfer.c
@@ -559,6 +559,7 @@ main (int argc,
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return EXIT_INVALIDARGUMENT;
+ TALER_OS_init ();
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-exchange-transfer",
diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c
index 6e40fc00..cc99e42c 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -768,6 +768,7 @@ main (int argc,
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))
return EXIT_INVALIDARGUMENT;
+ TALER_OS_init ();
ret = GNUNET_PROGRAM_run (
argc, argv,
"taler-exchange-wirewatch",
diff --git a/src/include/taler_util.h b/src/include/taler_util.h
index 59824a52..79e24779 100644
--- a/src/include/taler_util.h
+++ b/src/include/taler_util.h
@@ -175,6 +175,13 @@ TALER_project_data_default (void);
/**
+ * Initialize libtalerutil.
+ */
+void
+TALER_OS_init (void);
+
+
+/**
* URL-encode a string according to rfc3986.
*
* @param s string to encode
diff --git a/src/util/taler-exchange-secmod-eddsa.c b/src/util/taler-exchange-secmod-eddsa.c
index 5ca50f06..dc2d35d1 100644
--- a/src/util/taler-exchange-secmod-eddsa.c
+++ b/src/util/taler-exchange-secmod-eddsa.c
@@ -1680,7 +1680,7 @@ main (int argc,
/* force linker to link against libtalerutil; if we do
not do this, the linker may "optimize" libtalerutil
away and skip #TALER_OS_init(), which we do need */
- GNUNET_OS_init (TALER_project_data_default ());
+ TALER_OS_init ();
now = now_tmp = GNUNET_TIME_absolute_get ();
ret = GNUNET_PROGRAM_run (argc, argv,
"taler-exchange-secmod-eddsa",
diff --git a/src/util/taler-exchange-secmod-rsa.c b/src/util/taler-exchange-secmod-rsa.c
index 35bd7890..2aabaddc 100644
--- a/src/util/taler-exchange-secmod-rsa.c
+++ b/src/util/taler-exchange-secmod-rsa.c
@@ -2081,7 +2081,7 @@ main (int argc,
/* force linker to link against libtalerutil; if we do
not do this, the linker may "optimize" libtalerutil
away and skip #TALER_OS_init(), which we do need */
- GNUNET_OS_init (TALER_project_data_default ());
+ TALER_OS_init ();
now = now_tmp = GNUNET_TIME_absolute_get ();
ret = GNUNET_PROGRAM_run (argc, argv,
"taler-exchange-secmod-rsa",