preserve rust cargo environment variables while running with superuser privileges
I have rust installed for a particular user /home/user1/.cargo
. But to run the binary that’s been been created using cargo build
, I need superuser
privileges. So, I thought to run like sudo -E cargo run
, but this results in an error cargo: No file or directory
. Why sudo -E
option doesn’t preserve the cargo
related environment variables.
Why does Rust users crate return “root” in list of groups for user?
I’m using the User::groups()
function in the Rust users crate, which calls C function getgrouplist()
to get Linux groups containing the effective user:
How to send command to a program run with bash in rust
I’m running a java minecraft server through bash with rust and need to input /stop into the java server, I’m new to rust and this is the first program I’ve written.