🚑️ fix user passwd
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
JMARyA 2025-04-16 01:39:35 +02:00
parent fa6439bce8
commit 7e9a2a1882
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -56,12 +56,7 @@ pub fn create_iso(
if let Some((user, pass, uid)) = user { if let Some((user, pass, uid)) = user {
print_status(&format!("Setting user {user}")); print_status(&format!("Setting user {user}"));
let hashed_pw = run_command( let hashed_pw = run_command(&["openssl", "passwd", "-6", pass.as_str()], None, false).0;
&["openssl", "passwd", "-6"],
Some(&format!("{pass}\n{pass}\n")),
false,
)
.0;
std::fs::write( std::fs::write(
"./iso/airootfs/etc/doas.conf", "./iso/airootfs/etc/doas.conf",
format!("permit persist {user} as root\n"), 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/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( std::fs::write(
"./iso/airootfs/etc/shadow", "./iso/airootfs/etc/shadow",
format!("root::14871::::::\n{user}:{hashed_pw}"), format!("root::14871::::::\n{user}:{hashed_pw}:14871::::::"),
) )
.unwrap(); .unwrap();
std::fs::write( std::fs::write(