Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Create /mnt/var/lib/AccountsService before writing to it #51

Merged
merged 6 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/functions/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ 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(
files::create_directory("/mnt/var/lib/AccountsService/users/"),
"Create /mnt/var/lib/AcountsService",
);
files::create_file(&format!("/mnt/var/lib/AccountsService/users/{}", username));
files_eval(
files::append_file(
Expand Down
2 changes: 1 addition & 1 deletion src/internal/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ pub fn sed_file(path: &str, find: &str, replace: &str) -> std::io::Result<()> {
}

pub fn create_directory(path: &str) -> std::io::Result<()> {
std::fs::create_dir(path)
std::fs::create_dir_all(path)
}