Correctly set environment
This commit is contained in:
@@ -64,7 +64,10 @@ pub fn main() {
|
||||
command.gid(passwd.gid);
|
||||
|
||||
command.env("USER", &user);
|
||||
command.env("UID", format!("{}", passwd.uid));
|
||||
command.env("GROUPS", format!("{}", passwd.gid));
|
||||
command.env("HOME", passwd.home);
|
||||
command.env("SHELL", passwd.shell);
|
||||
|
||||
match command.spawn() {
|
||||
Ok(mut child) => match child.wait() {
|
||||
|
||||
@@ -57,6 +57,8 @@ pub fn main() {
|
||||
command.uid(0);
|
||||
command.gid(0);
|
||||
command.env("USER", "root");
|
||||
command.env("UID", "0");
|
||||
command.env("GROUPS", "0");
|
||||
|
||||
match command.spawn() {
|
||||
Ok(mut child) => match child.wait() {
|
||||
|
||||
Reference in New Issue
Block a user