Skip to content

Add support for openSUSE UsrEtc#8504

Open
scabrero wants to merge 3 commits intoSSSD:masterfrom
scabrero:scabrero-UsrEtc
Open

Add support for openSUSE UsrEtc#8504
scabrero wants to merge 3 commits intoSSSD:masterfrom
scabrero:scabrero-UsrEtc

Conversation

@scabrero
Copy link
Copy Markdown
Contributor

@scabrero scabrero commented Mar 6, 2026

To support transactional-updates in openSUSE, this PR adds support for UsrEtc.

  • Vendor provided configuration is installed in /usr/etc/sssd/sssd.conf.
  • Users can override the vendor creating /etc/sssd/sssd.conf or dropping config snippets to /etc/sssd/conf.d/

Doc: https://en.opensuse.org/openSUSE:Packaging_UsrEtc

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The shell variable for the vendor directory is vendordir, not VENDORDIR. VENDORDIR is the C preprocessor macro. This will result in an empty value being printed in the notice.

  AC_MSG_NOTICE([Used vendor dir: $vendordir])

@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label Mar 6, 2026
Copy link
Copy Markdown
Contributor

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

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

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

@pbrezina pbrezina self-assigned this Mar 19, 2026
@pbrezina pbrezina self-requested a review March 19, 2026 14:46
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>
Copy link
Copy Markdown
Member

@pbrezina pbrezina left a comment

Choose a reason for hiding this comment

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

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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@SSSD/developers opinions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines +33 to +35
#if defined(USE_VENDORDIR)
struct stat stats = {0};
#endif /* USE_VENDORDIR */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can move this declaration down and remove this #if.

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

Labels

no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants