]> granicus.if.org Git - sudo/commitdiff
now use BUFSIZ as length of kerb password
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 8 Jun 1995 00:48:11 +0000 (00:48 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 8 Jun 1995 00:48:11 +0000 (00:48 +0000)
added kpass so pass is always a char *
now use prompt global when asking for a password

check.c

diff --git a/check.c b/check.c
index 49e382e6437e557ddb275e9c9cc0d1b0f4de7be8..d8a60b84c212467bb50f879a267fb1937b3b43e8 100644 (file)
--- a/check.c
+++ b/check.c
@@ -336,10 +336,9 @@ static void check_passwd()
 #endif /* HAVE_SKEY */
     char *encrypted=epasswd;   /* this comes from /etc/passwd  */
 #if defined(HAVE_KERB4) && defined(USE_GETPASS)
-    char pass[128];
-#else
-    char *pass;                        /* this is what gets entered    */
+    char kpass[BUFSIZ];
 #endif /* HAVE_KERB4 && USE_GETPASS */
+    char *pass;                        /* this is what gets entered    */
     register int counter = TRIES_FOR_PASSWORD;
 
 #if defined(__hpux) && defined(HAVE_C2_SECURITY)
@@ -426,16 +425,17 @@ static void check_passwd()
      */
     while (counter > 0) {
 #ifdef HAVE_SKEY
-       pass = skey_getpass("Password:", pw_ent, pw_ok);
+       pass = skey_getpass(prompt, pw_ent, pw_ok);
 #else
 #ifdef USE_GETPASS
 #ifdef HAVE_KERB4
-       (void) des_read_pw_string(pass, sizeof(pass) - 1, "Password: ", 0);
+       (void) des_read_pw_string(kpass, sizeof(kpass) - 1, prompt, 0);
+       pass = kpass;
 #else
-       pass = (char *) getpass("Password:");
+       pass = (char *) getpass(prompt);
 #endif /* HAVE_KERB4 */
 #else
-       pass = tgetpass("Password:", PASSWORD_TIMEOUT * 60);
+       pass = tgetpass(prompt, PASSWORD_TIMEOUT * 60);
 #endif /* USE_GETPASS */
 #endif /* HAVE_SKEY */
        if (!pass || *pass == '\0')