summaryrefslogtreecommitdiff
path: root/mkpasswd.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-04-04 14:07:51 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-04-04 14:29:37 +0400
commit45eb26992d9fa4efd74b7b283834dcfc212a403f (patch)
tree505ac8c1635a832f648291230fed378494748658 /mkpasswd.c
parent084b02ceabd82c614d66174876243a8124f4a876 (diff)
downloadwhois-45eb26992d9fa4efd74b7b283834dcfc212a403f.tar.gz
whois (5.1.1+dyson1) unstable; urgency=mediumv5.1.1+dyson1
* Package for Dyson * Patched mkpasswd.c: - Define _XOPEN_SOURCE to 600 if not defined - Define _BSD_SOURCE to 1 if not defined - Define __EXTENSIONS__ to 1 to get getpass() exposed (otherwise mkpasswd crashes, because compiler assumes getpass returns int) - Removed #error "This code path is untested on Solaris. Please send a patch." - Fixed perror() invocation in HAVE_SOLARIS_CRYPT_GENSALT branch * Patched make_version_h.pl to support +dysonN suffix in version
Diffstat (limited to 'mkpasswd.c')
-rw-r--r--mkpasswd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/mkpasswd.c b/mkpasswd.c
index 45d2c34..a80e7e9 100644
--- a/mkpasswd.c
+++ b/mkpasswd.c
@@ -17,8 +17,15 @@
*/
/* for crypt, snprintf and strcasecmp */
-#define _XOPEN_SOURCE
-#define _BSD_SOURCE
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
+#endif
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE 1
+#endif
+#ifndef __EXTENSIONS__
+#define __EXTENSIONS__ 1
+#endif
/* System library */
#include <stdio.h>
@@ -271,10 +278,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);