trifectatechfoundation / sudo-rs

A memory safe implementation of sudo and su.
Other
2.87k stars 76 forks source link

sudo-rs fails with `cannot execute 'command': Function not implemented (os error 38)` #853

Closed sylvestre closed 1 month ago

sylvestre commented 1 month ago
$ sudo-rs ls
sudo-rs: cannot execute '/usr/bin/ls': Function not implemented (os error 38)

Opening to document the problem and how I noticed it.

$ LANG=C /usr/bin/sudo strace -f -s 65000 -o foo.log ./target/debug/sudo /usr/bin/ls        
$ grep "Function not" foo.log
 close_range(3, 3, 0)              = -1 ENOSYS (Function not implemented)

See to be used here: https://github.com/trifectatechfoundation/sudo-rs/blob/main/src/system/mod.rs#L107

Maybe sudo-rs should check the kernel version and trigger a better error message. The doc is clear: Linux kernel 5.9 or newer is necessary to run sudo-rs. but the error message isn't :)

I will submit PR