s4:dsdb: Check errno to determine if crypt or crypt_r succeeded
authorSamuel Cabrero <scabrero@suse.de>
Thu, 14 Mar 2019 17:54:20 +0000 (18:54 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 22 Mar 2019 14:03:19 +0000 (14:03 +0000)
commite23425a03c802070c84c23cc544aab0e623487de
tree432188c80f772049a18530d2adf10cdcd7fa9fdd
parentfc25fe80b4edbca8bc985b6d94fc4ae6563a0cff
s4:dsdb: Check errno to determine if crypt or crypt_r succeeded

The behavior of these functions upon errors depends on the implementation.
The GNU libc implementation seems to return a null hash, but others like
libxcrypt returns a invalid hash string '*0'.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/dsdb/samdb/ldb_modules/password_hash.c