mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-01 23:47:40 +00:00
fix: 账号备份选择SFTP有多个时,重复编码password会导致任务异常
This commit is contained in:
@@ -21,6 +21,8 @@ def encrypt_and_compress_zip_file(filename, secret_password, encrypted_filenames
|
||||
with pyzipper.AESZipFile(
|
||||
filename, 'w', compression=pyzipper.ZIP_LZMA, encryption=pyzipper.WZ_AES
|
||||
) as zf:
|
||||
if secret_password and isinstance(secret_password, str):
|
||||
secret_password = secret_password.encode('utf8')
|
||||
zf.setpassword(secret_password)
|
||||
for encrypted_filename in encrypted_filenames:
|
||||
with open(encrypted_filename, 'rb') as f:
|
||||
|
Reference in New Issue
Block a user