Skip to content

Add libnss_pwb NSS support to workbench-session (jammy + noble)#132

Merged
bschwedler merged 2 commits into
mainfrom
worktree-rosy-marinating-reef
Jun 16, 2026
Merged

Add libnss_pwb NSS support to workbench-session (jammy + noble)#132
bschwedler merged 2 commits into
mainfrom
worktree-rosy-marinating-reef

Conversation

@ssinnott

Copy link
Copy Markdown
Contributor

Summary

  • Creates build-time dangling symlinks from the glibc NSS multiarch paths to /usr/lib/rstudio-server/bin/{jammy,noble}/libnss_pwb.so — the location populated at runtime by workbench-session-init
  • Appends pwb after files in nsswitch.conf for passwd, group, and shadow so rootless session users resolve via the Workbench API instead of failing a /etc/passwd lookup
  • Handles both amd64 (x86_64-linux-gnu) and arm64 (aarch64-linux-gnu) via TARGETARCH

Dormant-safe: with no workbench-nss.conf present (or WORKBENCH_NSS_CONFIG_PATH unset), the module returns UNAVAIL and resolution falls through to files — non-rootless containers are unaffected.

Companion to rstudio/rstudio-docker-products#1053, extending the same pattern to both ubuntu2204 (jammy) and ubuntu2404 (noble).

Test plan

  • Build image: bakery build --image-name workbench-session
  • Confirm symlink (jammy): ls -la /usr/lib/x86_64-linux-gnu/libnss_pwb.so.2../rstudio-server/bin/jammy/libnss_pwb.so
  • Confirm symlink (noble): ls -la /usr/lib/x86_64-linux-gnu/libnss_pwb.so.2../rstudio-server/bin/noble/libnss_pwb.so
  • Confirm nsswitch: grep -E '^(passwd|group|shadow)' /etc/nsswitch.conf shows files pwb
  • Confirm graceful fallthrough (dangling symlink, no config): getent passwd root resolves without error
  • Runtime test with init container populating the volume: getent passwd <rootless-session-user> resolves via pwb

Create a build-time dangling symlink from the glibc NSS multiarch path to
/usr/lib/rstudio-server/bin/{jammy,noble}/libnss_pwb.so and append pwb
after files in nsswitch.conf for passwd, group, and shadow. Dormant-safe:
with no workbench-nss.conf present the module returns UNAVAIL and
resolution falls through to files — non-rootless containers are unaffected.

Companion to rstudio/rstudio-docker-products#1053.

@zachhannum zachhannum left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bschwedler bschwedler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good.

Please add some goss tests for this. Thanks!

Verifies the nsswitch.conf entries for passwd/group/shadow include the
pwb module, and that the architecture-specific dangling symlink for
libnss_pwb.so.2 was created at image build time.
@ssinnott ssinnott requested a review from bschwedler June 12, 2026 17:36

@skyeturriff skyeturriff left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@bschwedler bschwedler merged commit aa01f66 into main Jun 16, 2026
88 checks passed
@bschwedler bschwedler deleted the worktree-rosy-marinating-reef branch June 16, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants