Skip to content

Commit db12713

Browse files
ltangvaldyosifkit
authored andcommitted
entrypoint: Use mktemp instead of install
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.
1 parent 4672559 commit db12713

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.template.Debian/docker-entrypoint.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,8 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
157157

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

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

0 commit comments

Comments
 (0)