From 103ad425adb7b5689b00681e94db6e4dfd915ffa Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Mon, 9 Oct 2023 13:38:35 +0200 Subject: [PATCH] Add: create_credential error case for type --- src/gmp.c | 5 +++++ src/manage_sql.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gmp.c b/src/gmp.c index 7d0f9f577..55371acab 100644 --- a/src/gmp.c +++ b/src/gmp.c @@ -19886,6 +19886,11 @@ gmp_xml_handle_end_element (/* unused */ GMarkupParseContext* context, (XML_ERROR_SYNTAX ("create_credential", "Erroneous certificate")); break; + case 18: + SEND_TO_CLIENT_OR_FAIL + (XML_ERROR_SYNTAX ("create_credential", + "Cannot determine type for new credential")); + break; case 99: SEND_TO_CLIENT_OR_FAIL (XML_ERROR_SYNTAX ("create_credential", diff --git a/src/manage_sql.c b/src/manage_sql.c index cdec639db..c86a92e97 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -34457,7 +34457,8 @@ validate_credential_username_for_format (const gchar *username, * 11 community missing, 12 auth algorithm missing, * 14 privacy algorithm missing, * 15 invalid auth algorithm, 16 invalid privacy algorithm, - * 17 invalid certificate, 99 permission denied, -1 error. + * 17 invalid certificate, 18 cannot determine type, + * 99 permission denied, -1 error. */ int create_credential (const char* name, const char* comment, const char* login, @@ -34534,7 +34535,7 @@ create_credential (const char* name, const char* comment, const char* login, else { g_warning ("%s: Cannot determine type of new credential", __func__); - return -1; + return 18; } /* Validate credential data */