Skip to content

Commit

Permalink
Merge pull request #2730 from DaanDeMeyer/fix
Browse files Browse the repository at this point in the history
Fix invoked_as_root initialization
  • Loading branch information
DaanDeMeyer authored May 29, 2024
2 parents f6a4b69 + fe0f468 commit 8770a4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mkosi/qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ def start_journal_remote(config: Config, sockfd: int) -> Iterator[None]:
INVOKING_USER.chown(d)

with tempfile.NamedTemporaryFile(mode="w", prefix="mkosi-journal-remote-config-") as f:
os.chmod(f.name, 0o644)

# Make sure we capture all the logs by bumping the limits. We set MaxFileSize=4G because with the compact mode
# enabled the files cannot grow any larger anyway.
f.write(
Expand Down
2 changes: 1 addition & 1 deletion mkosi/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class INVOKING_USER:
uid = int(os.getenv("SUDO_UID") or os.getenv("PKEXEC_UID") or os.getuid())
gid = int(os.getenv("SUDO_GID") or os.getgid())
invoked_as_root = uid == 0
invoked_as_root = os.getuid() == 0

@classmethod
def init(cls) -> None:
Expand Down

0 comments on commit 8770a4e

Please sign in to comment.