summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2006-10-25 10:04:59 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2006-10-25 10:04:59 +0000
commitaa1aa794e40e36ce9118ea0579015a904cde81aa (patch)
tree4389daf3487e2c1a62d4982ff060a1ddfb3df827
parent587caebcaa7dbd302bf21cc9dc32285eb4a97a85 (diff)
downloadlibapr-aa1aa794e40e36ce9118ea0579015a904cde81aa.tar.gz
* passwd/apr_getpass.c (get_password): Renamed from getpass()
throughout to avoid any possible conflict with a system getpass() implementation which is not being used. (apr_password_get): Use get_password if not getpass() or getpassphrase(). git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@467596 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--passwd/apr_getpass.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/passwd/apr_getpass.c b/passwd/apr_getpass.c
index 4d6167e8a..369c6e603 100644
--- a/passwd/apr_getpass.c
+++ b/passwd/apr_getpass.c
@@ -80,7 +80,7 @@
* issue the prompt and read the results with echo. (Ugh).
*/
-static char *getpass(const char *prompt)
+static char *get_password(const char *prompt)
{
static char password[MAX_STRING_LEN];
@@ -93,7 +93,7 @@ static char *getpass(const char *prompt)
#elif defined (HAVE_TERMIOS_H)
#include <stdio.h>
-static char *getpass(const char *prompt)
+static char *get_password(const char *prompt)
{
struct termios attr;
static char password[MAX_STRING_LEN];
@@ -135,7 +135,7 @@ static char *getpass(const char *prompt)
* Windows lacks getpass(). So we'll re-implement it here.
*/
-static char *getpass(const char *prompt)
+static char *get_password(const char *prompt)
{
/* WCE lacks console. So the getpass is unsuported
* The only way is to use the GUI so the getpass should be implemented
@@ -221,10 +221,12 @@ static char *getpass(const char *prompt)
APR_DECLARE(apr_status_t) apr_password_get(const char *prompt, char *pwbuf, apr_size_t *bufsiz)
{
-#ifdef HAVE_GETPASSPHRASE
+#if defined(HAVE_GETPASSPHRASE)
char *pw_got = getpassphrase(prompt);
-#else
+#elif defined(HAVE_GETPASS)
char *pw_got = getpass(prompt);
+#else /* use the replacement implementation above */
+ char *pw_got = get_password(prompt);
#endif
apr_status_t rv = APR_SUCCESS;