]> git.e2factory.org Git - e2factory.git/commitdiff
Quote tool in e2lib.get_sys_arch() and add docstring
authorTobias Ulmer <tu@emlix.com>
Tue, 10 Jul 2012 13:18:24 +0000 (15:18 +0200)
committerTobias Ulmer <tu@emlix.com>
Tue, 10 Jul 2012 13:18:24 +0000 (15:18 +0200)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index f608b0268e168fc63a516f01b5bb2e0b846f8b14..d605fedacb1d395d975ca2f0be00a3befd3413cf 100644 (file)
@@ -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)