]> gitweb.michael.orlitzky.com - untangle-https-backup.git/commitdiff
bin/untangle-https-backup: disable configuration file interpolation.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 5 Oct 2018 22:00:01 +0000 (18:00 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 5 Oct 2018 22:06:10 +0000 (18:06 -0400)
It was bound to happen: somebody changed their password to something
with a percent sign in it, and it broke the secret ConfigParser
interpolation that I didn't know existed. Nobody is interpolating
usernames or version numbers into their password fields (if you are;
see you in hell), so passing interpolation=None to our ConfigParser
instantiation should fix the issue.

bin/untangle-https-backup

index 25fbf9d2364a7b94242a3f9b540b8589f658c3f6..3abb05f257741b96fd349c650b09c8c5db23932f 100755 (executable)
@@ -31,8 +31,10 @@ args = parser.parse_args()
 # Default to success, change it if anything fails.
 status = EXIT_OK
 
-# Parse the configuration file...
-config = configparser.ConfigParser()
+# Parse the configuration file. In this contect "interpolation" is
+# something completely berserk, and it breaks passwords containing '%'
+# characters. So, we turn it off.
+config = configparser.ConfigParser(interpolation=None)
 config.read(args.config_file)
 
 # And loop through each section.