Skip to content

pwdx: accept a pid given as /proc/PID - #829

Merged
sylvestre merged 1 commit into
uutils:mainfrom
qodelicious:pwdx-proc-prefix
Nov 6, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
qodelicious:pwdx-proc-prefix

Conversation

@qodelicious

Copy link
Copy Markdown
Contributor

procps-ng pwdx also accepts a pid written as /proc/PID, and uses the argument as given in its output. We rejected it as an invalid process id.

This strips a leading /proc/ before parsing and prints the argument as given, so pwdx /proc/123 prints /proc/123: /some/dir. Normal pids print the same as before. Added a test that fails on main.

Fixes #828

@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.73%. Comparing base (67832aa) to head (81b6820).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
src/uu/pwdx/src/pwdx.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #829      +/-   ##
==========================================
+ Coverage   19.20%   19.73%   +0.53%     
==========================================
  Files          68       68              
  Lines       10156    10284     +128     
  Branches      546      553       +7     
==========================================
+ Hits         1950     2030      +80     
- Misses       8206     8254      +48     
Flag Coverage Δ
macos_latest 7.01% <80.76%> (+0.26%) ⬆️
ubuntu_latest 20.10% <80.76%> (+0.54%) ⬆️
windows_latest 0.02% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sylvestre
sylvestre merged commit f365be6 into uutils:main Nov 6, 2026
18 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

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.

pwdx: a /proc/PID argument is rejected

2 participants