diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-12-07 17:54:51 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-12-07 17:54:51 (EST) |
commit | 65efea4d3a28c866f42d09b73e17afdf56b44f2e (patch) | |
tree | dfb8bb4cabf396bbd77a1931d294654a461eb5ed /src/cmd/build.sh | |
parent | a1abe55bbfd39a8d9a8722c596aceac8941e171a (diff) |
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.
Diffstat (limited to 'src/cmd/build.sh')
-rw-r--r-- | src/cmd/build.sh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cmd/build.sh b/src/cmd/build.sh index 8d12691..1d2f232 100644 --- a/src/cmd/build.sh +++ b/src/cmd/build.sh @@ -70,8 +70,7 @@ cmd_build_main() cmd_build_pkg_dir="${arg}" done - . "${root}/etc/os-release" - profile_set "${ID}" + profile_set "$(. "${root}/etc/os-release" && printf '%s' "${ID}")" if ! [ -d "${cmd_build_pkg_dir}" ]; then error 2 "$(get_msg 'cmd_build_not_a_dir')" \ |