From: Tobias Ulmer Date: Tue, 10 Jul 2012 13:18:24 +0000 (+0200) Subject: Quote tool in e2lib.get_sys_arch() and add docstring X-Git-Tag: e2factory-2.3.12rc1~19 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=332025acc0cdd3af4e7916c75099f77ef4ffd8c9;p=e2factory.git Quote tool in e2lib.get_sys_arch() and add docstring Signed-off-by: Tobias Ulmer --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index f608b02..d605fed 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -1803,11 +1803,13 @@ function tar(argv) end --- get system architecture +-- @return string: machine hardware name +-- @return an error object on failure function get_sys_arch() local rc, re local e = new_error("getting host system architecture failed") local uname = tools.get_tool("uname") - local cmd = string.format("%s -m", uname) + local cmd = string.format("%s -m", e2lib.shquote(uname)) local p, msg = io.popen(cmd, "r") if not p then return nil, e:cat(msg)