Skip to content

IPA: return ENOENT if ipa_get_config yields nothing#7928

Closed
alexey-tikhonov wants to merge 2 commits into
SSSD:masterfrom
alexey-tikhonov:log-levels
Closed

IPA: return ENOENT if ipa_get_config yields nothing#7928
alexey-tikhonov wants to merge 2 commits into
SSSD:masterfrom
alexey-tikhonov:log-levels

Conversation

@alexey-tikhonov

Copy link
Copy Markdown
Member

and handle this error code properly.

and handle this error code properly.
@justin-stephenson

justin-stephenson commented Apr 14, 2025

Copy link
Copy Markdown
Contributor

Thanks for the PR, would you also be willing to add justin-stephenson@afd7bfa here? It makes use of ipa_get_config_send more clear.

@alexey-tikhonov

Copy link
Copy Markdown
Member Author

Thanks for the PR, would you also be willing to add justin-stephenson@afd7bfa here? It makes use of ipa_get_config_send more clear.

+++ b/src/providers/ipa/ipa_selinux.c
@@ -1066,13 +1066,15 @@ static void ipa_get_config_step(struct tevent_req *req)
     struct ipa_get_selinux_state *state = tevent_req_data(req,
                                                   struct ipa_get_selinux_state);
     struct ipa_id_ctx *id_ctx = state->selinux_ctx->id_ctx;
+    const char *attrs[] = {IPA_CONFIG_SELINUX_DEFAULT_USER_CTX,
+                           IPA_CONFIG_MIGRATION_ENABLED, NULL};

-- shouldn't it be IPA_CONFIG_SELINUX_MAP_ORDER instead of IPA_CONFIG_MIGRATION_ENABLED?

@justin-stephenson

Copy link
Copy Markdown
Contributor

Thanks for the PR, would you also be willing to add justin-stephenson@afd7bfa here? It makes use of ipa_get_config_send more clear.

+++ b/src/providers/ipa/ipa_selinux.c
@@ -1066,13 +1066,15 @@ static void ipa_get_config_step(struct tevent_req *req)
     struct ipa_get_selinux_state *state = tevent_req_data(req,
                                                   struct ipa_get_selinux_state);
     struct ipa_id_ctx *id_ctx = state->selinux_ctx->id_ctx;
+    const char *attrs[] = {IPA_CONFIG_SELINUX_DEFAULT_USER_CTX,
+                           IPA_CONFIG_MIGRATION_ENABLED, NULL};

-- shouldn't it be IPA_CONFIG_SELINUX_MAP_ORDER instead of IPA_CONFIG_MIGRATION_ENABLED?

Yes, I just noticed it also and fixed it.

@alexey-tikhonov

Copy link
Copy Markdown
Member Author

Yes, I just noticed it also and fixed it.

Thank you, added.

Comment thread src/providers/ipa/ipa_config.c Fixed
to require list of attrs explicitly.

@sumit-bose sumit-bose left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi,

thank you both for the patches.

Afaik, it can be expected that IPA_CONFIG_MIGRATION_ENABLED is always present, so strictly speaking not finding it would be an error. But given the this flag will be only used in a limited time-frame after a migration, I think it is ok to treat ENOENT not as an error. ACK.

bye,
Sumit

@alexey-tikhonov alexey-tikhonov added Accepted coverity Trigger a coverity scan Ready to push and removed Waiting for review coverity Trigger a coverity scan labels Apr 15, 2025
@alexey-tikhonov

Copy link
Copy Markdown
Member Author

Pushed PR: #7928

  • master
    • ae59f29 - IPA: ipa_get_config_send() was updated
    • fd56267 - IPA: return ENOENT if ipa_get_config yields nothing
  • sssd-2-9
    • bbb7b79 - IPA: ipa_get_config_send() was updated
    • ecaa49c - IPA: return ENOENT if ipa_get_config yields nothing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants