With Python 3.9, the crypt function raises an OSError
See https://bugs.python.org/issue39289 Signed-off-by: Yohann D'ANELLO <ynerant@¢rans.org> Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
802fef95fa
commit
10b389e7be
1 changed files with 4 additions and 1 deletions
|
@ -409,7 +409,10 @@ def crypt_salt_is_valid(salt):
|
|||
if '$' not in salt[1:]:
|
||||
return False
|
||||
else:
|
||||
try:
|
||||
hashed = crypt.crypt("", salt)
|
||||
except OSError:
|
||||
return False
|
||||
if not hashed or '$' not in hashed[1:]:
|
||||
return False
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue