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

MONITOR: disable 'user' config option in case #6642

Closed

Conversation

alexey-tikhonov
Copy link
Member

--with-sssd-user=root

In case SSSD was configured and built --with-sssd-user=root, no other value of 'user' config option (besides default 'root') is supported. Having it documented in the man page in this case only brings confusion.

@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label Mar 21, 2023
@alexey-tikhonov
Copy link
Member Author

Another thing I would like to address in this PR: currently 'monitor' allows to set arbitrary 'username' in user option, but the only value that is expected to actually work (with known limitations) is an 'username' that was used --with-sssd-user and in a spec-file (files ownership). All other values will fail miserably.

This practically means that option should be boolean: either run under configured --with-sssd-user or under root.

Options are:
(1) rename this option and make it boolean, add a special check if old option name is used in sssd.conf and refuse to start if it's found
(2) keep it as is (option name, type) but refuse to start if anything besides {root, SSSD_USER} is used; only update man page.

@sumit-bose, @pbrezina, @andreboscatto, what would you say?

@sumit-bose
Copy link
Contributor

Another thing I would like to address in this PR: currently 'monitor' allows to set arbitrary 'username' in user option, but the only value that is expected to actually work (with known limitations) is an 'username' that was used --with-sssd-user and in a spec-file (files ownership). All other values will fail miserably.

This practically means that option should be boolean: either run under configured --with-sssd-user or under root.

Options are:
(1) rename this option and make it boolean, add a special check if old option name is used in sssd.conf and refuse to start if it's found

Hi,

what about just trying to start as SSSD_USER if the old option was set together with a message in the system logs as well? This should make it easier for users who have to update a large number of systems.

bye,
Sumit

(2) keep it as is (option name, type) but refuse to start if anything besides {root, SSSD_USER} is used; only update man page.

@sumit-bose, @pbrezina, @andreboscatto, what would you say?

@alexey-tikhonov alexey-tikhonov force-pushed the user-config-option branch 2 times, most recently from 9b9f70e to 862e6b7 Compare March 24, 2023 19:51
@pbrezina
Copy link
Member

Another thing I would like to address in this PR: currently 'monitor' allows to set arbitrary 'username' in user option, but the only value that is expected to actually work (with known limitations) is an 'username' that was used --with-sssd-user and in a spec-file (files ownership). All other values will fail miserably.

This practically means that option should be boolean: either run under configured --with-sssd-user or under root.

Options are: (1) rename this option and make it boolean, add a special check if old option name is used in sssd.conf and refuse to start if it's found (2) keep it as is (option name, type) but refuse to start if anything besides {root, SSSD_USER} is used; only update man page.

@sumit-bose, @pbrezina, @andreboscatto, what would you say?

I don't have strong preference, but I am inclined to option 2 to avoid introducing special cases.

@alexey-tikhonov alexey-tikhonov force-pushed the user-config-option branch 2 times, most recently from 3f7fbdd to 1e1151c Compare March 27, 2023 19:15
@alexey-tikhonov
Copy link
Member Author

alexey-tikhonov commented Mar 27, 2023

I don't have strong preference, but I am inclined to option 2 to avoid introducing special cases.

Well, on the one hand, having option with type 'string' here is really confusing, and attempt to explain in the man page that "you can only put 'sssd' as a value for this options" doesn't look good.

On the other hand, I'd like to simplify things, but introducing a new option while keeping old one feels quite opposite...

Nonetheless, since I already had patch according to Sumit's proposal (as far as I understood it) I decide to post it here for review.
My excuse is that we can phase out old option eventually (by Fedora 39..40 and RHEL10). RHEL8 will stick to LTS branch (with 2 options...), and I think it's ok to eventually remove old option in RHEL9 as well, after a couple of minor releases with 2 variants and a loud error message about deprecated option...

So, @pbrezina, @sumit-bose, could you please take a look before I update man page?
If you think this makes things worse, not better, I will discard 3rd patch and will go with option (2).

@pbrezina
Copy link
Member

pbrezina commented Apr 3, 2023

I don't have strong preference, so from my perspective, do what you believe is right. But renaming an option is a lot of hustle, we will need to also create leapp actor for it and I don't see strong reason for it. I'd keep it simple.

@alexey-tikhonov
Copy link
Member Author

Ok, I'll discard current patch and will just add a check that value matches SSSD_USER.

@sumit-bose, do you agree?

@sumit-bose
Copy link
Contributor

Ok, I'll discard current patch and will just add a check that value matches SSSD_USER.

@sumit-bose, do you agree?

Hi,

yes, but maybe it would help to not directly refuse to start if the value is neither root nor SSSD_USER but send a message to the system log and try to run as SSSD_USER?

bye,
Sumit

@alexey-tikhonov
Copy link
Member Author

maybe it would help to not directly refuse to start if the value is neither root nor SSSD_USER but send a message to the system log and try to run as SSSD_USER?

I don't think it's beneficial to consciously allow misconfiguration and to just replace (even with a warning) config value...
Currently it (other value of an option) doesn't work (SSSD fails with obscure error messages), so we don't have to worry about potentially breaking working setups.
I think it's better to hard stop immediately when misconfiguration is detected, this is a security relevant configuration option after all...

@alexey-tikhonov
Copy link
Member Author

At the moment, I can't find a simple way to a value of SSSD_USER define in a man page text...

@sumit-bose
Copy link
Contributor

At the moment, I can't find a simple way to a value of SSSD_USER define in a man page text...

Hi,

I didn't found a better solution than https://gitlab.freedesktop.org/realmd/realmd/-/commit/98a69ca0 for a similar problem in realmd.

HTH

bye,
Sumit

@alexey-tikhonov alexey-tikhonov marked this pull request as ready for review April 4, 2023 12:30
@alexey-tikhonov
Copy link
Member Author

At the moment, I can't find a simple way to a value of SSSD_USER define in a man page text...

I didn't found a better solution than https://gitlab.freedesktop.org/realmd/realmd/-/commit/98a69ca0 for a similar problem in realmd.

Thank you. Implemented something similar.

@alexey-tikhonov
Copy link
Member Author

rpm build fails on c8s system with:

Empty %files file /builddir/build/BUILD/sssd-pr6642/sssd_ad.lang

Comparing logs with F38, "Discard ... translated; need 80%)" strings looks the same (at least from a quick glance).

But resulting set of translation files are very different.
For example:

F38 -

+ cat sssd.lang
%lang(ka) /usr/share/locale/ka/LC_MESSAGES/sssd.mo
%lang(ko) /usr/share/locale/ko/LC_MESSAGES/sssd.mo
%lang(zh) /usr/share/locale/zh_TW/LC_MESSAGES/sssd.mo
%lang(zh) /usr/share/locale/zh_CN/LC_MESSAGES/sssd.mo
%lang(uk) /usr/share/locale/uk/LC_MESSAGES/sssd.mo
%lang(tr) /usr/share/locale/tr/LC_MESSAGES/sssd.mo
%lang(tg) /usr/share/locale/tg/LC_MESSAGES/sssd.mo
%lang(sv) /usr/share/locale/sv/LC_MESSAGES/sssd.mo
%lang(ru) /usr/share/locale/ru/LC_MESSAGES/sssd.mo
%lang(pt) /usr/share/locale/pt_BR/LC_MESSAGES/sssd.mo
%lang(pt) /usr/share/locale/pt/LC_MESSAGES/sssd.mo
%lang(pl) /usr/share/locale/pl/LC_MESSAGES/sssd.mo
%lang(nl) /usr/share/locale/nl/LC_MESSAGES/sssd.mo
%lang(nb) /usr/share/locale/nb/LC_MESSAGES/sssd.mo
%lang(ja) /usr/share/locale/ja/LC_MESSAGES/sssd.mo
%lang(it) /usr/share/locale/it/LC_MESSAGES/sssd.mo
%lang(id) /usr/share/locale/id/LC_MESSAGES/sssd.mo
%lang(hu) /usr/share/locale/hu/LC_MESSAGES/sssd.mo
%lang(fr) /usr/share/locale/fr/LC_MESSAGES/sssd.mo
%lang(fi) /usr/share/locale/fi/LC_MESSAGES/sssd.mo
%lang(eu) /usr/share/locale/eu/LC_MESSAGES/sssd.mo
%lang(es) /usr/share/locale/es/LC_MESSAGES/sssd.mo
%lang(de) /usr/share/locale/de/LC_MESSAGES/sssd.mo
%lang(cs) /usr/share/locale/cs/LC_MESSAGES/sssd.mo
%lang(ca) /usr/share/locale/ca/LC_MESSAGES/sssd.mo
%lang(bg) /usr/share/locale/bg/LC_MESSAGES/sssd.mo
%lang(ca) /usr/share/man/ca/man5/sssd-simple.5*
%lang(de) /usr/share/man/de/man1/sss_ssh_knownhostsproxy.1*
%lang(de) /usr/share/man/de/man5/sssd-sudo.5*
%lang(de) /usr/share/man/de/man5/sssd-simple.5*
%lang(es) /usr/share/man/es/man5/sssd-simple.5*
%lang(fr) /usr/share/man/fr/man1/sss_ssh_knownhostsproxy.1*
%lang(fr) /usr/share/man/fr/man5/sssd-simple.5*
%lang(ja) /usr/share/man/ja/man1/sss_ssh_knownhostsproxy.1*
%lang(ja) /usr/share/man/ja/man5/sssd-simple.5*
%lang(sv) /usr/share/man/sv/man1/sss_ssh_knownhostsproxy.1*
%lang(sv) /usr/share/man/sv/man1/sss_ssh_authorizedkeys.1*
%lang(sv) /usr/share/man/sv/man5/sssd.conf.5*
%lang(sv) /usr/share/man/sv/man5/sssd-systemtap.5*
%lang(sv) /usr/share/man/sv/man5/sssd-sudo.5*
%lang(sv) /usr/share/man/sv/man5/sssd-simple.5*
%lang(sv) /usr/share/man/sv/man5/sssd-session-recording.5*
%lang(sv) /usr/share/man/sv/man5/sssd-files.5*
%lang(sv) /usr/share/man/sv/man8/sssd.8*
%lang(sv) /usr/share/man/sv/man8/sss_cache.8*
%lang(uk) /usr/share/man/uk/man1/sss_ssh_knownhostsproxy.1*
%lang(uk) /usr/share/man/uk/man1/sss_ssh_authorizedkeys.1*
%lang(uk) /usr/share/man/uk/man5/sssd.conf.5*
%lang(uk) /usr/share/man/uk/man5/sssd-systemtap.5*
%lang(uk) /usr/share/man/uk/man5/sssd-sudo.5*
%lang(uk) /usr/share/man/uk/man5/sssd-simple.5*
%lang(uk) /usr/share/man/uk/man5/sssd-session-recording.5*
%lang(uk) /usr/share/man/uk/man5/sssd-files.5*
%lang(uk) /usr/share/man/uk/man8/sssd.8*
%lang(uk) /usr/share/man/uk/man8/sss_cache.8*

C8S -

sssd.lang:
+ cat sssd.lang
%lang(ka) /usr/share/locale/ka/LC_MESSAGES/sssd.mo
%lang(ko) /usr/share/locale/ko/LC_MESSAGES/sssd.mo
%lang(zh) /usr/share/locale/zh_TW/LC_MESSAGES/sssd.mo
%lang(zh) /usr/share/locale/zh_CN/LC_MESSAGES/sssd.mo
%lang(uk) /usr/share/locale/uk/LC_MESSAGES/sssd.mo
%lang(tr) /usr/share/locale/tr/LC_MESSAGES/sssd.mo
%lang(tg) /usr/share/locale/tg/LC_MESSAGES/sssd.mo
%lang(sv) /usr/share/locale/sv/LC_MESSAGES/sssd.mo
%lang(ru) /usr/share/locale/ru/LC_MESSAGES/sssd.mo
%lang(pt) /usr/share/locale/pt_BR/LC_MESSAGES/sssd.mo
%lang(pt) /usr/share/locale/pt/LC_MESSAGES/sssd.mo
%lang(pl) /usr/share/locale/pl/LC_MESSAGES/sssd.mo
%lang(nl) /usr/share/locale/nl/LC_MESSAGES/sssd.mo
%lang(nb) /usr/share/locale/nb/LC_MESSAGES/sssd.mo
%lang(ja) /usr/share/locale/ja/LC_MESSAGES/sssd.mo
%lang(it) /usr/share/locale/it/LC_MESSAGES/sssd.mo
%lang(id) /usr/share/locale/id/LC_MESSAGES/sssd.mo
%lang(hu) /usr/share/locale/hu/LC_MESSAGES/sssd.mo
%lang(fr) /usr/share/locale/fr/LC_MESSAGES/sssd.mo
%lang(fi) /usr/share/locale/fi/LC_MESSAGES/sssd.mo
%lang(eu) /usr/share/locale/eu/LC_MESSAGES/sssd.mo
%lang(es) /usr/share/locale/es/LC_MESSAGES/sssd.mo
%lang(de) /usr/share/locale/de/LC_MESSAGES/sssd.mo
%lang(cs) /usr/share/locale/cs/LC_MESSAGES/sssd.mo
%lang(ca) /usr/share/locale/ca/LC_MESSAGES/sssd.mo
%lang(bg) /usr/share/locale/bg/LC_MESSAGES/sssd.mo
%lang(ca) /usr/share/man/ca/man5/sssd-simple.5*
%lang(de) /usr/share/man/de/man1/sss_ssh_knownhostsproxy.1*
%lang(de) /usr/share/man/de/man5/sssd-sudo.5*
%lang(de) /usr/share/man/de/man5/sssd-simple.5*
%lang(es) /usr/share/man/es/man5/sssd-simple.5*
%lang(fr) /usr/share/man/fr/man1/sss_ssh_knownhostsproxy.1*
%lang(fr) /usr/share/man/fr/man5/sssd-simple.5*
%lang(ja) /usr/share/man/ja/man1/sss_ssh_knownhostsproxy.1*
%lang(ja) /usr/share/man/ja/man5/sssd-simple.5*

F38:

+ cat sssd_ad.lang
%lang(sv) /usr/share/man/sv/man5/sssd-ad.5*
%lang(uk) /usr/share/man/uk/man5/sssd-ad.5*

C8S:

+ cat sssd_ad.lang

-- empty.

So C8S ends up with empty set and fails.

So far I don't understand:

  • why sets are different?
  • why empty set is a reason to fail? Package could be build with original text only...

@alexey-tikhonov alexey-tikhonov force-pushed the user-config-option branch 2 times, most recently from 28547b4 to 49b86d7 Compare April 10, 2023 15:31
@alexey-tikhonov
Copy link
Member Author

rpm build fails on c8s system with:

Empty %files file /builddir/build/BUILD/sssd-pr6642/sssd_ad.lang

Should be fixed now and ready for review.

Copy link
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 change before accepting the PR

src/conf_macros.m4 Outdated Show resolved Hide resolved
--with-sssd-user=root

In case SSSD was configured and built --with-sssd-user=root, no other
value of 'user' config option (besides default 'root') is supported.
Having it documented in the man page in this case only brings confusion.
Only 'root' and SSSD_USER are valid values.
Copy link
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. Thanks for the patch!

Copy link
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. Ack.

@pbrezina
Copy link
Member

pbrezina commented May 3, 2023

Pushed PR: #6642

  • master
    • 8b94af6 - MONITOR: validate value of 'user' option.
    • 9bf55bf - MONITOR: disable 'user' config option in case --with-sssd-user=root

@pbrezina pbrezina added Pushed and removed Accepted Ready to push Ready to push labels May 3, 2023
@pbrezina pbrezina closed this May 3, 2023
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. Pushed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants