Skip to content

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

@dmknght

Description

@dmknght

Describe the bug
When runs sudo-rs with malformed username, sudo-rs crashes with only simple backtrace error thread 'main panicked and called unwrap error.

To Reproduce
Steps to reproduce the behavior:

  1. Run command sudo-rs -u $(head -n 30 /dev/random)
  2. Error shows like screenshot bellow
Image

I tried adding RUST_BACKTRACE=full but the result wasn't really useful

Image

Expected behavior
App shouldn't crash. It should show unknown user like original sudo

Image

Additional way is to show invalid username instead

Environment:

  • Linux distribution: Ubuntu 25.04
  • sudo-rs version: sudo-rs 0.2.4

Metadata

Metadata

Assignees

Labels

C-cliCLI interfacebugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions