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.

Comment thread 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])

Comment thread src/monitor/monitor.c Outdated
@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

Comment thread src/monitor/monitor.c Outdated
Comment thread src/monitor/monitor.c Outdated
Comment thread src/monitor/monitor.c Outdated
Comment thread configure.ac Outdated
@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>
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

Comment thread src/tools/sssctl/sssctl_config.c Outdated
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.

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.

@thalman introduced support for '-c' in 61f4aaa

Upcoming sssd-2.13 will be used in C10S/RHEL10, I don't think we can remove a feature there (even if hardly used)...

@thalman, @sumit-bose, thoughts?

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.

Ok, @scabrero let's revert.

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.

Done. The snippets directory is built from the given config file path only if it is not specified with -s.

Comment thread src/util/sss_config.c Outdated
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.

Just a minor comment inline. Make sure to add some debugging every time config_file == NULL

Comment thread src/monitor/monitor.c
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.

LGTM! Thank you for the patches

@alexey-tikhonov
Copy link
Copy Markdown
Member

@ikerexxe, are you fine with the latest version?

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.

Yes, this is fine

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 know I already gave this the green light, but after a second look, I noticed we’re missing some critical documentation updates for the new configuration logic.

In addition to the inline comments, the introduction of the new --with-vendordir configure option and the updated configuration file resolution behavior currently lack documentation in the man pages, as well as the general build docs. It is essential that we clearly describe the new fallback hierarchy in these files so that administrators and packagers have a reliable reference for how the system prioritizes vendor-provided settings versus local configurations.

Comment thread src/conf_macros.m4
Comment thread src/util/sss_config.c Outdated
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

:packaging: New configure option '--with-vendordir' to enable reading
the vendor provided configuration file.

Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Adds a section in sssd.conf manpage to explain how the vendor
provided configuration can be masked or overriden.

Signed-off-by: Samuel Cabrero <scabrero@suse.com>
@scabrero
Copy link
Copy Markdown
Contributor Author

I know I already gave this the green light, but after a second look, I noticed we’re missing some critical documentation updates for the new configuration logic.

In addition to the inline comments, the introduction of the new --with-vendordir configure option and the updated configuration file resolution behavior currently lack documentation in the man pages, as well as the general build docs. It is essential that we clearly describe the new fallback hierarchy in these files so that administrators and packagers have a reliable reference for how the system prioritizes vendor-provided settings versus local configurations.

Good point about the man page, I have added a section to explain the hierarchy if vendor dir is enabled. Regarding build docs, I will prepare an update for the sssd.io repository.

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.

In addition to the inline comment, there's a merge conflict in conf_macros.m4. Please fix it

Comment thread src/man/sssd.conf.5.xml
the system specific configurtion file <filename>&sssd_conf_dir;/sssd.conf</filename>
or partly overriden by creating config snippets in <filename>&sssd_conf_dir;/conf.d</filename>
directory.
</para>
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.

I'm missing an explanation on the configuration file hierarchy. One question that comes to my mind that I'd like to get clarified in this documentation. What happens if there isn't any SSSD configuration file in the vendor directory, but it exists in the regular one (/etc/sssd/sssd.conf), does SSSD use this configuration?

@alexey-tikhonov
Copy link
Copy Markdown
Member

make-distcheck fails:


ERROR: files left in build directory after distclean:
./src/man/src/man/sssd_conf_dir.include
./src/man/src/man/sssd_vendor_dir.include

@alexey-tikhonov
Copy link
Copy Markdown
Member

@scabrero, ping :)

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

Labels

Changes requested no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants