macos-fuse-t / fuse-t

Other
889 stars 6 forks source link

postinstall script `cd` to unquoted variable with space #51

Closed vszakats closed 6 months ago

vszakats commented 8 months ago

In latest https://github.com/macos-fuse-t/fuse-t/releases/download/1.0.35/fuse-t-macos-installer-1.0.35.pkg there is a postinstall script. It wants to cd ${PRODUCT_HOME}, but ${PRODUCT_HOME} has a space in it: "/Library/Application Support/fuse-t", and the variable ref misses quotes, making cd fail but execution continue in a potentially wrong directory.

This should fix it:

--- a/postinstall
+++ b/postinstall
@@ -7,7 +7,7 @@

 #Change permissions in home directory
 echo "Change permissions in product home"
-cd ${PRODUCT_HOME}
+cd "${PRODUCT_HOME}"
 chmod -R 755 .
 [ -d /usr/local/bin ] || mkdir -p /usr/local/bin
 [ -d /usr/local/lib ] || mkdir -p /usr/local/lib