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

getdef: avoid spurious error messages about unknown configuration opt… #976

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

hallyn
Copy link
Member

@hallyn hallyn commented Mar 20, 2024

…ions

def_find can return NULL for unset, not just unknown, config options. So move the decision of whether to log an error message about an unknown config option back into def_find, which knows the difference. Only putdef_str() will pass a char* srcfile to def_find, so only calls from putdef_str will cause the message, which was the original intent of fa68441.

closes #967

fixes: fa68441 ("Improve the login.defs unknown item error message")

…ions

def_find can return NULL for unset, not just unknown, config options.  So
move the decision of whether to log an error message about an unknown config
option back into def_find, which knows the difference.  Only putdef_str()
will pass a char* srcfile to def_find, so only calls from putdef_str will
cause the message, which was the original intent of fa68441.

closes #967

fixes: fa68441 ("Improve the login.defs unknown item error message")
Signed-off-by: Serge Hallyn <[email protected]>
Copy link
Collaborator

@alejandro-colomar alejandro-colomar left a comment

Choose a reason for hiding this comment

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

Reviewed-by: Alejandro Colomar <[email protected]>

@ikerexxe
Copy link
Collaborator

LGTM! And it works as expected, so I'm merging it. Thank you Serge!

@ikerexxe ikerexxe merged commit ead55e9 into master Mar 21, 2024
9 checks passed
alejandro-colomar pushed a commit that referenced this pull request Mar 21, 2024
…on options

def_find can return NULL for unset, not just unknown, config options.  So
move the decision of whether to log an error message about an unknown config
option back into def_find, which knows the difference.  Only putdef_str()
will pass a char* srcfile to def_find, so only calls from putdef_str will
cause the message, which was the original intent of fa68441.

Closes: <#967>
Fixes: fa68441 ("Improve the login.defs unknown item error message")
Signed-off-by: Serge Hallyn <[email protected]>
Reviewed-by: Alejandro Colomar <[email protected]>
Cherry-picked-from: ead55e9 ("getdef: avoid spurious error messages about unknown configuration options")
Link: <https://bugzilla.redhat.com/show_bug.cgi?id=2265291>
Link: <#976>
Cc: Michael Vetter <[email protected]>
Cc: Dominique Leuenberger <[email protected]>
Cc: Iker Pedrosa <[email protected]>
Signed-off-by: Alejandro Colomar <[email protected]>
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.

shadow 4.15.0 complains about unknown configuration option
3 participants