Skip to content

Commit

Permalink
fix: use user_uid instead of process_uid, fixes user updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gerblesh committed Sep 12, 2023
1 parent a260a95 commit f0b4bf5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ublue_update/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,21 @@ def run_updates(args):

run_update_scripts(root_dir + "/system/")
for user_uid in user_uids:
xdg_runtime_dir = get_xdg_runtime_dir(process_uid)
xdg_runtime_dir = get_xdg_runtime_dir(user_uid)
user = pwd.getpwuid(user_uid)
log.info(
f"""
Running update for user:
'{pwd.getpwuid(process_uid).pw_name}',
'user.pw_name}',
update script directory: '{root_dir}/user'
"""
)

subprocess.run(
[
"sudo",
"-u",
f"{pwd.getpwuid(process_uid).pw_name}",
f"{user.pw_name}",
"DISPLAY=:0",
f"XDG_RUNTIME_DIR={xdg_runtime_dir}",
f"DBUS_SESSION_BUS_ADDRESS=unix:path={xdg_runtime_dir}/bus",
Expand Down

0 comments on commit f0b4bf5

Please sign in to comment.