aboutsummaryrefslogtreecommitdiff
path: root/src/identity
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-19 18:43:38 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-19 18:43:38 +0100
commit3636ea628d051cf2ba7a9038c50528c561d0aeaa (patch)
tree87664b904950052e8b6997a371ed5ecb1ea4b310 /src/identity
parent74d7528e6bd53cf5acc939c63a5be74a001e5ce1 (diff)
downloadgnunet-3636ea628d051cf2ba7a9038c50528c561d0aeaa.tar.gz
gnunet-3636ea628d051cf2ba7a9038c50528c561d0aeaa.zip
change GNUNET_DISK_fn_write() to always do atomic writes and to NOT overwrite existing files; also change the return value to not return the size of the written file but GNUNET_OK on success, and integrate creating the directory if needed; breaks API, hence bumping libgnunetutil version
Diffstat (limited to 'src/identity')
-rw-r--r--src/identity/gnunet-service-identity.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/identity/gnunet-service-identity.c b/src/identity/gnunet-service-identity.c
index 6cdb1c2f7..2bb4b0897 100644
--- a/src/identity/gnunet-service-identity.c
+++ b/src/identity/gnunet-service-identity.c
@@ -697,8 +697,7 @@ check_create_message (void *cls,
697 697
698 698
699/** 699/**
700 * Handler for CREATE message from client, creates 700 * Handler for CREATE message from client, creates new identity.
701 * new identity.
702 * 701 *
703 * @param cls unused 702 * @param cls unused
704 * @param client who sent the message 703 * @param client who sent the message
@@ -737,8 +736,7 @@ handle_create_message (void *cls,
737 ego); 736 ego);
738 send_result_code (client, 0, NULL); 737 send_result_code (client, 0, NULL);
739 fn = get_ego_filename (ego); 738 fn = get_ego_filename (ego);
740 (void) GNUNET_DISK_directory_create_for_file (fn); 739 if (GNUNET_OK !=
741 if (sizeof(struct GNUNET_IDENTITY_PrivateKey) !=
742 GNUNET_DISK_fn_write (fn, 740 GNUNET_DISK_fn_write (fn,
743 &crm->private_key, 741 &crm->private_key,
744 sizeof(struct GNUNET_IDENTITY_PrivateKey), 742 sizeof(struct GNUNET_IDENTITY_PrivateKey),