From 14f7902ea37bab59bf62e63850383f445e8bf270 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 6 Oct 2015 14:21:58 +0200 Subject: [PATCH] e2build: fix wrong use of shquote(), makes x86_64 chroot work Signed-off-by: Tobias Ulmer --- Changelog | 1 + local/e2build.lua | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Changelog b/Changelog index e2c58be..63bd17d 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ NEXT: + * Fix incorrect use of shquote(), preventing x86_64 chroot builds * Fix regression preventing use of x86_64 chroot * Fix hashcache problem causing an incorrect BuildID * Reset all signal handlers to their default values diff --git a/local/e2build.lua b/local/e2build.lua index 2bd525c..037e37d 100644 --- a/local/e2build.lua +++ b/local/e2build.lua @@ -208,7 +208,13 @@ function e2build.build_config(info, r) tab.T = string.format("%s/%s/%s/chroot/%s", tmpdir, project, r, builddir) tab.Tc = string.format("/%s", builddir) tab.r = string.format("%s", r) - tab.chroot_call_prefix = info.chroot_call_prefix[info.project.chroot_arch] + if info.chroot_call_prefix[info.project.chroot_arch] == "" then + -- escape only if non-empty, otherwise we fail to start "''" + tab.chroot_call_prefix = "" + else + tab.chroot_call_prefix = + e2lib.shquote(info.chroot_call_prefix[info.project.chroot_arch]) + end tab.buildlog = string.format("%s/log/build.%s.log", info.root, r) tab.scriptdir = "script" tab.build_driver = "" @@ -333,9 +339,11 @@ function e2build.enter_playground(info, r, chroot_command) e2lib.log(4, "entering playground for " .. r .. " ...") local term = e2lib.globals.terminal local e2_su = tools.get_tool("e2-su-2.2") - local cmd = string.format("%s %s chroot_2_3 '%s' %s", - res.build_config.chroot_call_prefix, e2_su, - res.build_config.base, chroot_command) + local cmd = string.format("%s %s chroot_2_3 %s %s", + res.build_config.chroot_call_prefix, + e2lib.shquote(e2_su), + e2lib.shquote(res.build_config.base), + chroot_command) e2tool.set_umask(info) os.execute(cmd) e2tool.reset_umask(info) @@ -389,9 +397,10 @@ local function runbuild(info, r, return_flags) e2lib.shquote(res.build_config.build_driver_file)) local e2_su = tools.get_tool("e2-su-2.2") local cmd = string.format("%s %s chroot_2_3 %s %s", - e2lib.shquote(res.build_config.chroot_call_prefix), - e2lib.shquote(e2_su), - e2lib.shquote(res.build_config.base), runbuild) + res.build_config.chroot_call_prefix, + e2lib.shquote(e2_su), + e2lib.shquote(res.build_config.base), + runbuild) -- the build log is written to an external logfile rc, re = e2lib.rotate_log(res.build_config.buildlog) if not rc then -- 2.39.5