Skip to content

Commit

Permalink
use mktemp to correctly use temp files
Browse files Browse the repository at this point in the history
  • Loading branch information
nagilson committed Oct 11, 2022
1 parent 9e046a5 commit 12ce4c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/redist/targets/packaging/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ first_run() {
/usr/share/dotnet/dotnet exec /usr/share/dotnet/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "debianpackage" > /dev/null 2>&1 || true
}

INSTALL_TEMP_HOME=/tmp/dotnet-installer
[ -d $INSTALL_TEMP_HOME ] || mkdir $INSTALL_TEMP_HOME
INSTALL_TEMP_HOME=$(mktemp -d) # mktemp should set 700 perm automatically
HOME=$INSTALL_TEMP_HOME first_run
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ first_run() {
$INSTALL_DESTINATION/dotnet exec $INSTALL_DESTINATION/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "$1" > /dev/null 2>&1 || true
}

[ -d $INSTALL_TEMP_HOME ] || mkdir $INSTALL_TEMP_HOME
INSTALL_TEMP_HOME=$(mktemp -d) # mktemp should set 700 perm automatically
HOME=$INSTALL_TEMP_HOME first_run

exit 0

0 comments on commit 12ce4c5

Please sign in to comment.