[autobackport: 1.2.x] profiles: add with-group-merging feature by sssd-bot · Pull Request #450 · authselect/authselect · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 194 additions & 0 deletions .github/workflows/ci.yml
5 changes: 5 additions & 0 deletions profiles/minimal/README
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ with-pwhistory::
with-altfiles::
Use nss_altfiles for passwd and group nsswitch databases.

with-group-merging::
Enable merging of group records from multiple NSS sources using
[SUCCESS=merge]. Required for services like systemd-homed that
advertise users as part of system groups.

without-nullok::
Do not add nullok parameter to pam_unix.

Expand Down
3 changes: 2 additions & 1 deletion profiles/minimal/nsswitch.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
aliases: files {exclude if "with-custom-aliases"}
automount: files {exclude if "with-custom-automount"}
ethers: files {exclude if "with-custom-ethers"}
group: files [SUCCESS=merge] {if "with-altfiles":altfiles [SUCCESS=merge] }systemd {exclude if "with-custom-group"}
group: files {if "with-altfiles":altfiles }systemd {exclude if "with-custom-group"} {exclude if "with-group-merging"}
group: files [SUCCESS=merge] {if "with-altfiles":altfiles [SUCCESS=merge] }systemd {exclude if "with-custom-group"} {include if "with-group-merging"}
hosts: resolve [!UNAVAIL=return] files myhostname dns {exclude if "with-custom-hosts"}
initgroups: files {exclude if "with-custom-initgroups"}
netgroup: files {exclude if "with-custom-netgroup"}
Expand Down
8 changes: 8 additions & 0 deletions profiles/nis/README
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,19 @@ with-pamaccess::
with-pwhistory::
Enable pam_pwhistory module for local users.

with-altfiles::
Use nss_altfiles for passwd and group nsswitch databases.

with-nispwquality::
If this option is set pam_pwquality module will check password quality
for NIS users as well as local users during password change. Without this
option only local users passwords are checked.

with-group-merging::
Enable merging of group records from multiple NSS sources using
[SUCCESS=merge]. Required for services like systemd-homed that
advertise users as part of system groups.

without-nullok::
Do not add nullok parameter to pam_unix.

Expand Down
5 changes: 3 additions & 2 deletions profiles/nis/nsswitch.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
aliases: files nis {exclude if "with-custom-aliases"}
automount: files nis {exclude if "with-custom-automount"}
ethers: files nis {exclude if "with-custom-ethers"}
group: files [SUCCESS=merge] nis [SUCCESS=merge] systemd {exclude if "with-custom-group"}
group: files {if "with-altfiles":altfiles }nis systemd {exclude if "with-custom-group"} {exclude if "with-group-merging"}
group: files [SUCCESS=merge] {if "with-altfiles":altfiles [SUCCESS=merge] }nis [SUCCESS=merge] systemd {exclude if "with-custom-group"} {include if "with-group-merging"}
hosts: resolve [!UNAVAIL=return] files nis myhostname dns {exclude if "with-custom-hosts"}
initgroups: files nis {exclude if "with-custom-initgroups"}
netgroup: files nis {exclude if "with-custom-netgroup"}
networks: files nis {exclude if "with-custom-networks"}
passwd: files nis systemd {exclude if "with-custom-passwd"}
passwd: files {if "with-altfiles":altfiles }nis systemd {exclude if "with-custom-passwd"}
protocols: files nis {exclude if "with-custom-protocols"}
publickey: files nis {exclude if "with-custom-publickey"}
rpc: files nis {exclude if "with-custom-rpc"}
Expand Down
8 changes: 8 additions & 0 deletions profiles/sssd/README
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,19 @@ with-pamaccess::
with-pwhistory::
Enable pam_pwhistory module for local users.

with-altfiles::
Use nss_altfiles for passwd and group nsswitch databases.

with-files-domain::
If set, SSSD will be contacted before "files" when resolving users and
groups. The order in nsswitch.conf will be set to "sss files" instead of
"files sss" for passwd and group maps.

with-group-merging::
Enable merging of group records from multiple NSS sources using
[SUCCESS=merge]. Required for services like systemd-homed that
advertise users as part of system groups.

with-files-access-provider::
If set, account management for local users is handled also by pam_sss. This
is needed if there is an explicitly configured domain with id_provider=files
Expand Down
5 changes: 3 additions & 2 deletions profiles/sssd/nsswitch.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
passwd: {if "with-files-domain":sss files|files sss} systemd {exclude if "with-custom-passwd"}
group: {if "with-files-domain":sss [SUCCESS=merge] files [SUCCESS=merge]|files [SUCCESS=merge] sss [SUCCESS=merge]} systemd {exclude if "with-custom-group"}
passwd: {if "with-files-domain":sss }files {if "with-altfiles":altfiles }{if not "with-files-domain":sss }systemd {exclude if "with-custom-passwd"}
group: {if "with-files-domain":sss }files {if "with-altfiles":altfiles }{if not "with-files-domain":sss }systemd {exclude if "with-custom-group"} {exclude if "with-group-merging"}
group: {if "with-files-domain":sss [SUCCESS=merge] }files [SUCCESS=merge] {if "with-altfiles":altfiles [SUCCESS=merge] }{if not "with-files-domain":sss [SUCCESS=merge] }systemd {exclude if "with-custom-group"} {include if "with-group-merging"}
netgroup: sss files {exclude if "with-custom-netgroup"}
automount: sss files {exclude if "with-custom-automount"}
services: sss files {exclude if "with-custom-services"}
Expand Down
8 changes: 8 additions & 0 deletions profiles/winbind/README
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ with-pamaccess::
with-pwhistory::
Enable pam_pwhistory module for local users.

with-altfiles::
Use nss_altfiles for passwd and group nsswitch databases.

with-group-merging::
Enable merging of group records from multiple NSS sources using
[SUCCESS=merge]. Required for services like systemd-homed that
advertise users as part of system groups.

without-nullok::
Do not add nullok parameter to pam_unix.

Expand Down
5 changes: 3 additions & 2 deletions profiles/winbind/nsswitch.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
passwd: files winbind systemd {exclude if "with-custom-passwd"}
group: files [SUCCESS=merge] winbind [SUCCESS=merge] systemd {exclude if "with-custom-group"}
passwd: files {if "with-altfiles":altfiles }winbind systemd {exclude if "with-custom-passwd"}
group: files {if "with-altfiles":altfiles }winbind systemd {exclude if "with-custom-group"} {exclude if "with-group-merging"}
group: files [SUCCESS=merge] {if "with-altfiles":altfiles [SUCCESS=merge] }winbind [SUCCESS=merge] systemd {exclude if "with-custom-group"} {include if "with-group-merging"}
2 changes: 1 addition & 1 deletion rpm/authselect.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fi
if test -e /run/ostree-booted; then
for PROFILE in `ls %{_datadir}/authselect/default`; do
%{_bindir}/authselect create-profile $PROFILE --vendor --base-on $PROFILE --symlink-pam --symlink-dconf --symlink=REQUIREMENTS --symlink=README &> /dev/null
%__sed -ie "s/^\(passwd\|group\):\(.*\)systemd\(.*\)/\1:\2systemd altfiles\3/g" %{_datadir}/authselect/vendor/$PROFILE/nsswitch.conf &> /dev/null
%__sed -i -e 's/{if "with-altfiles":\([^}]\+\)}/\1/g' %{_datadir}/authselect/vendor/$PROFILE/nsswitch.conf &> /dev/null
done
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/commands/install-build-deps.sh
Loading