From 023730307e6e7e0878fd25665a950007b07d7bfd Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 19 Nov 2021 18:26:49 -0800 Subject: cd: Need a critical section here. If a SIGINT comes in while updating the relpaths it is possible to end up in cleanup traps where the values do not match $PWD. --- src/share/poudriere/common.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/share') diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index ec20e80e..517c3c11 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -1864,11 +1864,13 @@ cd() { local ret ret=0 + critical_start command cd "$@" || ret=$? # Handle fixing relative paths if [ "${OLDPWD}" != "${PWD}" ]; then _update_relpaths "${OLDPWD}" "${PWD}" || : fi + critical_end return ${ret} } -- cgit v1.2.3