diff --git a/script/base_utils/os/password_util.py b/script/base_utils/os/password_util.py index 26f440e..a437f1b 100644 --- a/script/base_utils/os/password_util.py +++ b/script/base_utils/os/password_util.py @@ -1,7 +1,6 @@ import re from gspylib.common.ErrorCode import ErrorCode - class PasswordUtil: @staticmethod def checkPasswordVaild(password): @@ -11,7 +10,7 @@ class PasswordUtil: output: NA """ # check if the password contains illegal characters - res = re.search(r'^[A-Za-z0-9~!@#%^*$-_=+?,.:/]+$', password) + res = re.search(r'^[A-Za-z0-9~!@#%^*_=+?,.:/$-]+$', password) if not res: raise Exception(ErrorCode.GAUSS_502['GAUSS_50219'] % "the password" + " The password contains illegal " diff --git a/script/gspylib/common/Common.py b/script/gspylib/common/Common.py index ea88671..16efff0 100644 --- a/script/gspylib/common/Common.py +++ b/script/gspylib/common/Common.py @@ -38,6 +38,7 @@ import csv import copy from subprocess import PIPE from subprocess import Popen +from base_utils.os.password_util import PasswordUtil # The installation starts, but the package is not decompressed completely. # The lib64/libz.so.1 file is incomplete, and the hashlib depends on the @@ -3830,6 +3831,8 @@ class ClusterCommand(): @staticmethod def aes_cbc_encrypt_with_multi(passwd, dest_path, logger): + # # check if the password contains illegal characters + PasswordUtil.checkPasswordVaild(passwd) # encrypt tool path encrypt_path = os.path.realpath("%s/../clib" % os.path.dirname(os.path.realpath(__file__))) # encrypt ca path