From 699ef6eb8651c09e26f7da6d9ead653c7c7ec25b Mon Sep 17 00:00:00 2001 From: amy Date: Sun, 23 Jan 2022 19:06:40 +0100 Subject: [PATCH] maybe this'll work --- src/functions/users.rs | 2 +- src/internal/exec.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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 }