. "$BST_LIB" # base-passwd ships no binary in the image: its main package is empty and, via a # preinst, installs the master /etc/passwd and /etc/group. (update-passwd builds # into a separate subpackage this image does not install.) Coverage is the two # database files, the root entry in each, and that the database is functionally # consumed for name resolution. # # Name resolution on the static wasm32-hwjs glibc image reaches the database two # ways, both asserted below: # - file-reading tools (busybox id/ls, and su/login/dpkg's useradd) parse # /etc/passwd + /etc/group directly. # - glibc getpwnam/getpwuid (GNU coreutils id/ls/chown by name) resolves via # the builtin 'files' NSS service — the image nsswitch.conf uses 'files' # (not the dlopen'd 'compat', which cannot load on the static image). check base-passwd/passwd test -f /etc/passwd check base-passwd/group test -f /etc/group check_out base-passwd/root-user ":0:0:root:" cat /etc/passwd check_out base-passwd/root-grp "root:*:0:" cat /etc/group # name resolution via the file-reading consumers base-passwd actually feeds: check_out base-passwd/id-root "uid=0(root)" busybox id root check_out base-passwd/ls-names "root" busybox ls -ld / # glibc getpwnam/getpwuid path (GNU coreutils by-name/by-id resolution): check_out base-passwd/nss-getpwnam "uid=0(root)" id root check_out base-passwd/nss-ls-names "root" ls -ld / check base-passwd/nss-chown sh -c "touch /tmp/.bst-chown && chown root:root /tmp/.bst-chown && rm -f /tmp/.bst-chown"