From 109021ed33d812f3ab4e9c3cae7731605e532493 Mon Sep 17 00:00:00 2001 From: Michal S Date: Wed, 28 Sep 2022 10:39:29 +0100 Subject: [PATCH] Populates AccountsService by default --- src/functions/users.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/functions/users.rs b/src/functions/users.rs index 9546127..0d2bf7e 100755 --- a/src/functions/users.rs +++ b/src/functions/users.rs @@ -66,6 +66,21 @@ pub fn new_user(username: &str, hasroot: bool, password: &str, do_hash_pass: boo files::append_file("/mnt/etc/sudoers", "\nDefaults pwfeedback\n"), "Add pwfeedback to sudoers", ); + files_eval( + Ok(files::create_file(&format!( + "/mnt/var/lib/AccountsService/users/{}", + username + ))), + format!("Create AccountsService user file for {}", username).as_str(), + ); + files_eval( + files::append_file( + &format!("/mnt/var/lib/AccountsService/users/{}", username), + r#"[User] + Session=onyx"#, + ), + format!("Populate AccountsService user file for {}", username).as_str(), + ) } }