Port mkpasswd to Solaris/Dyson

This commit is contained in:
Igor Pashev 2014-05-02 01:43:07 +02:00 committed by Marco d'Itri
parent 3a408f7f1c
commit 4a77be3e03
2 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ close($fh) or die "close($changelog): $!";
my ($ver) = $line =~ /^whois \s+ \( ( [^\)]+ ) \) \s+ \S+/x;
die "Version number not found in $changelog!\n" if not $ver;
$ver =~ s/ ( ~deb\d+.* | ubuntu\d+ ) $//x;
$ver =~ s/ ( ~deb\d+.* | ubuntu\d+ | \+dyson\d+ ) $//x;
# The version number must not deviate from this format or the -V option
# to RIPE-like servers will break. If needed, update the previous regexp.

View File

@ -17,8 +17,9 @@
*/
/* for crypt, snprintf and strcasecmp */
#define _XOPEN_SOURCE
#define _BSD_SOURCE
#define _XOPEN_SOURCE 500
#define _BSD_SOURCE 1
#define __EXTENSIONS__ 1
/* System library */
#include <stdio.h>
@ -271,10 +272,9 @@ int main(int argc, char *argv[])
strcat(salt, salt_arg);
} else {
#ifdef HAVE_SOLARIS_CRYPT_GENSALT
#error "This code path is untested on Solaris. Please send a patch."
salt = crypt_gensalt(salt_prefix, NULL);
if (!salt)
perror(stderr, "crypt_gensalt");
perror("crypt_gensalt");
#elif defined HAVE_LINUX_CRYPT_GENSALT
void *entropy = get_random_bytes(64);