Skip to content

pwcat: add password database dump utility#63

Open
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:feature-issue#61-add-pwcat
Open

pwcat: add password database dump utility#63
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:feature-issue#61-add-pwcat

Conversation

@Franklin-Qi

Copy link
Copy Markdown
Contributor

Add a pwcat binary that prints the password database in /etc/passwd format for gawk library routines, matching the helper shipped with GNU awk.

Includes integration tests that validate the seven-field output format and compare against getent passwd.

Closes #61

@Alonely0 Alonely0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As oech3 had mentioned in the other PR, we would really prefer not to use libc directly if we can help it. I can't see these functions implemented in either nix or rustix, so maybe we could add a safe API boundary in uucore and reuse it here? Mentioning this since we plan to reuse a lot of functionality from uucore in the interpreter directly.

Comment thread src/bin/pwcat.rs Outdated
Comment thread src/bin/pwcat.rs Outdated
@Alonely0

Alonely0 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

PD: use cfg_attr to set an ignore attribute on all tests when not running on Linux.

Comment thread src/bin/pwcat.rs Outdated
Add a `pwcat` binary that prints the password database in `/etc/passwd`
format for gawk library routines, matching the helper shipped with GNU awk.

Includes integration tests that validate the seven-field output format and
compare against `getent passwd`.

Closes uutils#61
@Franklin-Qi Franklin-Qi force-pushed the feature-issue#61-add-pwcat branch from 9852239 to c2117de Compare July 6, 2026 07:43
@Franklin-Qi

Copy link
Copy Markdown
Contributor Author

PD: use cfg_attr to set an ignore attribute on all tests when not running on Linux.

Thanks for the review and the great suggestion; I’ve frequently encountered this issue before.

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.

Add pwcat command

3 participants