Skip to content

Commit

Permalink
entrypoint: Use mktemp instead of install
Browse files Browse the repository at this point in the history
mktemp -d already creates a directory with mode 700, so the install
command to ensure it is redundant
The same applies to the temporary password file inside this directory.
  • Loading branch information
ltangvald authored and yosifkit committed Sep 18, 2019
1 parent 4672559 commit db12713
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .template.Debian/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then

SOCKET="$(docker_get_config 'socket' "$@")"
# We create a file to store the root password in so we don''t use it on the command line
install -d -m0700 /tmp/mysql-files
PASSFILE=$(mktemp /tmp/mysql-files/XXXXXXXXXX)
install /dev/null -m0600 "${PASSFILE}"
TMPDIR="$(mktemp -d)"
PASSFILE="$(mktemp ${TMPDIR}/XXXXXXXXXX)"

mysql=( mysql --defaults-file="${PASSFILE}" --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" )
docker_note "Starting server"
Expand Down

0 comments on commit db12713

Please sign in to comment.