apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r467596 - /apr/apr/trunk/passwd/apr_getpass.c
Date Wed, 25 Oct 2006 10:05:00 GMT
Author: jorton
Date: Wed Oct 25 03:04:59 2006
New Revision: 467596

URL: http://svn.apache.org/viewvc?view=rev&rev=467596
Log:
* 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().

Modified:
    apr/apr/trunk/passwd/apr_getpass.c

Modified: apr/apr/trunk/passwd/apr_getpass.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/passwd/apr_getpass.c?view=diff&rev=467596&r1=467595&r2=467596
==============================================================================
--- apr/apr/trunk/passwd/apr_getpass.c (original)
+++ apr/apr/trunk/passwd/apr_getpass.c Wed Oct 25 03:04:59 2006
@@ -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 @@
 #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 @@
  * 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 @@
 
 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;
 



Mime
View raw message