diff --git a/confluent_server/bin/confluentdbutil b/confluent_server/bin/confluentdbutil index f8495741..2bdfa5b2 100755 --- a/confluent_server/bin/confluentdbutil +++ b/confluent_server/bin/confluentdbutil @@ -62,8 +62,11 @@ if args[0] == 'restore': if pid is not None: print("Confluent is running, must shut down to restore db") sys.exit(1) + password = options.password + if options.interactivepassword: + password = getpass.getpass('Enter password to restore backup: ') try: - cfm.restore_db_from_directory(dumpdir, options.password) + cfm.restore_db_from_directory(dumpdir, password) except Exception as e: print(str(e)) sys.exit(1) @@ -86,7 +89,7 @@ elif args[0] == 'dump': main._initsecurity(conf.get_config()) if not os.path.exists(dumpdir): os.makedirs(dumpdir) - cfm.dump_db_to_directory(dumpdir, options.password, options.redact, + cfm.dump_db_to_directory(dumpdir, password, options.redact, options.skipkeys) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 5ec302f0..c7f21841 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -495,7 +495,8 @@ def crypt_value(value, key = _masterkey iv = os.urandom(12) crypter = AES.new(key, AES.MODE_GCM, nonce=iv) - value = confluent.util.stringify(value).encode('utf-8') + if not isinstance(value, bytes): + value = value.encode('utf-8') cryptval, hmac = crypter.encrypt_and_digest(value) return iv, cryptval, hmac, b'\x02'