Doesn't update /etc/nsswitch.conf when using winbind

Bug #1980246 reported by Andreas Hasenack
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Confirmed
Low
Unassigned
Lunar
Fix Released
Undecided
Unassigned

Bug Description

realmd is not updating /etc/nsswitch.conf with "winbind" when using --client-software=winbind to join an AD domain.

This is configurable per distro, and the debian configuration doesn't specify a method to do this:

service/realmd-debian.conf:
[commands]

# Various pam and nss plugins are automatically configured when
# installed on debian. So just stub them out.

winbind-enable-logins =
winbind-disable-logins =
sssd-enable-logins =
sssd-disable-logins =

For the sssd case, it's correct to remain empty because the sssd packages themselves (libnss-sss specifically) update /etc/nsswitch.conf upon installation. But libnss-winbind doesn't.

One could argue that it's libnss-winbind that should update /etc/nsswitch.conf upon installation, in which case this bug should be against that package. That would be better solved on the debian side first.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in realmd (Ubuntu):
status: New → Confirmed
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This was fixed in debians samba package 4.17.3-3[1], by having the libnss-winbind postinst handle /etc/nsswitch.conf:

if [ "$1" = configure ] && [ -z "$2" ]; then
    echo "First installation detected, adding winbind to /etc/nsswitch.conf..."
    if ! [ -e /etc/nsswitch.conf ]; then
        echo "Could not find /etc/nsswitch.conf."
    else
        sed -r -i \
          -e '/^(passwd|group):.*[[:space:]]winbind\b/b' \
          -e 's/^(passwd|group):.*/& winbind/' \
          /etc/nsswitch.conf
    fi
fi

This change is available in lunar and later.
1. https://launchpad.net/debian/+source/samba/2:4.17.3+dfsg-3
2. https://git.launchpad.net/ubuntu/+source/samba/tree/debian/libnss-winbind.postinst?h=import/2%254.17.3%2bdfsg-3

affects: realmd (Ubuntu) → samba (Ubuntu)
Changed in samba (Ubuntu Lunar):
status: New → Fix Released
Changed in samba (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Would be good to have this fixed in jammy as well, so I added a jammy task to the bug.

Changed in samba (Ubuntu Jammy):
status: New → Confirmed
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.