summaryrefslogtreecommitdiff
path: root/mkpasswd.c
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2015-03-15 04:17:43 +0100
committerMarco d'Itri <md@linux.it>2015-03-23 04:31:02 +0100
commit09d4a0fe88e37fc2afd543863b34ae4554ccf2e6 (patch)
tree5f88fe068260ba93fac2895dfce0174289fcecf0 /mkpasswd.c
parent78d2e38a6416b5e2889eac6868afd7c05c384b57 (diff)
downloadwhois-09d4a0fe88e37fc2afd543863b34ae4554ccf2e6.tar.gz
mkpasswd: exit if crypt_gensalt on Solaris fails
Diffstat (limited to 'mkpasswd.c')
-rw-r--r--mkpasswd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mkpasswd.c b/mkpasswd.c
index ffd887e..ce0c763 100644
--- a/mkpasswd.c
+++ b/mkpasswd.c
@@ -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);