adapt ro new Python version
This commit is contained in:
parent
d2c08b6390
commit
58b7e59e52
|
|
@ -11,7 +11,7 @@ if not password:
|
|||
|
||||
file = open('/opt/openvpn/users/'+username+'.pwd', 'r')
|
||||
hashed=file.read().rstrip()
|
||||
if bcrypt.hashpw(password, hashed) == hashed:
|
||||
if bcrypt.hashpw(password.encode('utf-8'), hashed.encode('utf-8')) == hashed.encode('utf-8'):
|
||||
sys.exit(0)
|
||||
else:
|
||||
sys.exit(1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue