From 18ffd96d623caa12763962e129b595492f8ed380 Mon Sep 17 00:00:00 2001 From: Geoff Holden Date: Wed, 5 Mar 2025 22:51:41 -0330 Subject: [PATCH] Add single quotes around the password. When the DB password uses some special characters, the defaults-extra-file can be incorrect. In the case of a password with the # symbol, anything after that is considered a comment. The single quotes around the password rectify this. --- borgmatic/hooks/data_source/mariadb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/borgmatic/hooks/data_source/mariadb.py b/borgmatic/hooks/data_source/mariadb.py index cb05f5b9..eaf05f2d 100644 --- a/borgmatic/hooks/data_source/mariadb.py +++ b/borgmatic/hooks/data_source/mariadb.py @@ -68,7 +68,7 @@ def make_defaults_file_options(username=None, password=None, defaults_extra_file values = '\n'.join( ( (f'user={username}' if username is not None else ''), - (f'password={password}' if password is not None else ''), + (f'password=\'{password}\'' if password is not None else ''), ) ).strip()