openbsd-ports/x11/kde4/base-workspace/patches/patch-kcheckpass_kcheckpass_c
espie 928c98921f get network to build.
use qca2 where applicable.
get crypt in kdm (from Laurence Tratt) and use readpassphrase.
2010-06-23 13:11:34 +00:00

31 lines
912 B
Plaintext

$OpenBSD: patch-kcheckpass_kcheckpass_c,v 1.1 2010/06/23 13:11:34 espie Exp $
--- kcheckpass/kcheckpass.c.orig Wed Jun 23 11:51:26 2010
+++ kcheckpass/kcheckpass.c Wed Jun 23 11:54:29 2010
@@ -57,6 +57,10 @@
#include <errno.h>
#include <time.h>
+#ifdef HAVE_READPASSPHRASE
+#include <readpassphrase.h>
+#endif
+
/* Compatibility: accept some options from environment variables */
#define ACCEPT_ENV
@@ -91,11 +95,15 @@ conv_legacy (ConvRequest what, const char *prompt)
if (havetty) {
#ifdef HAVE_GETPASSPHRASE
p = getpassphrase(prompt ? prompt : "Password: ");
+#elif defined HAVE_READPASSPHRASE
+ p = readpassphrase(prompt ? prompt : "Password: ",
+ buf, sizeof buf, RPP_REQUIRE_TTY);
#else
p = getpass(prompt ? prompt : "Password: ");
#endif
p2 = strdup(p);
memset(p, 0, strlen(p));
+ memset(buf, 0, sizeof buf);
return p2;
} else {
if (prompt)