mkpasswd: exit if crypt_gensalt on Solaris fails

This commit is contained in:
Marco d'Itri 2015-03-15 04:17:43 +01:00
parent 78d2e38a64
commit 09d4a0fe88

View File

@ -279,8 +279,10 @@ int main(int argc, char *argv[])
} else {
#ifdef HAVE_SOLARIS_CRYPT_GENSALT
salt = crypt_gensalt(salt_prefix, NULL);
if (!salt)
if (!salt) {
perror("crypt_gensalt");
exit(2);
}
#elif defined HAVE_LINUX_CRYPT_GENSALT
void *entropy = get_random_bytes(64);