Sudo-rs panics when executing a shell script without execute permission

My Ubuntu Budgie install was updated to Ubuntu 25.10 last week which replaced sudo with the rust sudo-rs version.

Today I was executing a bash script with sudo and forgot to grant the script execute permission. Not a big problem however the response from sudo-rs was a panic, rather than a gracefully handled error message.

I retested with a very simple script and the panic is 100% reproducible.

Is this the same bug as: Fix a panic when exec fails with use_pty enabled by bjorn3 · Pull Request #1298 · trifectatechfoundation/sudo-rs · GitHub

sudo ./test

#!/bin/bash
sudo apt update

thread ‘main’ panicked at src/exec/use_pty/monitor.rs:283:45:
internal error: entered unreachable code
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
sudo-rs: cannot execute ‘/home/REDACTED/test’: Permission denied (os error 13)

Please raise a launchpad bug here https://launchpad.net/ubuntu/+source/rust-sudo-rs/+filebug

Try running the following to report it

ubuntu-bug rust-sudo-rs

Please add your findings to the report.

looking at the current issues on that package your issue hasn’t been reported and the last patch to this package is before when the fix upstream was made.

Done. Thanks for the guidance.

1 Like