diff options
author | Bryan Drewery <bryan@shatow.net> | 2021-11-20 05:26:49 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2021-11-20 05:26:49 +0300 |
commit | 023730307e6e7e0878fd25665a950007b07d7bfd (patch) | |
tree | 5e2cc2ac5d3bd3dd04fdff3711e7b3a4ae88e8b5 /src/share | |
parent | 04719b571fe147bf1a4b26faa27a89bf549e2fa0 (diff) |
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.
Diffstat (limited to 'src/share')
-rwxr-xr-x | src/share/poudriere/common.sh | 2 |
1 files changed, 2 insertions, 0 deletions
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} } |