From 0a11e88cd61a551bf5ea5028aa0b0de4cd1c7445 Mon Sep 17 00:00:00 2001 From: Zoltan Fridrich Date: Mon, 18 Sep 2023 11:25:23 +0200 Subject: [PATCH] Small error message fixups Signed-off-by: Zoltan Fridrich --- p11-kit/add-profile.c | 8 ++++---- p11-kit/delete-object.c | 4 ++-- p11-kit/delete-profile.c | 8 ++++---- p11-kit/export-object.c | 4 ++-- p11-kit/generate-keypair.c | 4 ++-- p11-kit/list-objects.c | 6 +++--- p11-kit/list-profiles.c | 7 +++---- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/p11-kit/add-profile.c b/p11-kit/add-profile.c index 9062d80a..24a42a65 100644 --- a/p11-kit/add-profile.c +++ b/p11-kit/add-profile.c @@ -81,7 +81,7 @@ profile_exists (CK_FUNCTION_LIST *module, while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { rv = p11_kit_iter_get_attributes (iter, &attr, 1); if (rv != CKR_OK) { - p11_message (_("failed to retrieve attribute of an object")); + p11_message (_("failed to retrieve attribute of an object: %s"), p11_kit_strerror (rv)); p11_kit_iter_free (iter); return false; } @@ -118,12 +118,12 @@ add_profile (const char *token_str, uri = p11_kit_uri_new (); if (uri == NULL) { - p11_message (_("failed to allocate memory for URI")); + p11_message (_("failed to allocate memory")); goto cleanup; } if (p11_kit_uri_parse (token_str, P11_KIT_URI_FOR_TOKEN, uri) != P11_KIT_URI_OK) { - p11_message (_("failed to parse the token URI")); + p11_message (_("failed to parse URI")); goto cleanup; } @@ -150,7 +150,7 @@ add_profile (const char *token_str, session = p11_kit_iter_get_session (iter); rv = module->C_CreateObject (session, template, template_len, &object); if (rv != CKR_OK) { - p11_message (_("failed to create the profile object: %s"), p11_kit_strerror (rv)); + p11_message (_("failed to create profile object: %s"), p11_kit_strerror (rv)); goto cleanup; } diff --git a/p11-kit/delete-object.c b/p11-kit/delete-object.c index 1c89f86e..a7295e28 100644 --- a/p11-kit/delete-object.c +++ b/p11-kit/delete-object.c @@ -66,12 +66,12 @@ delete_object (const char *token_str) uri = p11_kit_uri_new (); if (uri == NULL) { - p11_message (_("failed to allocate memory for URI")); + p11_message (_("failed to allocate memory")); goto cleanup; } if (p11_kit_uri_parse (token_str, P11_KIT_URI_FOR_OBJECT_ON_TOKEN, uri) != P11_KIT_URI_OK) { - p11_message (_("failed to parse the token URI")); + p11_message (_("failed to parse URI")); goto cleanup; } diff --git a/p11-kit/delete-profile.c b/p11-kit/delete-profile.c index 0c7fe650..885435f8 100644 --- a/p11-kit/delete-profile.c +++ b/p11-kit/delete-profile.c @@ -73,12 +73,12 @@ delete_profile (const char *token_str, uri = p11_kit_uri_new (); if (uri == NULL) { - p11_message (_("failed to allocate memory for URI")); + p11_message (_("failed to allocate memory")); goto cleanup; } if (p11_kit_uri_parse (token_str, P11_KIT_URI_FOR_OBJECT_ON_TOKEN, uri) != P11_KIT_URI_OK) { - p11_message (_("failed to parse the token URI")); + p11_message (_("failed to parse URI")); goto cleanup; } @@ -99,14 +99,14 @@ delete_profile (const char *token_str, while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { rv = p11_kit_iter_get_attributes (iter, &attr, 1); if (rv != CKR_OK) { - p11_message (_("failed to retrieve attribute of an object")); + p11_message (_("failed to retrieve attribute of an object: %s"), p11_kit_strerror (rv)); goto cleanup; } if (profile_id == profile) { rv = p11_kit_iter_destroy_object (iter); if (rv != CKR_OK) - p11_message (_("failed to delete the profile")); + p11_message (_("failed to delete profile: %s"), p11_kit_strerror (rv)); } } diff --git a/p11-kit/export-object.c b/p11-kit/export-object.c index b68600f5..2c697a33 100644 --- a/p11-kit/export-object.c +++ b/p11-kit/export-object.c @@ -141,12 +141,12 @@ export_object (const char *token_str) uri = p11_kit_uri_new (); if (uri == NULL) { - p11_message (_("failed to allocate memory for URI")); + p11_message (_("failed to allocate memory")); goto cleanup; } if (p11_kit_uri_parse (token_str, P11_KIT_URI_FOR_OBJECT_ON_TOKEN, uri) != P11_KIT_URI_OK) { - p11_message (_("failed to parse the token URI")); + p11_message (_("failed to parse URI")); goto cleanup; } diff --git a/p11-kit/generate-keypair.c b/p11-kit/generate-keypair.c index 7e003ca6..d5058a50 100644 --- a/p11-kit/generate-keypair.c +++ b/p11-kit/generate-keypair.c @@ -268,12 +268,12 @@ generate_keypair (const char *token_str, uri = p11_kit_uri_new (); if (uri == NULL) { - p11_message (_("failed to allocate memory for URI")); + p11_message (_("failed to allocate memory")); goto cleanup; } if (p11_kit_uri_parse (token_str, P11_KIT_URI_FOR_TOKEN, uri) != P11_KIT_URI_OK) { - p11_message (_("failed to parse the token URI")); + p11_message (_("failed to parse URI")); goto cleanup; } diff --git a/p11-kit/list-objects.c b/p11-kit/list-objects.c index 00742456..b4a52b8e 100644 --- a/p11-kit/list-objects.c +++ b/p11-kit/list-objects.c @@ -181,7 +181,7 @@ get_object_uri (P11KitIter *iter, uri = p11_kit_uri_new (); if (uri == NULL) { - p11_message (_("failed to allocate memory for URI")); + p11_message (_("failed to allocate memory")); return NULL; } @@ -345,12 +345,12 @@ list_objects (const char *token_str) uri = p11_kit_uri_new (); if (uri == NULL) { - p11_message (_("failed to allocate memory for URI")); + p11_message (_("failed to allocate memory")); goto cleanup; } if (p11_kit_uri_parse (token_str, P11_KIT_URI_FOR_OBJECT_ON_TOKEN, uri) != P11_KIT_URI_OK) { - p11_message (_("failed to parse the token URI")); + p11_message (_("failed to parse URI")); goto cleanup; } diff --git a/p11-kit/list-profiles.c b/p11-kit/list-profiles.c index a3239052..cd437760 100644 --- a/p11-kit/list-profiles.c +++ b/p11-kit/list-profiles.c @@ -44,7 +44,6 @@ #include #include -#include #ifdef ENABLE_NLS #include @@ -73,12 +72,12 @@ list_profiles (const char *token_str) uri = p11_kit_uri_new (); if (uri == NULL) { - p11_message (_("failed to allocate memory for URI")); + p11_message (_("failed to allocate memory")); goto cleanup; } if (p11_kit_uri_parse (token_str, P11_KIT_URI_FOR_OBJECT_ON_TOKEN, uri) != P11_KIT_URI_OK) { - p11_message (_("failed to parse the token URI")); + p11_message (_("failed to parse URI")); goto cleanup; } @@ -99,7 +98,7 @@ list_profiles (const char *token_str) while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { rv = p11_kit_iter_get_attributes (iter, &attr, 1); if (rv != CKR_OK) { - p11_message (_("failed to retrieve attribute of an object")); + p11_message (_("failed to retrieve attribute of an object: %s"), p11_kit_strerror (rv)); goto cleanup; }