From af389ad6f883fe924c0d6f31bb0b8c44925b0353 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Thu, 5 Mar 2020 15:43:17 +0100 Subject: [PATCH] Prefer g_info() over g_message() Libraries shouldn't really use `g_message()` as it will show up in consumer application outputs. Let's use `g_info()` instead. Fixes https://gitlab.gnome.org/GNOME/libsecret/issues/40 --- libsecret/secret-file-backend.c | 6 ++---- libsecret/secret-session.c | 12 ++++++------ libsecret/secret-util.c | 3 +-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/libsecret/secret-file-backend.c b/libsecret/secret-file-backend.c index d618352..e69c319 100644 --- a/libsecret/secret-file-backend.c +++ b/libsecret/secret-file-backend.c @@ -806,8 +806,7 @@ _secret_file_backend_check_portal_version (void) 0, -1, NULL, &error); g_object_unref (connection); if (!ret) { - g_message ("secret portal is not available: %s", - error->message); + g_info ("secret portal is not available: %s", error->message); g_error_free (error); return FALSE; } @@ -817,8 +816,7 @@ _secret_file_backend_check_portal_version (void) version = g_variant_get_uint32 (value); g_variant_unref (value); if (version != PORTAL_SECRET_VERSION) { - g_message ("secret portal version mismatch: %u != %u", - version, PORTAL_SECRET_VERSION); + g_info ("secret portal version mismatch: %u != %u", version, PORTAL_SECRET_VERSION); return FALSE; } diff --git a/libsecret/secret-session.c b/libsecret/secret-session.c index 4885d97..7ca77ee 100644 --- a/libsecret/secret-session.c +++ b/libsecret/secret-session.c @@ -393,12 +393,12 @@ service_decode_aes_secret (SecretSession *session, gsize pos; if (n_param != 16) { - g_message ("received an encrypted secret structure with invalid parameter"); + g_info ("received an encrypted secret structure with invalid parameter"); return NULL; } if (n_value == 0 || n_value % 16 != 0) { - g_message ("received an encrypted secret structure with bad secret length"); + g_info ("received an encrypted secret structure with bad secret length"); return NULL; } @@ -439,7 +439,7 @@ service_decode_aes_secret (SecretSession *session, if (!pkcs7_unpad_bytes_in_place (padded, &n_padded)) { egg_secure_clear (padded, n_padded); egg_secure_free (padded); - g_message ("received an invalid or unencryptable secret"); + g_info ("received an invalid or unencryptable secret"); return FALSE; } @@ -457,7 +457,7 @@ service_decode_plain_secret (SecretSession *session, const gchar *content_type) { if (n_param != 0) { - g_message ("received a plain secret structure with invalid parameter"); + g_info ("received a plain secret structure with invalid parameter"); return NULL; } @@ -485,8 +485,8 @@ _secret_session_decode_secret (SecretSession *session, g_variant_get_child (encoded, 0, "o", &session_path); if (session_path == NULL || !g_str_equal (session_path, session->path)) { - g_message ("received a secret encoded with wrong session: %s != %s", - session_path, session->path); + g_info ("received a secret encoded with wrong session: %s != %s", + session_path, session->path); g_free (session_path); return NULL; } diff --git a/libsecret/secret-util.c b/libsecret/secret-util.c index b5d431a..1b4f13d 100644 --- a/libsecret/secret-util.c +++ b/libsecret/secret-util.c @@ -125,8 +125,7 @@ _secret_util_strip_remote_error (GError **error) remote = g_dbus_error_get_remote_error (*error); if (remote) { if (g_dbus_error_strip_remote_error (*error)) { - g_message ("Remote error from secret service: %s: %s", - remote, (*error)->message); + g_info ("Remote error from secret service: %s: %s", remote, (*error)->message); } g_free (remote); }