Correctly set environment

This commit is contained in:
Jeremy Soller
2017-01-10 09:50:23 -07:00
parent 13ef8943df
commit ccae9c0b0a
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -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() {
+2
View File
@@ -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() {