Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invoked_as_root initialization #2730

Merged
merged 2 commits into from
May 29, 2024
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
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 @@
INVOKING_USER.chown(d)

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

# 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
Loading