adapt ro new Python version
This commit is contained in:
@@ -11,7 +11,7 @@ if not password:
|
|||||||
|
|
||||||
file = open('/opt/openvpn/users/'+username+'.pwd', 'r')
|
file = open('/opt/openvpn/users/'+username+'.pwd', 'r')
|
||||||
hashed=file.read().rstrip()
|
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)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user