Bug 1751417 - authselect removes altfiles, breaking Silverblue
Summary: authselect removes altfiles, breaking Silverblue
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: authselect
Version: 32
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Pavel Březina
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-11 23:55 UTC by Nathaniel McCallum
Modified: 2023-09-14 05:43 UTC (History)
7 users (show)

Fixed In Version: authselect-1.2.2-1.fc33
Clone Of:
Environment:
Last Closed: 2020-12-10 01:13:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Nathaniel McCallum 2019-09-11 23:55:43 UTC
On a new Silverblue install, if you run authselect it regenerates /etc/nsswitch.conf. This is mostly great. However, on Silverblue, this new configuration removes altfiles from passwd and group. This causes all sorts of system stuff to break and then gdm won't properly start.

Adding altfiles back in fixes the problem. Please make authselect do the right thing on Silverblue. Thanks!

Comment 1 Pavel Březina 2019-09-16 08:14:07 UTC
In such scenario where different passwd and group is needed you can run e.g.: `authselect select sssd with-custom-passwd with-custom-group` and it will keep your setting.

Additionally, you can avoid using altfiles and use SSSD instead. SSSD can serve local users from /etc/passwd and from other locations as well. For example (see man sssd-files):

[domain/files]
id_provider = files
passwd_files = /etc/passwd, /etc/other_passwd
group_files = /etc/group, /etc/other_group

Comment 2 Pavel Březina 2019-10-02 12:40:38 UTC
Another solution would be to create a vendor profile [1] that can override the profiles shipped with authselect and distribute this profile with Silverblue.

sudo authselect create-profile sssd --vendor --base-on sssd --symlink-pam --symlink-dconf --symlink=REQUIREMENTS --symlink=README
sudo sed -ie "s/^\(passwd:\s*sss files\)\(.*\)/\1 altfiles\2/g" /usr/share/authselect/vendor/sssd/nsswitch.conf
sudo sed -ie "s/^\(group:\s*sss files\)\(.*\)/\1 altfiles\2/g" /usr/share/authselect/vendor/sssd/nsswitch.conf

[1] https://github.com/pbrezina/authselect/wiki/Profiles:-Types#vendor-profiles

Comment 3 Pavel Březina 2020-03-19 10:55:15 UTC
Can you please try this scratch build?
https://koji.fedoraproject.org/koji/taskinfo?taskID=42614641

It is for F30 but I can provide you with some newer version. It automatically creates the vendor profiles suggested in previous comment.

Comment 4 Ben Cotton 2020-04-30 20:20:17 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '30'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 30 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Pavel Březina 2020-05-25 09:56:27 UTC
The previous scratch build is no longer available so here is new for rawhide:
https://koji.fedoraproject.org/koji/taskinfo?taskID=44947194

Comment 6 Ben Cotton 2020-05-26 14:26:59 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Colin Walters 2020-09-15 12:54:35 UTC
What we want is just "add `altfiles` after `files` to whatever else is there".  We don't want to make any optional profiles - to say this more strongly, removing `altfiles` should *not* be a configurable option.

Comment 8 Timothée Ravier 2020-09-30 13:31:28 UTC
Re-opened as this is apparently still an issue on latest Silverblue: https://discussion.fedoraproject.org/t/joining-a-domain-breaks-system/23601/4

Comment 9 Pavel Březina 2020-10-01 10:24:46 UTC
Please, find scratch build at https://koji.fedoraproject.org/koji/taskinfo?taskID=52573921

It adds nss-altfiles to the authselect profiles (only on Silverblue) so it should make it work since Silverblue relies on this module. This is done in %posttrans scriptlet since Silverblue team did not want to have a special package. However, I don't have any Silverblue instance handy so this is totally untested.

The scriptlet looks like this:
if %__grep -i silverblue /etc/os-release &> /dev/null; 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
    done
fi

Comment 10 Pavel Březina 2020-11-12 10:18:45 UTC
Renewed scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=55445978

Comment 11 David Jaša 2020-11-13 14:55:14 UTC
(In reply to Pavel Březina from comment #10)
> Renewed scratch build:
> https://koji.fedoraproject.org/koji/taskinfo?taskID=55445978

Just tested. It works on SilverBlue rawhide, ‘authfiles’ is added to nsswitch configuration just fine:

[test@silverblue33 ~]$ cat /etc/fedora-release 
Fedora release 34 (Rawhide)
[test@silverblue33 ~]$ cat /etc/fedora-release ; grep -rIsn altfile /usr/share/authselect/
Fedora release 34 (Rawhide)
/usr/share/authselect/default/minimal/README:35:with-altfiles::
/usr/share/authselect/default/minimal/README:36:    Use nss_altfiles for passwd and group nsswitch databases.
/usr/share/authselect/default/minimal/REQUIREMENTS:5:- with-altfiles is selected, make sure nss_altfiles module is present                     {include if "with-altfiles"}
/usr/share/authselect/default/minimal/nsswitch.conf:4:group:      files {if "with-altfiles":altfiles }systemd {exclude if "with-custom-group"}
/usr/share/authselect/default/minimal/nsswitch.conf:9:passwd:     files {if "with-altfiles":altfiles }systemd {exclude if "with-custom-passwd"}
/usr/share/authselect/vendor/minimal/nsswitch.conf:4:group:      files {if "with-altfiles":altfiles }systemd altfiles {exclude if "with-custom-group"}
/usr/share/authselect/vendor/minimal/nsswitch.conf:9:passwd:     files {if "with-altfiles":altfiles }systemd altfiles {exclude if "with-custom-passwd"}
/usr/share/authselect/vendor/minimal/nsswitch.confe:4:group:      files {if "with-altfiles":altfiles }systemd {exclude if "with-custom-group"}
/usr/share/authselect/vendor/minimal/nsswitch.confe:9:passwd:     files {if "with-altfiles":altfiles }systemd {exclude if "with-custom-passwd"}
/usr/share/authselect/vendor/nis/nsswitch.conf:4:group:      files nis systemd altfiles           {exclude if "with-custom-group"}
/usr/share/authselect/vendor/nis/nsswitch.conf:9:passwd:     files nis systemd altfiles           {exclude if "with-custom-passwd"}
/usr/share/authselect/vendor/sssd/nsswitch.conf:1:passwd:     sss files systemd altfiles   {exclude if "with-custom-passwd"}
/usr/share/authselect/vendor/sssd/nsswitch.conf:2:group:      sss files systemd altfiles   {exclude if "with-custom-group"}
/usr/share/authselect/vendor/winbind/nsswitch.conf:1:passwd:     files winbind systemd altfiles    {exclude if "with-custom-passwd"}
/usr/share/authselect/vendor/winbind/nsswitch.conf:2:group:      files winbind systemd altfiles    {exclude if "with-custom-group"}
[test@silverblue33 ~]$ sudo authselect select sssd --force
[sudo] password for test: 
Backup stored at /var/lib/authselect/backups/2020-11-13-14-19-07.Et9Pgx
Profile "sssd" was selected.
The following nsswitch maps are overwritten by the profile:
- passwd
- group
- netgroup
- automount
- services

Make sure that SSSD service is configured and enabled. See SSSD documentation for more information.

[test@silverblue33 ~]$ grep -rIsn altfiles /etc/nsswitch.conf
22:passwd:     sss files systemd altfiles
23:group:      sss files systemd altfiles

Comment 12 Pavel Březina 2020-11-18 12:13:12 UTC
Upstream ticket:
https://github.com/authselect/authselect/issues/226

Comment 13 Pavel Březina 2020-11-18 12:24:10 UTC
Upstream PR:
https://github.com/authselect/authselect/pull/229

Comment 14 Pavel Březina 2020-11-25 09:43:58 UTC
* `master`
  * 9e14ff3cd1cb8a84561d1b8adeaf00c42c4ce5c4 - spec: Add nss-altfiles on Silverblue

Comment 15 Fedora Update System 2020-11-30 10:56:33 UTC
FEDORA-2020-cf99202fdc has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-cf99202fdc

Comment 16 Fedora Update System 2020-12-01 02:13:38 UTC
FEDORA-2020-cf99202fdc has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-cf99202fdc`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-cf99202fdc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2020-12-10 01:13:26 UTC
FEDORA-2020-cf99202fdc has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 18 Red Hat Bugzilla 2023-09-14 05:43:09 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.