@cryptotaxi247 / netdata-1 / commits / c97cb2d98

Ensure tmpdir is set for every function that uses it. (#13206)

The set_tmpdir function is idempotent specifically to allow for this type of usage, and this should help avoid bugs involving temporary directory handling going forwards.

Austin S. Hemmelgarn committed Jun 27, 2022 at 07:40 UTC c97cb2d98e81f3d41801f9e82ae06e86941df609
1 file changed +9
packaging/installer/kickstart.sh
+9
@@ -771,6 +771,8 @@ uninstall() {
771 }
772
773 detect_existing_install() {
774 + set_tmpdir
775 +
776 progress "Checking for existing installations of Netdata..."
777
778 if pkg_installed netdata; then
@@ -936,6 +938,8 @@ handle_existing_install() {
938 }
939
940 soft_disable_cloud() {
941 + set_tmpdir
942 +
943 cloud_prefix="${INSTALL_PREFIX}/var/lib/netdata/cloud.d"
944
945 run ${ROOTCMD} mkdir -p "${cloud_prefix}"
@@ -1227,6 +1231,8 @@ try_package_install() {
1231 return 2
1232 fi
1233
1234 + set_tmpdir
1235 +
1236 if [ "${DRY_RUN}" -eq 1 ]; then
1237 progress "Would attempt to install using native packages..."
1238 else
@@ -1585,6 +1591,7 @@ set_source_archive_urls() {
1591 }
1592
1593 install_local_build_dependencies() {
1594 + set_tmpdir
1595 bash="$(command -v bash 2> /dev/null)"
1596
1597 if [ -z "${bash}" ] || [ ! -x "${bash}" ]; then
@@ -1665,6 +1672,8 @@ build_and_install() {
1672 }
1673
1674 try_build_install() {
1675 + set_tmpdir
1676 +
1677 if [ "${DRY_RUN}" -eq 1 ]; then
1678 progress "Would attempt to install by building locally..."
1679 else