diff --git a/hook-tests/002-setup_user.test b/hook-tests/002-setup_user.test index ec104e77..1adaab4a 100755 --- a/hook-tests/002-setup_user.test +++ b/hook-tests/002-setup_user.test @@ -5,3 +5,7 @@ set -e for prefix in passwd group shadow; do grep -q "^${prefix}:.*extrausers" etc/nsswitch.conf done + +for prefix in passwd group; do + grep -q "^${prefix}:.*snapd" etc/nsswitch.conf +done diff --git a/hooks/002-setup_user.chroot b/hooks/002-setup_user.chroot index ad07b0e1..a0f2bee1 100755 --- a/hooks/002-setup_user.chroot +++ b/hooks/002-setup_user.chroot @@ -24,8 +24,8 @@ for name in gshadow shadow; do done # Enable libnss-extrusers -sed -i 's/^passwd:.*files/\0 extrausers/' /etc/nsswitch.conf -sed -i 's/^group:.*files/\0 extrausers/' /etc/nsswitch.conf +sed -i 's/^passwd:.*files/\0 extrausers snapd/' /etc/nsswitch.conf +sed -i 's/^group:.*files/\0 extrausers snapd/' /etc/nsswitch.conf sed -i 's/^shadow:.*files/\0 extrausers/' /etc/nsswitch.conf # Enable pam configuration for extrausers diff --git a/snapcraft.yaml b/snapcraft.yaml index ebaa8795..be85bcae 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -48,6 +48,13 @@ parts: copyright: usr/share/doc/plymouth-theme-ubuntu-core/copyright stage: - -README.md + nss-snapd: + plugin: make + source: https://github.com/canonical/nss-snapd.git + source-type: git + make-parameters: + - prefix=/usr + - libdir=/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR} bootstrap: after: - base