another attempt at setting the password

axtloss/rework-partitioning
amy 3 years ago
parent 533b9e7cb1
commit 1a0e4775e3

@ -33,16 +33,16 @@ pub fn new_user(username: &str, hasroot: bool, password: &str) {
"bash", "bash",
vec![ vec![
String::from("-c"), String::from("-c"),
String::from("usermod"), String::from("'usermod"),
String::from("--password"), String::from("--password"),
String::from("$(echo"), String::from("$(echo"),
format!("${{{}}}", password), String::from(password),
String::from("|"), String::from("|"),
String::from("openssl"), String::from("openssl"),
String::from("passwd"), String::from("passwd"),
String::from("-1"), String::from("-1"),
String::from("-stdin)"), String::from("-stdin)"),
String::from(username), format!("{}'", username),
], ],
), ),
format!("Set password for user {}", username).as_str(), format!("Set password for user {}", username).as_str(),
@ -56,16 +56,16 @@ pub fn root_pass(root_pass: &str) {
"bash", "bash",
vec![ vec![
String::from("-c"), String::from("-c"),
String::from("usermod"), String::from("'usermod"),
String::from("--password"), String::from("--password"),
String::from("$(echo"), String::from("$(echo"),
format!("${{{}}}", root_pass), String::from(root_pass),
String::from("|"), String::from("|"),
String::from("openssl"), String::from("openssl"),
String::from("passwd"), String::from("passwd"),
String::from("-1"), String::from("-1"),
String::from("-stdin)"), String::from("-stdin)"),
String::from("root"), String::from("root'"),
], ],
), ),
"set root password", "set root password",

Loading…
Cancel
Save