Skip to content

Comments

Allow non-UTF-8 arguments in sudo#1413

Merged
bjorn3 merged 8 commits intotrifectatechfoundation:mainfrom
bjorn3:args_os_str
Feb 16, 2026
Merged

Allow non-UTF-8 arguments in sudo#1413
bjorn3 merged 8 commits intotrifectatechfoundation:mainfrom
bjorn3:args_os_str

Conversation

@bjorn3
Copy link
Collaborator

@bjorn3 bjorn3 commented Jan 7, 2026

su and visudo don't allow it yet and non-UTF-8 arguments are only passed
through for the command to execute. Not for env vars and paths.

An alternative would be to use env::args_os() but immediately reject non-UTF-8 arguments with a nice error message rather than a panic like currently happens.

Fixes #1412

@bjorn3 bjorn3 requested a review from squell January 7, 2026 10:34
@squell squell added this to the i18n milestone Jan 14, 2026
@bjorn3 bjorn3 force-pushed the args_os_str branch 2 times, most recently from a39ce9f to 1d660d8 Compare February 9, 2026 11:01
@bjorn3
Copy link
Collaborator Author

bjorn3 commented Feb 9, 2026

Blocked on #1438

@bjorn3 bjorn3 force-pushed the args_os_str branch 4 times, most recently from f0b6f43 to db99a97 Compare February 9, 2026 14:49
@bjorn3 bjorn3 marked this pull request as ready for review February 9, 2026 14:50
@squell
Copy link
Member

squell commented Feb 13, 2026

I saw a few easy nits (especially the UTF8 errors peppered throughout the CLI were making the cognitive load higher, and as it's an ad-hoc parser...) that I pushed. For the rest, see below.

@bjorn3 bjorn3 merged commit 1205733 into trifectatechfoundation:main Feb 16, 2026
18 checks passed
@bjorn3 bjorn3 deleted the args_os_str branch February 16, 2026 11:39
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.

malformed username causes crash when use sudo-rs -u <username>

2 participants