From 78dcb775a50969d68b6397e491825c262b795fbc Mon Sep 17 00:00:00 2001 From: Rudra Saraswat Date: Wed, 1 Apr 2026 22:04:51 +0100 Subject: [PATCH] fix: user-handling logic --- usr/lib/akshara/utils/update.py | 1 + usr/lib/akshara/utils/users.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/usr/lib/akshara/utils/update.py b/usr/lib/akshara/utils/update.py index f86bbdc..6d598db 100644 --- a/usr/lib/akshara/utils/update.py +++ b/usr/lib/akshara/utils/update.py @@ -16,6 +16,7 @@ def update_cleanup() -> None: subprocess.run( ["umount", "-l", "/var/cache/akshara/rootfs/var/cache/blendOS"], stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, ) subprocess.run( diff --git a/usr/lib/akshara/utils/users.py b/usr/lib/akshara/utils/users.py index 1a8276d..d743b56 100644 --- a/usr/lib/akshara/utils/users.py +++ b/usr/lib/akshara/utils/users.py @@ -18,7 +18,7 @@ def merge_passwd(new_rootfs) -> list: line.strip().split(":")[0]: line.strip() for line in f if line.strip() } - with open(f"{new_rootfs}/etc/passwd") as f: + with open(f"{new_rootfs}/usr/etc/passwd") as f: new_rootfs_passwd_entries = { line.strip().split(":")[0]: line.strip() for line in f if line.strip() } @@ -34,7 +34,7 @@ def merge_passwd(new_rootfs) -> list: ): new_passwd_entries.append(current_passwd_entries[user]) - with open("/.new.etc/passwd", "w") as f: + with open(f"{new_rootfs}/etc/passwd", "w") as f: for user in new_passwd_entries: f.write(user + "\n") @@ -63,7 +63,7 @@ def merge_shadow(new_rootfs): line.strip().split(":")[0]: line.strip() for line in f if line.strip() } - with open(f"{new_rootfs}/etc/shadow") as f: + with open(f"{new_rootfs}/usr/etc/shadow") as f: new_rootfs_shadow_entries = { line.strip().split(":")[0]: line.strip() for line in f if line.strip() } @@ -79,7 +79,7 @@ def merge_shadow(new_rootfs): ): new_shadow_entries.append(current_shadow_entries[user]) - with open("/.new.etc/shadow", "w") as f: + with open(f"{new_rootfs}/etc/shadow", "w") as f: for user in new_shadow_entries: f.write(user + "\n") @@ -101,7 +101,7 @@ def merge_group(new_rootfs, new_passwd_entries): line.strip().split(":")[0]: line.strip() for line in f if line.strip() } - with open(f"{new_rootfs}/etc/group") as f: + with open(f"{new_rootfs}/usr/etc/group") as f: new_rootfs_group_entries = { line.strip().split(":")[0]: line.strip() for line in f if line.strip() } @@ -138,7 +138,7 @@ def merge_group(new_rootfs, new_passwd_entries): ): new_group_entries.append(current_group_entries[group]) - with open("/.new.etc/group", "w") as f: + with open(f"{new_rootfs}/etc/group", "w") as f: for group in new_group_entries: f.write(group + "\n") @@ -165,7 +165,7 @@ def merge_gshadow(new_rootfs, new_passwd_entries): line.strip().split(":")[0]: line.strip() for line in f if line.strip() } - with open(f"{new_rootfs}/etc/gshadow") as f: + with open(f"{new_rootfs}/usr/etc/gshadow") as f: new_rootfs_gshadow_entries = { line.strip().split(":")[0]: line.strip() for line in f if line.strip() } @@ -204,6 +204,6 @@ def merge_gshadow(new_rootfs, new_passwd_entries): ): new_gshadow_entries.append(current_gshadow_entries[group]) - with open("/.new.etc/gshadow", "w") as f: + with open(f"{new_rootfs}/etc/gshadow", "w") as f: for group in new_gshadow_entries: f.write(group + "\n")