[Bug 2130973] Re: Sudo-rs panics executing shell script without execute permission
Ghadi Rahme
2130973 at bugs.launchpad.net
Tue Jan 20 17:08:56 UTC 2026
Questing verification:
Installed sudo-rs package is from proposed:
root at build-questing:~/test# apt list --installed sudo-rs
sudo-rs/questing-proposed,now 0.2.8-1ubuntu5.3 amd64 [installed,automatic]
Notice: There are 2 additional versions. Please use the '-a' switch to see them.
1. Create file
root at build-questing:~/test# touch test.sh
2. Make sure it does not have exec permissions
root at build-questing:~/test# ls -l test.sh
-rw-r--r-- 1 root root 0 Jan 20 17:06 test.sh
3. Run sudo on the file
root at build-questing:~/test# sudo ./test.sh
sudo-rs: cannot execute '/root/test/test.sh': Permission denied (os error 13)
sudo returns permission denied without showing any stack trace.
** Tags removed: verification-needed-questing
** Tags added: verification-done-questing
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rust-sudo-rs in Ubuntu.
https://bugs.launchpad.net/bugs/2130973
Title:
Sudo-rs panics executing shell script without execute permission
Status in rust-sudo-rs package in Ubuntu:
Fix Released
Status in rust-sudo-rs source package in Questing:
Fix Committed
Bug description:
Thank you @platform34 for the original description!
[Impact]
Currently running sudo-rs on a script with no execute permissions will lead to a crash of the program. This harms scripts which might expect only a permission denied error and handle them gracefully if they arise. The fix has been made available upstream here: https://github.com/trifectatechfoundation/sudo-rs/commit/eeb1ad77237353cbdf53772ca5278cd1dd1aed1b
Ubuntu 26.04 already has the fix but 25.10 is affected.
[Test Plan]
1. Create a new file and make sure it has no execute permissions:
$ touch test.sh
$ ls -l test.sh
-rw-rw-r-- 1 ghadi ghadi 0 Jan 9 18:41 test.sh
2. Run sudo on the file while using sudo-rs and the following error
will be shown:
$ sudo ./test.sh
[sudo: authenticate] Password:
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 '/path/to/test.sh': Permission denied (os error 13)
The expected behavior is the following output:
$ sudo ./test.sh
sudo-rs: cannot execute '/path/to/test.sh': Permission denied (os error 13)
Where only the permission denied error is printed and sudo does not
panic.
[ Where problems could occur ]
* Since the changes touch on how error messages are sent in sudo-rs,
it is possible that it might block some errors from properly
propagating.
[original description]
My Ubuntu Budgie install was updated to Ubuntu 25.10 last week which replaced sudo with the rust sudo-rs version 0.2.8.
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:
https://github.com/trifectatechfoundation/sudo-rs/pull/1298
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)
ProblemType: Bug
DistroRelease: Ubuntu 25.10
Package: sudo-rs 0.2.8-1ubuntu5
ProcVersionSignature: Ubuntu 6.17.0-6.6-generic 6.17.1
Uname: Linux 6.17.0-6-generic x86_64
ApportVersion: 2.33.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: Budgie
Date: Sun Nov 9 09:25:14 2025
InstallationDate: Installed on 2025-10-23 (17 days ago)
InstallationMedia: Ubuntu-Budgie 25.04 "Plucky Puffin" - Release amd64 (20250415.2)
ProcEnviron:
LANG=en_GB.UTF-8
PATH=(custom, no user)
SHELL=/bin/bash
TERM=xterm-256color
XDG_RUNTIME_DIR=<set>
SourcePackage: rust-sudo-rs
UpgradeStatus: Upgraded to questing on 2025-11-02 (7 days ago)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rust-sudo-rs/+bug/2130973/+subscriptions
More information about the foundations-bugs
mailing list