Skip to content

Commit 9556ef2

Browse files
author
szachovy
committed
Fix MySQL /var/log/mysql missing and password shell injection
Two bugs revealed by the first successful async run: 1. MySQL containers crash with "mkdir: cannot create directory /var/log/mysql: Permission denied" because slow_query_log_file references /var/log/mysql/slow-queries.log but the directory does not exist in the base image and MySQL runs as a non-root user. Create it with correct ownership in the Dockerfile RUN layer. 2. generate_mysql_superset_password() used string.punctuation which includes single-quotes, backslashes, braces, and carets. These characters break the Python string literals in run_python_container_command where the password is interpolated with str.format() into a single-quoted Python expression, causing a SyntaxError. Restrict the charset to safe special characters that do not conflict with Python or shell quoting.
1 parent d40e446 commit 9556ef2

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

services/mysql-server/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ RUN \
3939
mkdir \
4040
"/etc/mysql/ssl" \
4141
&& \
42+
mkdir \
43+
--parents \
44+
"/var/log/mysql" \
45+
&& \
46+
chown \
47+
mysql:mysql \
48+
"/var/log/mysql" \
49+
&& \
4250
apt-get \
4351
clean \
4452
&& \

src/crypto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def generate_mysql_root_password() -> str:
6565

6666
@staticmethod
6767
def generate_mysql_superset_password() -> str:
68-
charset = string.ascii_letters + string.digits + string.punctuation
68+
charset = string.ascii_letters + string.digits + "!@#$%&*-_=+[]<>?"
6969
return "".join(secrets.choice(charset) for _ in range(24))
7070

7171
@staticmethod

0 commit comments

Comments
 (0)