From 65efea4d3a28c866f42d09b73e17afdf56b44f2e Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 07 Dec 2015 17:54:51 -0500 Subject: cmd_*_main(): Load /etc/os-release in a subshell Limit the effects of this sort of arbitrary code execution, or at least avoid cluttering the namespace. --- (limited to 'src/cmd/shell.sh') diff --git a/src/cmd/shell.sh b/src/cmd/shell.sh index 468da0f..f6eb3d3 100644 --- a/src/cmd/shell.sh +++ b/src/cmd/shell.sh @@ -37,8 +37,7 @@ cmd_shell_main() root="$(block_mount "${dev}")" fi - . "${root}/etc/os-release" - profile_set "${ID}" + profile_set "$(. "${root}/etc/os-release" && printf '%s' "${ID}")" session_begin "${root}" . : false if [ ${#} -eq 0 ]; then -- cgit v0.9.1