From 2a0cf385d26544d80a29ebf7e34f63e86f397283 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 1 Feb 2020 12:11:22 +0100 Subject: [PATCH] nixos-rebuild: Avoid subshell reading hostname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Jörg Thalheim --- nixos/modules/installer/tools/nixos-rebuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index 8d69bbfd14c..4bbed9e6971 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -256,7 +256,7 @@ if [[ -n $flake ]]; then flakeAttr="${BASH_REMATCH[2]}" fi if [[ -z $flakeAttr ]]; then - hostname=$(cat /proc/sys/kernel/hostname) + read -r hostname < /proc/sys/kernel/hostname if [[ -z $hostname ]]; then hostname=default fi