From 7e9a2a188210d460e14bd546db32639a4f466b63 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Wed, 16 Apr 2025 01:39:35 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20fix=20user=20passwd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/create_iso.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/create_iso.rs b/src/create_iso.rs index 5708ecf..296e393 100644 --- a/src/create_iso.rs +++ b/src/create_iso.rs @@ -56,12 +56,7 @@ pub fn create_iso( if let Some((user, pass, uid)) = user { print_status(&format!("Setting user {user}")); - let hashed_pw = run_command( - &["openssl", "passwd", "-6"], - Some(&format!("{pass}\n{pass}\n")), - false, - ) - .0; + let hashed_pw = run_command(&["openssl", "passwd", "-6", pass.as_str()], None, false).0; std::fs::write( "./iso/airootfs/etc/doas.conf", format!("permit persist {user} as root\n"), @@ -71,7 +66,7 @@ pub fn create_iso( std::fs::write("./iso/airootfs/etc/passwd", format!("root:x:0:0:root:/root:/usr/bin/zsh\n{user}:x:{uid}:{uid}::/home/{user}:/usr/bin/zsh\n")).unwrap(); std::fs::write( "./iso/airootfs/etc/shadow", - format!("root::14871::::::\n{user}:{hashed_pw}"), + format!("root::14871::::::\n{user}:{hashed_pw}:14871::::::"), ) .unwrap(); std::fs::write(