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

Drop two unneeded calls to umask() #3468

Merged
merged 1 commit into from
Feb 4, 2025
Merged
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
66 changes: 32 additions & 34 deletions mkosi/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,41 +711,39 @@ def install_systemd_boot(context: Context) -> None:
keys.mkdir(parents=True, exist_ok=True)

# sbsiglist expects a DER certificate.
with umask(~0o600):
run(
[
"openssl",
"x509",
"-outform", "DER",
"-in", workdir(context.config.secure_boot_certificate),
"-out", workdir(context.workspace / "mkosi.der"),
],
sandbox=context.sandbox(
options=[
"--ro-bind",
context.config.secure_boot_certificate,
workdir(context.config.secure_boot_certificate),
"--bind", context.workspace, workdir(context.workspace),
],
),
) # fmt: skip

with umask(~0o600):
run(
[
"sbsiglist",
"--owner", "00000000-0000-0000-0000-000000000000",
"--type", "x509",
"--output", workdir(context.workspace / "mkosi.esl"),
workdir(context.workspace / "mkosi.der"),
run(
[
"openssl",
"x509",
"-outform", "DER",
"-in", workdir(context.config.secure_boot_certificate),
"-out", workdir(context.workspace / "mkosi.der"),
],
sandbox=context.sandbox(
options=[
"--ro-bind",
context.config.secure_boot_certificate,
workdir(context.config.secure_boot_certificate),
"--bind", context.workspace, workdir(context.workspace),
],
sandbox=context.sandbox(
options=[
"--bind", context.workspace, workdir(context.workspace),
"--ro-bind", context.workspace / "mkosi.der", workdir(context.workspace / "mkosi.der"), # noqa: E501
]
),
) # fmt: skip
),
) # fmt: skip

run(
[
"sbsiglist",
"--owner", "00000000-0000-0000-0000-000000000000",
"--type", "x509",
"--output", workdir(context.workspace / "mkosi.esl"),
workdir(context.workspace / "mkosi.der"),
],
sandbox=context.sandbox(
options=[
"--bind", context.workspace, workdir(context.workspace),
"--ro-bind", context.workspace / "mkosi.der", workdir(context.workspace / "mkosi.der"), # noqa: E501
]
),
) # fmt: skip

# We reuse the key for all secure boot databases to keep things simple.
for db in ["PK", "KEK", "db"]:
Expand Down
Loading