[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Remove janky getpass implementations



commit 272229ff5d3828eb2f51b93a0079a8e86d1ec5af
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Jun 17 11:52:54 2015 -0400

    Remove janky getpass implementations
---
 src/common/compat.c |   17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/src/common/compat.c b/src/common/compat.c
index 4a35183..6e46f27 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -3321,22 +3321,7 @@ tor_getpass(const char *prompt, char *output, size_t buflen)
   SecureZeroMemory(buf, sizeof(wchar_t)*buflen);
   tor_free(buf);
   return r;
-#elif defined(HAVE_GETPASS)
-  /* XXX We shouldn't actually use this; it's deprecated to hell and back */
-  memset(output, 0, buflen);
-  char *pwd = getpass(prompt);
-  if (pwd == NULL)
-    return -1;
-  ssize_t len = (ssize_t)strlen(pwd);
-  strlcpy(output, pwd, buflen);
-  memset(pwd, 0, len);
-  return len;
 #else
-  /* XXX This is even worse. */
-  puts(prompt);
-  ssize_t n = read(STDIN_FILENO, output, buflen);
-  if (n < 0)
-    return -1;
-  return n;
+#error "No implementation for tor_getpass found!"
 #endif
 }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits