Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpam/modules/pam_krb5 Use the more familar princ@realm...



details:   https://anonhg.NetBSD.org/src/rev/3f2fbb802c6e
branches:  trunk
changeset: 574318:3f2fbb802c6e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Feb 26 18:10:35 2005 +0000

description:
Use the more familar princ@realm style of password prompt.

diffstat:

 lib/libpam/modules/pam_krb5/pam_krb5.c |  16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diffs (65 lines):

diff -r 7a3f06fd08cc -r 3f2fbb802c6e lib/libpam/modules/pam_krb5/pam_krb5.c
--- a/lib/libpam/modules/pam_krb5/pam_krb5.c    Sat Feb 26 18:06:27 2005 +0000
+++ b/lib/libpam/modules/pam_krb5/pam_krb5.c    Sat Feb 26 18:10:35 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pam_krb5.c,v 1.4 2005/02/26 18:03:37 thorpej Exp $     */
+/*     $NetBSD: pam_krb5.c,v 1.5 2005/02/26 18:10:35 thorpej Exp $     */
 
 /*-
  * This pam_krb5 module contains code that is:
@@ -53,7 +53,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_krb5/pam_krb5.c,v 1.22 2005/01/24 16:49:50 rwatson Exp $");
 #else
-__RCSID("$NetBSD: pam_krb5.c,v 1.4 2005/02/26 18:03:37 thorpej Exp $");
+__RCSID("$NetBSD: pam_krb5.c,v 1.5 2005/02/26 18:10:35 thorpej Exp $");
 #endif
 
 #include <sys/types.h>
@@ -88,7 +88,7 @@
 static void    compat_free_data_contents(krb5_context, krb5_data *);
 
 #define USER_PROMPT            "Username: "
-#define PASSWORD_PROMPT                "Password:"
+#define PASSWORD_PROMPT                "%s's Password:"
 #define NEW_PASSWORD_PROMPT    "New Password:"
 
 #define PAM_OPT_CCACHE         "ccache"
@@ -116,6 +116,7 @@
        const char *user, *pass;
        const void *sourceuser, *service;
        char *principal, *princ_name, *ccache_name, luser[32], *srvdup;
+       char password_prompt[80];
 
        retval = pam_get_user(pamh, &user, USER_PROMPT);
        if (retval != PAM_SUCCESS)
@@ -194,7 +195,9 @@
        PAM_LOG("Got principal: %s", princ_name);
 
        /* Get password */
-       retval = pam_get_authtok(pamh, PAM_AUTHTOK, &pass, PASSWORD_PROMPT);
+       (void) snprintf(password_prompt, sizeof(password_prompt),
+           PASSWORD_PROMPT, princ_name);
+       retval = pam_get_authtok(pamh, PAM_AUTHTOK, &pass, password_prompt);
        if (retval != PAM_SUCCESS)
                goto cleanup2;
 
@@ -667,6 +670,7 @@
        const char *pass;
        const void *user;
        char *princ_name, *passdup;
+       char password_prompt[80];
 
        if (flags & PAM_PRELIM_CHECK) {
                /* Nothing to do here. */
@@ -718,7 +722,9 @@
        PAM_LOG("Got principal: %s", princ_name);
 
        /* Get password */
-       retval = pam_get_authtok(pamh, PAM_OLDAUTHTOK, &pass, PASSWORD_PROMPT);
+       (void) snprintf(password_prompt, sizeof(password_prompt),
+           PASSWORD_PROMPT, princ_name);
+       retval = pam_get_authtok(pamh, PAM_OLDAUTHTOK, &pass, password_prompt);
        if (retval != PAM_SUCCESS)
                goto cleanup2;
 



Home | Main Index | Thread Index | Old Index