From 4a77be3e036db9a54a26060979eb9d3a6c20680c Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Fri, 2 May 2014 01:43:07 +0200 Subject: [PATCH] Port mkpasswd to Solaris/Dyson --- make_version_h.pl | 2 +- mkpasswd.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/make_version_h.pl b/make_version_h.pl index d7344e9..ae9956a 100755 --- a/make_version_h.pl +++ b/make_version_h.pl @@ -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. diff --git a/mkpasswd.c b/mkpasswd.c index 45d2c34..785637c 100644 --- a/mkpasswd.c +++ b/mkpasswd.c @@ -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 @@ -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);