From 1a0e4775e36942c7e6a4847b65129eaa27e5df2f Mon Sep 17 00:00:00 2001 From: amy Date: Sun, 23 Jan 2022 18:20:32 +0100 Subject: [PATCH] another attempt at setting the password --- src/functions/users.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/functions/users.rs b/src/functions/users.rs index cc119ec..94e67cf 100755 --- a/src/functions/users.rs +++ b/src/functions/users.rs @@ -33,16 +33,16 @@ pub fn new_user(username: &str, hasroot: bool, password: &str) { "bash", vec![ String::from("-c"), - String::from("usermod"), + String::from("'usermod"), String::from("--password"), String::from("$(echo"), - format!("${{{}}}", password), + String::from(password), String::from("|"), String::from("openssl"), String::from("passwd"), String::from("-1"), String::from("-stdin)"), - String::from(username), + format!("{}'", username), ], ), format!("Set password for user {}", username).as_str(), @@ -56,16 +56,16 @@ pub fn root_pass(root_pass: &str) { "bash", vec![ String::from("-c"), - String::from("usermod"), + String::from("'usermod"), String::from("--password"), String::from("$(echo"), - format!("${{{}}}", root_pass), + String::from(root_pass), String::from("|"), String::from("openssl"), String::from("passwd"), String::from("-1"), String::from("-stdin)"), - String::from("root"), + String::from("root'"), ], ), "set root password",