diff options
author | Naïm Favier <n@monade.li> | 2022-03-14 02:11:10 +0100 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-03-14 02:12:52 +0100 |
commit | 9bdd2f852cdcaadd65ba38876c3379e10a967290 (patch) | |
tree | 524e7186bf2111f5fd58f3697178d1556df8cce4 /nixos/modules | |
parent | 1073633d8914364109bf453af7bed0aa06e5f5bf (diff) |
nixos/switch-to-configuration: fix installBootLoader escaping
Use a quoted heredoc to inject installBootLoader safely into the script,
and restore the previous invocation of `system` with a single argument so
that shell commands keep working.
Diffstat (limited to 'nixos/modules')
-rwxr-xr-x[-rw-r--r--] | nixos/modules/system/activation/switch-to-configuration.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index 07ee281feec1..459d09faa53b 100644..100755 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -67,7 +67,10 @@ openlog("nixos", "", LOG_USER); # Install or update the bootloader. if ($action eq "switch" || $action eq "boot") { - system('@installBootLoader@', $out) == 0 or exit 1; + chomp(my $installBootLoader = <<'EOFBOOTLOADER'); +@installBootLoader@ +EOFBOOTLOADER + system("$installBootLoader $out") == 0 or exit 1; } # Just in case the new configuration hangs the system, do a sync now. |