diff --git a/src/functions/users.rs b/src/functions/users.rs index 129e97f..5d2b8d7 100755 --- a/src/functions/users.rs +++ b/src/functions/users.rs @@ -57,7 +57,7 @@ pub fn root_pass(root_pass: &str) { vec![ String::from("-c"), format!( - "'usermod --password $(echo {} | openssl passwd -1 -stdin) root'", + r#"'usermod --password $(echo {} | openssl passwd -1 -stdin) root'"#, root_pass ), ], diff --git a/src/internal/exec.rs b/src/internal/exec.rs index 116db81..95ff263 100755 --- a/src/internal/exec.rs +++ b/src/internal/exec.rs @@ -9,9 +9,11 @@ pub fn exec_chroot( command: &str, args: Vec, ) -> Result { - let returncode = Command::new("arch-chroot") - .args(&["/mnt", command]) - .args(args) + let returncode = Command::new("bash") + .args(&[ + "-c", + format!("arch-chroot /mnt {} {}", command, args.join(" ")).as_str(), + ]) .status(); returncode }