Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: create_credential error case for type #2093

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 */
Expand Down