Skip to content

cfg_rules: add pwfield to allowed_domain_options - #9034

Merged
alexey-tikhonov merged 2 commits into
SSSD:masterfrom
mmatsuya:fix/cfg-rules-pwfield-domain
Aug 4, 2026
Merged

cfg_rules: add pwfield to allowed_domain_options#9034
alexey-tikhonov merged 2 commits into
SSSD:masterfrom
mmatsuya:fix/cfg-rules-pwfield-domain

Conversation

@mmatsuya

@mmatsuya mmatsuya commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Problem

pwfield was made configurable per-domain in commit c778c36
(CONFDB: Make pwfield configurable per-domain, 2016), but
cfg_rules.ini was never updated. As a result, sssctl config-check
rejects pwfield in any [domain/*] section:

[rule/allowed_domain_options]: Attribute 'pwfield' is not allowed in
section 'domain/local'. Check for typos.

This surfaces in practice when a test or deployment sets pwfield=x
in a proxy domain with proxy_lib_name=files to work around the
*-vs-x issue documented in #5129. Even though SSSD reads and
respects the value at runtime (via confdb.c), the config validator
incorrectly rejects it.

Fix

Add pwfield to [rule/allowed_domain_options] in cfg_rules.ini,
placing it alongside the other NSS override options (filter_users,
filter_groups).

Testing

Verified that sssctl config-check no longer reports an error for
a [domain/local] section containing pwfield=x.

Resolves: #5129

@alexey-tikhonov

Copy link
Copy Markdown
Member

Out of curiosity:

This surfaces in practice when a test or deployment sets pwfield=x
in a proxy domain with proxy_lib_name=files

-- this should be a default: “x” (proxy domain with nss_files and sssd-shadowutils target)?
Doesn't it work?

@alexey-tikhonov

alexey-tikhonov commented Aug 3, 2026

Copy link
Copy Markdown
Member

In general, this is correct fix, but I think we also need to update the man page, that currently mentions this option only in "NSS configuration options" section.

@mmatsuya

mmatsuya commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Out of curiosity:

This surfaces in practice when a test or deployment sets pwfield=x
in a proxy domain with proxy_lib_name=files

-- this should be a default: “x” (proxy domain with nss_files and sssd-shadowutils target)? Doesn't it work?

The auto-set of pwfield=x only applies when proxy_pam_target=sssd-shadowutils (since ffb9ad1).

In this test case covered by sssd-test-framework#265, local() uses proxy_pam_target=system-auth (standard PAM stack, not sssd-shadowutils). With that target, SSSD proxy returns * for the password field instead of x. pam_unix then treats the account as locked, causing SSH authentication to fail for local users. Setting pwfield=x explicitly in the domain section bypasses this and restores the correct behavior. This is the scenario the fix is intended to cover.

NOTE: I am going to reopen sssd-test-framework#265 after this PR was merged.

@mmatsuya

mmatsuya commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

In general, this is correct fix, but I think we also need to update the man page, that currently mentions this option only in "NSS configuration options" section.

I will update the man page as well.

@mmatsuya
mmatsuya force-pushed the fix/cfg-rules-pwfield-domain branch from c9032dc to 9bb447f Compare August 3, 2026 12:21
@mmatsuya

mmatsuya commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi @alexey-tikhonov, I updated part of the existing pwfield (string) in man page.

@alexey-tikhonov alexey-tikhonov self-assigned this Aug 4, 2026
The pwfield option was made configurable per-domain in commit c778c36
(CONFDB: Make pwfield configurable per-domain), but cfg_rules.ini was
not updated at the same time. As a result, sssctl config-check rejects
pwfield when it appears in a [domain/*] section with:

  [rule/allowed_domain_options]: Attribute 'pwfield' is not allowed in
  section 'domain/local'. Check for typos.

Add pwfield to [rule/allowed_domain_options] to match the documented
and implemented behavior.

Resolves: SSSD#5129

Signed-off-by: Masahiro Matsuya <mmatsuya@redhat.com>
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
pwfield has been configurable per-domain since commit c778c36
(2016), but the man page only had a brief note about it. Expand the
existing NSS section entry to describe the per-domain use case:
proxy+files with proxy_pam_target other than sssd-shadowutils, where
SSSD returns '*' causing pam_unix to lock all accounts.

Signed-off-by: Masahiro Matsuya <mmatsuya@redhat.com>
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
@sssd-bot

sssd-bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The pull request was accepted by @alexey-tikhonov with the following PR CI status:


🟢 CodeQL (success)
🟢 osh-diff-scan:fedora-rawhide-x86_64:upstream (success)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-44-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 testing-farm:centos-stream-10-x86_64:upstream (success)
🔴 testing-farm:fedora-43-x86_64:upstream (failure)
🔴 testing-farm:fedora-44-x86_64:upstream (failure)
🔴 testing-farm:fedora-rawhide-x86_64:upstream (failure)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🟢 ci / intgcheck (centos-10) (success)
🟢 ci / intgcheck (fedora-43) (success)
🟢 ci / intgcheck (fedora-44) (success)
🟢 ci / intgcheck (fedora-45) (success)
🟢 ci / prepare (success)
🔴 ci / system (centos-10) (failure)
🟢 ci / system (fedora-43) (success)
🟢 ci / system (fedora-44) (success)
🔴 ci / system (fedora-45) (failure)
➖ Coverity scan / coverity (skipped)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / pre-commit (success)
🟢 Static code analysis / python-system-tests (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@sssd-bot
sssd-bot force-pushed the fix/cfg-rules-pwfield-domain branch from 9bb447f to cb0f8f6 Compare August 4, 2026 12:25
@alexey-tikhonov
alexey-tikhonov merged commit e3f869d into SSSD:master Aug 4, 2026
1 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

id_provider = proxy proxy_lib_name = files returns * in password field, breaking PAM authentication

4 participants