From 2dd62221984d39be355a4fdfe667053153aa60d4 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Thu, 13 Feb 2020 17:07:06 +0000 Subject: [PATCH] Set an absolute path in rootwrap filters_path If a relative path is set in rootwrap filters_path, the rootwrap command must be executed from the neutron root directory. Some commands, like those execute by RootHelperProcess, do not have a defined working directory. To avoid the problems present in the related bug, an absolute path is set in the rootwrap configuration. Related-Bug: #1862927 Change-Id: I02ce4d6b84242c42ec26954eeb9b776cb779bff4 --- tools/deploy_rootwrap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/deploy_rootwrap.sh b/tools/deploy_rootwrap.sh index 9669a6981c3..27609e8cebe 100755 --- a/tools/deploy_rootwrap.sh +++ b/tools/deploy_rootwrap.sh @@ -42,6 +42,8 @@ dst_conf_path=${target_etc_path}/neutron dst_conf=${dst_conf_path}/rootwrap.conf dst_rootwrap_path=${dst_conf_path}/rootwrap.d +absolute_neutron_path=$(pwd) + if [[ -d "$dst_rootwrap_path" ]]; then rm -rf ${dst_rootwrap_path} fi @@ -49,7 +51,7 @@ mkdir -p -m 755 ${dst_rootwrap_path} cp -p ${src_rootwrap_path}/* ${dst_rootwrap_path}/ cp -p ${src_conf} ${dst_conf} -sed -i "s:^filters_path=.*$:filters_path=${dst_rootwrap_path}:" ${dst_conf} +sed -i "s:^filters_path=.*$:filters_path=${absolute_neutron_path}/${dst_rootwrap_path}:" ${dst_conf} sed -i "s:^exec_dirs=\(.*\)$:exec_dirs=${target_bin_path},${fullstack_path},\1:" ${dst_conf} if [[ "$OS_SUDO_TESTING" = "1" ]]; then