Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for openSUSE's UsrEtc layout, allowing SSSD to fall back to a vendor-provided configuration file. The changes are generally well-implemented across the build system and source code. However, I've identified a memory leak in src/monitor/monitor.c due to incorrect handling of talloc allocations when determining the configuration file path. Additionally, there's a minor bug in configure.ac that causes a user-facing notice to display an empty value. I have provided suggestions to address both of these issues.
configure.ac
Outdated
| [], [enable_vendordir=no]) | ||
| if test "$enable_vendordir" != no; then | ||
| AC_DEFINE(USE_VENDORDIR, 1, [Define if distribution provided configuration files should be used.]) | ||
| AC_MSG_NOTICE([Used vendor dir: $VENDORDIR]) |
ikerexxe
left a comment
There was a problem hiding this comment.
I only added comments to the first instance of each problem.
I'd highly recommend you to create a centralized place to manage this logic. A new file located in src/util/util_config.c would probably be the best location to place this logic. This way we reduce the maintenance burden and the possibility of applying fixes in one place but forgetting about the other
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Use same logic as the main daemon. Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Vendor provided configuration is installed in /usr/etc/sssd/sssd.conf. Users can override it creating /etc/sssd/sssd.conf, or override defaults dropping config snippets to /etc/sssd/conf.d/ Doc: https://en.opensuse.org/openSUSE:Packaging_UsrEtc Doc: https://github.com/uapi-group/specifications/blob/main/specs/configuration_files_specification.md Signed-off-by: Samuel Cabrero <scabrero@suse.com>
7e24e21 to
36cc0f7
Compare
pbrezina
left a comment
There was a problem hiding this comment.
Thank you, Samuel, it looks good. Can you also add a :packaging: release note to the last commit? See https://github.com/SSSD/sssd/blob/master/.git-commit-template
| ret = ENOMEM; | ||
| goto done; | ||
| } | ||
| config_snippet_path = CONFDB_DEFAULT_CONFIG_DIR; |
There was a problem hiding this comment.
I'm not sure about this. The tools can be given a different config file path (-c /path/to/my/sssd.conf) and the idea here was to have snippet folder /path/to/my/sssd.conf.d. This change, while elegant, breaks this.
While I like it, I'm not sure if we can break it out of a sudden. And if do this, the snippet path should be empty if a non-default config file is provided (otherwise the snippets from default directory would be loaded, which may be unexpected).
There was a problem hiding this comment.
Ok, I see the use case now. Someone might want to check a config file + snippets out of the standard directories. I will wait for the feedback before reverting this change.
| #if defined(USE_VENDORDIR) | ||
| struct stat stats = {0}; | ||
| #endif /* USE_VENDORDIR */ |
There was a problem hiding this comment.
You can move this declaration down and remove this #if.
To support transactional-updates in openSUSE, this PR adds support for UsrEtc.
Doc: https://en.opensuse.org/openSUSE:Packaging_UsrEtc