Skip to content

feat: implement name_converter module parameter for uid/gid mapping#2620

Merged
oferchen merged 2 commits intomasterfrom
feature/name-converter
Mar 10, 2026
Merged

feat: implement name_converter module parameter for uid/gid mapping#2620
oferchen merged 2 commits intomasterfrom
feature/name-converter

Conversation

@oferchen
Copy link
Owner

Summary

  • Implements the name converter daemon module parameter, allowing uid/gid name resolution via an external subprocess instead of NSS lookups
  • Adds NameConverterCallbacks trait and thread-local converter slot to metadata::id_lookup for dependency-inverted name resolution
  • Spawns a long-lived subprocess communicating via stdin/stdout line protocol (uid|gid|usr|grp {arg}\n → response line)
  • RAII guard (NameConverterGuard) ensures cleanup on drop, preventing stale converters across transfers
  • Wired into process_approved_module() after privilege reduction, with %-variable expansion for the command string

Test plan

  • Unit tests for all four query directions (uid→name, gid→name, name→uid, name→gid)
  • Broken pipe and empty response handling tests
  • Thread-local interception test verifying converter overrides NSS lookups
  • Guard drop test confirming converter cleanup
  • Protocol dispatch test with realistic shell script converter
  • Non-numeric response handling for name→id queries
  • Clippy clean with all features

@github-actions github-actions bot added the enhancement New feature or request label Mar 10, 2026
@oferchen oferchen merged commit b1f3d7c into master Mar 10, 2026
32 checks passed
@oferchen oferchen deleted the feature/name-converter branch March 10, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant