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

[#424] Improve the invalid master key file error #443

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

T1t4m1un
Copy link
Contributor

@T1t4m1un T1t4m1un commented May 7, 2024

No description provided.

Copy link
Collaborator

@fluca1978 fluca1978 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that there is the usage of user_path everywhere, but it sould be related to the specific path we are looking for, or am I missing something here? Also, a configuration error should not point to an invalida master key file error, since it is more an error in the configuration and not in the "cannot decrypt".

{

snprintf(message, MISC_LENGTH, "Invalid master key file");
snprintf(message, MISC_LENGTH, "USERS configuration file cannot decrypt");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the message to "Cannot decrypt USERS file" ?

|| ret == PGAGROAL_CONFIGURATION_STATUS_KO)
else if (ret == PGAGROAL_CONFIGURATION_STATUS_KO)
{
snprintf(message, MISC_LENGTH, "Invalid master key file");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "invalid master key file"? This branch is for configuration errors on frontend user file.

{
snprintf(message, MISC_LENGTH, "Invalid master key file");
#ifdef HAVE_LINUX
sd_notifyf(0, "STATUS=%s: %s", message, users_path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why user_path? Shouldn't it be frontend_users_path?

#endif
errx(1, "Invalid master key file");
errx(1, "%s (file <%s>)", message, users_path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user_path shoud be frontend_user_path or not?

#ifdef HAVE_LINUX
sd_notify(0, "STATUS=Invalid master key file");
sd_notifyf(0, "STATUS=%s: %s", message, users_path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message should be about configuration error.

#endif
errx(1, "Invalid master key file");
errx(1, "%s (file <%s>)", message, users_path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user_path should be 'admins_path`?

{
snprintf(message, MISC_LENGTH, "Invalid master key file");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message should be about configuration errors.

#ifdef HAVE_LINUX
sd_notify(0, "STATUS=Invalid master key file");
sd_notifyf(0, "STATUS=%s: %s", message, users_path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

userspathshould besuperuser_path`?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants