-fix minor bugs

This commit is contained in:
Christian Grothoff 2022-06-07 15:02:08 +02:00
parent 013942ba91
commit b9a30d29cb
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
27 changed files with 174 additions and 107 deletions

@ -1 +1 @@
Subproject commit d4234f340c6e7261de36ab5fad3d53597ea8ecd0 Subproject commit 75c838e74c41bf9a6c02cdfe8109a444056bf26d

View File

@ -283,6 +283,9 @@ add_deposit (const struct Merchant *m)
d.coin.denom_pub_hash = h_denom_pub; d.coin.denom_pub_hash = h_denom_pub;
d.coin.denom_sig = denom_sig; d.coin.denom_sig = denom_sig;
RANDOMIZE (&d.h_contract_terms); RANDOMIZE (&d.h_contract_terms);
memset (&d.coin.h_age_commitment,
0,
sizeof (d.coin.h_age_commitment));
if (0 >= if (0 >=
plugin->ensure_coin_known (plugin->cls, plugin->ensure_coin_known (plugin->cls,

View File

@ -270,25 +270,27 @@ run (void *cls,
&msg_size), &msg_size),
GNUNET_JSON_spec_end () GNUNET_JSON_spec_end ()
}; };
if (GNUNET_OK != GNUNET_JSON_parse (args, if (GNUNET_OK !=
eddsa_sign_spec, GNUNET_JSON_parse (args,
NULL, eddsa_sign_spec,
NULL)) NULL,
NULL))
{ {
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"malformed op args\n"); "malformed op args\n");
global_ret = 1; global_ret = 1;
return; return;
} }
GNUNET_CRYPTO_eddsa_sign_ ( GNUNET_assert (GNUNET_OK ==
&priv, GNUNET_CRYPTO_eddsa_sign_ (
msg, &priv,
&sig msg,
); &sig));
resp = GNUNET_JSON_PACK ( resp = GNUNET_JSON_PACK (
GNUNET_JSON_pack_data_auto ("sig", &sig) GNUNET_JSON_pack_data_auto ("sig", &sig)
); );
json_dumpf (resp, stdout, JSON_COMPACT); json_dumpf (resp, stdout,
JSON_COMPACT);
printf ("\n"); printf ("\n");
fflush (stdout); fflush (stdout);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,

View File

@ -628,8 +628,9 @@ TEH_handler_batch_withdraw (struct TEH_RequestContext *rc,
memset (&wc, memset (&wc,
0, 0,
sizeof (wc)); sizeof (wc));
TALER_amount_set_zero (TEH_currency, GNUNET_assert (GNUNET_OK ==
&wc.batch_total); TALER_amount_set_zero (TEH_currency,
&wc.batch_total));
wc.reserve_pub = reserve_pub; wc.reserve_pub = reserve_pub;
{ {

View File

@ -207,8 +207,9 @@ create_transaction (void *cls,
struct TALER_Amount purse_fee; struct TALER_Amount purse_fee;
bool in_conflict = true; bool in_conflict = true;
TALER_amount_set_zero (pcc->amount.currency, GNUNET_assert (GNUNET_OK ==
&purse_fee); TALER_amount_set_zero (pcc->amount.currency,
&purse_fee));
/* 1) create purse */ /* 1) create purse */
qs = TEH_plugin->insert_purse_request ( qs = TEH_plugin->insert_purse_request (
TEH_plugin->cls, TEH_plugin->cls,
@ -739,8 +740,22 @@ TEH_handler_purses_create (
TALER_EC_GENERIC_PARAMETER_MALFORMED, TALER_EC_GENERIC_PARAMETER_MALFORMED,
"deposits"); "deposits");
} }
gf = TEH_keys_global_fee_by_time (TEH_keys_get_state (), {
pcc.exchange_timestamp); struct TEH_KeyStateHandle *keys;
keys = TEH_keys_get_state ();
if (NULL == keys)
{
GNUNET_break (0);
GNUNET_JSON_parse_free (spec);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
NULL);
}
gf = TEH_keys_global_fee_by_time (keys,
pcc.exchange_timestamp);
}
if (NULL == gf) if (NULL == gf)
{ {
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, GNUNET_log (GNUNET_ERROR_TYPE_WARNING,

View File

@ -162,8 +162,9 @@ reply_merge_success (struct MHD_Connection *connection,
&pcc->target_amount, &pcc->target_amount,
&pcc->wf->wad)) &pcc->wf->wad))
{ {
TALER_amount_set_zero (TEH_currency, GNUNET_assert (GNUNET_OK ==
&merge_amount); TALER_amount_set_zero (TEH_currency,
&merge_amount));
} }
} }
if (TALER_EC_NONE != if (TALER_EC_NONE !=
@ -524,8 +525,9 @@ TEH_handler_purses_merge (
{ {
struct TALER_Amount zero_purse_fee; struct TALER_Amount zero_purse_fee;
TALER_amount_set_zero (pcc.target_amount.currency, GNUNET_assert (GNUNET_OK ==
&zero_purse_fee); TALER_amount_set_zero (pcc.target_amount.currency,
&zero_purse_fee));
if (GNUNET_OK != if (GNUNET_OK !=
TALER_wallet_account_merge_verify ( TALER_wallet_account_merge_verify (
pcc.merge_timestamp, pcc.merge_timestamp,

View File

@ -232,8 +232,22 @@ TEH_handler_reserves_history (struct TEH_RequestContext *rc,
TALER_EC_EXCHANGE_GENERIC_CLOCK_SKEW, TALER_EC_EXCHANGE_GENERIC_CLOCK_SKEW,
NULL); NULL);
} }
rsc.gf = TEH_keys_global_fee_by_time (TEH_keys_get_state (), {
rsc.timestamp); struct TEH_KeyStateHandle *keys;
keys = TEH_keys_get_state ();
if (NULL == keys)
{
GNUNET_break (0);
GNUNET_JSON_parse_free (spec);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
NULL);
}
rsc.gf = TEH_keys_global_fee_by_time (keys,
rsc.timestamp);
}
if (NULL == rsc.gf) if (NULL == rsc.gf)
{ {
GNUNET_break (0); GNUNET_break (0);

View File

@ -557,8 +557,22 @@ TEH_handler_reserves_purse (
TALER_EC_EXCHANGE_RESERVES_PURSE_EXPIRATION_IS_NEVER, TALER_EC_EXCHANGE_RESERVES_PURSE_EXPIRATION_IS_NEVER,
NULL); NULL);
} }
rpc.gf = TEH_keys_global_fee_by_time (TEH_keys_get_state (), {
rpc.exchange_timestamp); struct TEH_KeyStateHandle *keys;
keys = TEH_keys_get_state ();
if (NULL == keys)
{
GNUNET_break (0);
GNUNET_JSON_parse_free (spec);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
NULL);
}
rpc.gf = TEH_keys_global_fee_by_time (keys,
rpc.exchange_timestamp);
}
if (NULL == rpc.gf) if (NULL == rpc.gf)
{ {
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, GNUNET_log (GNUNET_ERROR_TYPE_WARNING,

View File

@ -14594,8 +14594,9 @@ postgres_do_reserve_purse (
GNUNET_PQ_result_spec_end GNUNET_PQ_result_spec_end
}; };
TALER_amount_set_zero (pg->currency, GNUNET_assert (GNUNET_OK ==
&zero_fee); TALER_amount_set_zero (pg->currency,
&zero_fee));
return GNUNET_PQ_eval_prepared_singleton_select (pg->conn, return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
"call_reserve_purse", "call_reserve_purse",
params, params,

View File

@ -423,7 +423,6 @@ struct TALER_EXCHANGE_HttpResponse
* reply (too big, invalid JSON). * reply (too big, invalid JSON).
*/ */
const json_t *reply; const json_t *reply;
/** /**
* Set to the human-readable 'hint' that is optionally * Set to the human-readable 'hint' that is optionally
* provided by the exchange together with errors. NULL * provided by the exchange together with errors. NULL

View File

@ -192,16 +192,17 @@ TALER_EXCHANGE_add_auditor_denomination (
GNUNET_JSON_pack_data_auto ("auditor_sig", GNUNET_JSON_pack_data_auto ("auditor_sig",
auditor_sig)); auditor_sig));
eh = TALER_AUDITOR_curl_easy_get_ (ah->url); eh = TALER_AUDITOR_curl_easy_get_ (ah->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&ah->post_ctx, TALER_curl_easy_post (&ah->post_ctx,
eh, eh,
body)) body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (ah->url); GNUNET_free (ah->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -414,8 +414,9 @@ TALER_EXCHANGE_batch_withdraw2 (
wh->cb = res_cb; wh->cb = res_cb;
wh->cb_cls = res_cb_cls; wh->cb_cls = res_cb_cls;
wh->num_coins = pds_length; wh->num_coins = pds_length;
TALER_amount_set_zero (keys->currency, GNUNET_assert (GNUNET_OK ==
&wh->requested_amount); TALER_amount_set_zero (keys->currency,
&wh->requested_amount));
GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv,
&wh->reserve_pub.eddsa_pub); &wh->reserve_pub.eddsa_pub);
{ {

View File

@ -173,16 +173,17 @@ TALER_EXCHANGE_management_disable_auditor (
GNUNET_JSON_pack_timestamp ("validity_end", GNUNET_JSON_pack_timestamp ("validity_end",
validity_end)); validity_end));
eh = TALER_EXCHANGE_curl_easy_get_ (ah->url); eh = TALER_EXCHANGE_curl_easy_get_ (ah->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&ah->post_ctx, TALER_curl_easy_post (&ah->post_ctx,
eh, eh,
body)) body)))
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (ah->url); GNUNET_free (ah->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -163,16 +163,17 @@ TALER_EXCHANGE_management_enable_auditor (
GNUNET_JSON_pack_timestamp ("validity_start", GNUNET_JSON_pack_timestamp ("validity_start",
validity_start)); validity_start));
eh = TALER_EXCHANGE_curl_easy_get_ (ah->url); eh = TALER_EXCHANGE_curl_easy_get_ (ah->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&ah->post_ctx, TALER_curl_easy_post (&ah->post_ctx,
eh, eh,
body)) body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
json_decref (body); json_decref (body);
if (NULL != eh)
curl_easy_cleanup (eh);
GNUNET_free (ah->url); GNUNET_free (ah->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -23,6 +23,7 @@
#include "taler_json_lib.h" #include "taler_json_lib.h"
#include <gnunet/gnunet_curl_lib.h> #include <gnunet/gnunet_curl_lib.h>
#include "taler_extensions.h" #include "taler_extensions.h"
#include "exchange_api_curl_defaults.h"
#include "taler_exchange_service.h" #include "taler_exchange_service.h"
#include "taler_signatures.h" #include "taler_signatures.h"
#include "taler_curl_lib.h" #include "taler_curl_lib.h"
@ -154,26 +155,24 @@ TALER_EXCHANGE_management_post_extensions (
GNUNET_JSON_pack_data_auto ("extensions_sig", GNUNET_JSON_pack_data_auto ("extensions_sig",
&ped->extensions_sig)); &ped->extensions_sig));
eh = curl_easy_init (); eh = TALER_EXCHANGE_curl_easy_get_ (ph->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&ph->post_ctx, TALER_curl_easy_post (&ph->post_ctx,
eh, eh,
body)) body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (ph->url); GNUNET_free (ph->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Requesting URL '%s'\n", "Requesting URL '%s'\n",
ph->url); ph->url);
GNUNET_assert (CURLE_OK == curl_easy_setopt (eh,
CURLOPT_URL,
ph->url));
ph->job = GNUNET_CURL_job_add2 (ctx, ph->job = GNUNET_CURL_job_add2 (ctx,
eh, eh,
ph->post_ctx.headers, ph->post_ctx.headers,

View File

@ -191,16 +191,17 @@ TALER_EXCHANGE_post_management_keys (
GNUNET_JSON_pack_array_steal ("signkey_sigs", GNUNET_JSON_pack_array_steal ("signkey_sigs",
signkey_sigs)); signkey_sigs));
eh = TALER_EXCHANGE_curl_easy_get_ (ph->url); eh = TALER_EXCHANGE_curl_easy_get_ (ph->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&ph->post_ctx, TALER_curl_easy_post (&ph->post_ctx,
eh, eh,
body)) body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (ph->url); GNUNET_free (ph->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -175,15 +175,17 @@ TALER_EXCHANGE_management_revoke_denomination_key (
return NULL; return NULL;
} }
eh = TALER_EXCHANGE_curl_easy_get_ (rh->url); eh = TALER_EXCHANGE_curl_easy_get_ (rh->url);
if (GNUNET_OK != if ( (NULL == eh) ||
TALER_curl_easy_post (&rh->post_ctx, (GNUNET_OK !=
eh, TALER_curl_easy_post (&rh->post_ctx,
body)) eh,
body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (rh->url); GNUNET_free (rh->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -165,16 +165,17 @@ TALER_EXCHANGE_management_revoke_signing_key (
GNUNET_JSON_pack_data_auto ("master_sig", GNUNET_JSON_pack_data_auto ("master_sig",
master_sig)); master_sig));
eh = TALER_EXCHANGE_curl_easy_get_ (rh->url); eh = TALER_EXCHANGE_curl_easy_get_ (rh->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&rh->post_ctx, TALER_curl_easy_post (&rh->post_ctx,
eh, eh,
body)) body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (rh->url); GNUNET_free (rh->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -179,16 +179,17 @@ TALER_EXCHANGE_management_set_global_fees (
GNUNET_JSON_pack_uint64 ("purse_account_limit", GNUNET_JSON_pack_uint64 ("purse_account_limit",
purse_account_limit)); purse_account_limit));
eh = TALER_EXCHANGE_curl_easy_get_ (sgfh->url); eh = TALER_EXCHANGE_curl_easy_get_ (sgfh->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&sgfh->post_ctx, TALER_curl_easy_post (&sgfh->post_ctx,
eh, eh,
body)) body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (sgfh->url); GNUNET_free (sgfh->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -168,16 +168,17 @@ TALER_EXCHANGE_management_set_wire_fees (
TALER_JSON_pack_amount ("wire_fee", TALER_JSON_pack_amount ("wire_fee",
&fees->wire)); &fees->wire));
eh = TALER_EXCHANGE_curl_easy_get_ (swfh->url); eh = TALER_EXCHANGE_curl_easy_get_ (swfh->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&swfh->post_ctx, TALER_curl_easy_post (&swfh->post_ctx,
eh, eh,
body)) body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (swfh->url); GNUNET_free (swfh->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -163,16 +163,17 @@ TALER_EXCHANGE_management_disable_wire (
GNUNET_JSON_pack_timestamp ("validity_end", GNUNET_JSON_pack_timestamp ("validity_end",
validity_end)); validity_end));
eh = TALER_EXCHANGE_curl_easy_get_ (wh->url); eh = TALER_EXCHANGE_curl_easy_get_ (wh->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&wh->post_ctx, TALER_curl_easy_post (&wh->post_ctx,
eh, eh,
body)) body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (wh->url); GNUNET_free (wh->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -174,16 +174,17 @@ TALER_EXCHANGE_management_enable_wire (
GNUNET_JSON_pack_timestamp ("validity_start", GNUNET_JSON_pack_timestamp ("validity_start",
validity_start)); validity_start));
eh = TALER_EXCHANGE_curl_easy_get_ (wh->url); eh = TALER_EXCHANGE_curl_easy_get_ (wh->url);
GNUNET_assert (NULL != eh); if ( (NULL == eh) ||
if (GNUNET_OK != (GNUNET_OK !=
TALER_curl_easy_post (&wh->post_ctx, TALER_curl_easy_post (&wh->post_ctx,
eh, eh,
body)) body)) )
{ {
GNUNET_break (0); GNUNET_break (0);
if (NULL != eh)
curl_easy_cleanup (eh);
json_decref (body); json_decref (body);
GNUNET_free (wh->url); GNUNET_free (wh->url);
GNUNET_free (eh);
return NULL; return NULL;
} }
json_decref (body); json_decref (body);

View File

@ -357,7 +357,6 @@ TALER_EXCHANGE_purse_create_with_merge (
GNUNET_free (pcm); GNUNET_free (pcm);
return NULL; return NULL;
} }
pcm->h_contract_terms = pcm->h_contract_terms;
pcm->merge_timestamp = merge_timestamp; pcm->merge_timestamp = merge_timestamp;
GNUNET_CRYPTO_eddsa_key_get_public (&purse_priv->eddsa_priv, GNUNET_CRYPTO_eddsa_key_get_public (&purse_priv->eddsa_priv,
&pcm->purse_pub.eddsa_pub); &pcm->purse_pub.eddsa_pub);
@ -401,8 +400,9 @@ TALER_EXCHANGE_purse_create_with_merge (
} }
else else
{ {
TALER_amount_set_zero (pcm->purse_value_after_fees.currency, GNUNET_assert (GNUNET_OK ==
&purse_fee); TALER_amount_set_zero (pcm->purse_value_after_fees.currency,
&purse_fee));
flags = TALER_WAMF_MODE_CREATE_FROM_PURSE_QUOTA; flags = TALER_WAMF_MODE_CREATE_FROM_PURSE_QUOTA;
} }

View File

@ -133,8 +133,10 @@ merge_cb (void *cls,
{ {
ds->reserve_history.type = TALER_EXCHANGE_RTT_MERGE; ds->reserve_history.type = TALER_EXCHANGE_RTT_MERGE;
ds->reserve_history.amount = ds->value_after_fees; ds->reserve_history.amount = ds->value_after_fees;
TALER_amount_set_zero (ds->value_after_fees.currency, GNUNET_assert (GNUNET_OK ==
&ds->reserve_history.details.merge_details.purse_fee); TALER_amount_set_zero (
ds->value_after_fees.currency,
&ds->reserve_history.details.merge_details.purse_fee));
ds->reserve_history.details.merge_details.h_contract_terms ds->reserve_history.details.merge_details.h_contract_terms
= ds->h_contract_terms; = ds->h_contract_terms;
ds->reserve_history.details.merge_details.merge_pub ds->reserve_history.details.merge_details.merge_pub

View File

@ -1215,7 +1215,6 @@ import_key (void *cls,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"open", "open",
filename); filename);
GNUNET_break (0 == close (fd));
return GNUNET_OK; return GNUNET_OK;
} }
if (0 != fstat (fd, if (0 != fstat (fd,
@ -1224,6 +1223,7 @@ import_key (void *cls,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"stat", "stat",
filename); filename);
GNUNET_break (0 == close (fd));
return GNUNET_OK; return GNUNET_OK;
} }
if (! S_ISREG (sbuf.st_mode)) if (! S_ISREG (sbuf.st_mode))

View File

@ -918,6 +918,7 @@ import_key (void *cls,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"stat", "stat",
filename); filename);
GNUNET_break (0 == close (fd));
return GNUNET_OK; return GNUNET_OK;
} }
if (! S_ISREG (sbuf.st_mode)) if (! S_ISREG (sbuf.st_mode))
@ -925,6 +926,7 @@ import_key (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"File `%s' is not a regular file, which is not allowed for private keys!\n", "File `%s' is not a regular file, which is not allowed for private keys!\n",
filename); filename);
GNUNET_break (0 == close (fd));
return GNUNET_OK; return GNUNET_OK;
} }
if (0 != (sbuf.st_mode & (S_IWUSR | S_IRWXG | S_IRWXO))) if (0 != (sbuf.st_mode & (S_IWUSR | S_IRWXG | S_IRWXO)))

View File

@ -628,8 +628,8 @@ sem_up (struct Semaphore *sem)
static void static void
sem_done (struct Semaphore *sem) sem_done (struct Semaphore *sem)
{ {
pthread_cond_destroy (&sem->cv); GNUNET_break (0 == pthread_cond_destroy (&sem->cv));
pthread_mutex_destroy (&sem->mutex); GNUNET_break (0 == pthread_mutex_destroy (&sem->mutex));
} }
@ -1625,6 +1625,7 @@ import_key (void *cls,
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
"stat", "stat",
filename); filename);
GNUNET_break (0 == close (fd));
return GNUNET_OK; return GNUNET_OK;
} }
if (! S_ISREG (sbuf.st_mode)) if (! S_ISREG (sbuf.st_mode))