From c1599f83f727ef71249e2fbfd3cc0f0cd430df26 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 6 Nov 2002 00:42:57 +0000 Subject: [PATCH] This commit fixes up the in-tree callers of krb5_read_password() and des_read_password(). We should perhaps tighten up the test suite now. ticket: 1217 status: open target_version: 1.3 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14972 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 5 +++++ src/appl/bsd/login.c | 2 +- src/clients/kinit/ChangeLog | 5 +++++ src/clients/kinit/kinit.c | 2 +- src/include/ChangeLog | 6 ++++++ src/include/k5-int.h | 4 ++-- src/include/krb5/ChangeLog | 5 +++++ src/include/krb5/kdb.h | 4 ++-- src/kadmin/cli/ChangeLog | 5 +++++ src/kadmin/cli/kadmin.c | 8 ++++---- src/kadmin/dbutil/ChangeLog | 6 ++++++ src/kadmin/dbutil/dumpv4.c | 2 +- src/kadmin/dbutil/loadv4.c | 2 +- src/kadmin/ktutil/ChangeLog | 5 +++++ src/kadmin/ktutil/ktutil_funcs.c | 2 +- src/kadmin/passwd/ChangeLog | 5 +++++ src/kadmin/passwd/kpasswd_strings.et | 2 +- src/kadmin/v5passwdd/ChangeLog | 6 ++++++ src/kadmin/v5passwdd/kpasswd.c | 8 ++++---- src/lib/kadm5/ChangeLog | 5 +++++ src/lib/kadm5/chpass_util_strings.et | 4 ++-- 21 files changed, 73 insertions(+), 20 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 920c40964..9dc2d1e89 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,8 @@ +2002-11-05 Tom Yu + + * login.c (k5_get_password): Remove trailing colon, as new + implementation of krb5_read_password() appends it. + 2002-09-14 Ken Raeburn * Makefile.in (rcp): Fix typo in 06-25 change. diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c index d3a158cb5..f1ebff4f7 100644 --- a/src/appl/bsd/login.c +++ b/src/appl/bsd/login.c @@ -575,7 +575,7 @@ static int k5_get_password (user_pwstring, pwsize) { krb5_error_code code; char prompt[255]; - sprintf(prompt,"Password for %s: ", username); + sprintf(prompt,"Password for %s", username); /* reduce opportunities to be swapped out */ code = krb5_read_password(kcontext, prompt, 0, user_pwstring, &pwsize); diff --git a/src/clients/kinit/ChangeLog b/src/clients/kinit/ChangeLog index 53a2c15db..802ab3e01 100644 --- a/src/clients/kinit/ChangeLog +++ b/src/clients/kinit/ChangeLog @@ -1,3 +1,8 @@ +2002-11-05 Tom Yu + + * kinit.c (k4_kinit): Remove trailing colon, as new implementation + of krb5_read_password() appends it. + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/clients/kinit/kinit.c b/src/clients/kinit/kinit.c index 824d20c5b..740b0302a 100644 --- a/src/clients/kinit/kinit.c +++ b/src/clients/kinit/kinit.c @@ -907,7 +907,7 @@ k4_kinit(opts, k4, ctx) krb5_error_code code; char prompt[1024]; - sprintf(prompt, "Password for %s: ", opts->principal_name); + sprintf(prompt, "Password for %s", opts->principal_name); stash_password[0] = 0; /* Note: krb5_read_password does not actually look at the diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 94b426519..755ff1cbb 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,9 @@ +2002-11-05 Tom Yu + + * k5-int.h (DEFAULT_PWD_STRING1, DEFAULT_PWD_STRING2): Remove + trailing colon, as new implementation of krb5_read_password() + appends it. + 2002-10-31 Ken Raeburn * k5-int.h (krb5_ser_handle): Now points to const. diff --git a/src/include/k5-int.h b/src/include/k5-int.h index e6d69205c..90d2c9caa 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -138,8 +138,8 @@ typedef unsigned char u_char; #endif /* HAVE_SYS_TYPES_H */ #endif /* KRB5_SYSTYPES__ */ -#define DEFAULT_PWD_STRING1 "Enter password:" -#define DEFAULT_PWD_STRING2 "Re-enter password for verification:" +#define DEFAULT_PWD_STRING1 "Enter password" +#define DEFAULT_PWD_STRING2 "Re-enter password for verification" #define KRB5_KDB_MAX_LIFE (60*60*24) /* one day */ #define KRB5_KDB_MAX_RLIFE (60*60*24*7) /* one week */ diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index d620091a9..66a48e3e6 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,3 +1,8 @@ +2002-11-05 Tom Yu + + * kdb.h (KRB5_KDC_MKEY_1, KRB5_KDC_MKEY_2): Remove trailing colon, + as new implementation of krb5_read_password() appends it. + 2002-09-18 Ken Raeburn * adm.h (struct __krb5_realm_params): New field diff --git a/src/include/krb5/kdb.h b/src/include/krb5/kdb.h index f21fa8457..1670b5436 100644 --- a/src/include/krb5/kdb.h +++ b/src/include/krb5/kdb.h @@ -162,8 +162,8 @@ typedef struct _krb5_db_entry_new { #define KRB5_KDB_M_NAME "K/M" /* Kerberos/Master */ /* prompts used by default when reading the KDC password from the keyboard. */ -#define KRB5_KDC_MKEY_1 "Enter KDC database master key:" -#define KRB5_KDC_MKEY_2 "Re-enter KDC database master key to verify:" +#define KRB5_KDC_MKEY_1 "Enter KDC database master key" +#define KRB5_KDC_MKEY_2 "Re-enter KDC database master key to verify" extern char *krb5_mkey_pwd_prompt1; extern char *krb5_mkey_pwd_prompt2; diff --git a/src/kadmin/cli/ChangeLog b/src/kadmin/cli/ChangeLog index 3b468f163..a77e0509c 100644 --- a/src/kadmin/cli/ChangeLog +++ b/src/kadmin/cli/ChangeLog @@ -1,3 +1,8 @@ +2002-11-05 Tom Yu + + * kadmin.c (kadmin_addprinc, kadmin_cpw): Remove trailing colon, + as new implementation of krb5_read_password() appends it. + 2002-10-08 Tom Yu * kadmin.c (quit): Release exclusive lock, if acquired. diff --git a/src/kadmin/cli/kadmin.c b/src/kadmin/cli/kadmin.c index 72dc594b8..189938e65 100644 --- a/src/kadmin/cli/kadmin.c +++ b/src/kadmin/cli/kadmin.c @@ -681,10 +681,10 @@ void kadmin_cpw(argc, argv) } else if (argc == 1) { unsigned int i = sizeof (newpw) - 1; - sprintf(prompt1, "Enter password for principal \"%.900s\": ", + sprintf(prompt1, "Enter password for principal \"%.900s\"", *argv); sprintf(prompt2, - "Re-enter password for principal \"%.900s\": ", + "Re-enter password for principal \"%.900s\"", *argv); retval = krb5_read_password(context, prompt1, prompt2, newpw, &i); @@ -1009,10 +1009,10 @@ void kadmin_addprinc(argc, argv) } else if (pass == NULL) { unsigned int sz = sizeof (newpw) - 1; - sprintf(prompt1, "Enter password for principal \"%.900s\": ", + sprintf(prompt1, "Enter password for principal \"%.900s\"", canon); sprintf(prompt2, - "Re-enter password for principal \"%.900s\": ", + "Re-enter password for principal \"%.900s\"", canon); retval = krb5_read_password(context, prompt1, prompt2, newpw, &sz); diff --git a/src/kadmin/dbutil/ChangeLog b/src/kadmin/dbutil/ChangeLog index 73b191dbe..cf6619156 100644 --- a/src/kadmin/dbutil/ChangeLog +++ b/src/kadmin/dbutil/ChangeLog @@ -1,3 +1,9 @@ +2002-11-05 Tom Yu + + * dumpv4.c (v4init): + * loadv4.c (dumpfile;): Remove trailing colon, as new implementation + of des_read_password() appends it. + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/kadmin/dbutil/dumpv4.c b/src/kadmin/dbutil/dumpv4.c index 461da833d..e6bd1f407 100644 --- a/src/kadmin/dbutil/dumpv4.c +++ b/src/kadmin/dbutil/dumpv4.c @@ -112,7 +112,7 @@ v4init(arg, manual) } } if (!ok) { - des_read_password(&arg->v4_master_key, "V4 Kerberos master key: ", 1); + des_read_password(&arg->v4_master_key, "V4 Kerberos master key", 1); printf("\n"); } arg->master_key_version = 1; diff --git a/src/kadmin/dbutil/loadv4.c b/src/kadmin/dbutil/loadv4.c index 7ddba43c0..07bc27645 100644 --- a/src/kadmin/dbutil/loadv4.c +++ b/src/kadmin/dbutil/loadv4.c @@ -464,7 +464,7 @@ char *dumpfile; } } if (!ok) { - des_read_password(&master_key, "V4 Kerberos master key: ", 0); + des_read_password(&master_key, "V4 Kerberos master key", 0); printf("\n"); } key_sched(master_key, master_key_schedule); diff --git a/src/kadmin/ktutil/ChangeLog b/src/kadmin/ktutil/ChangeLog index 388fde508..cccc49363 100644 --- a/src/kadmin/ktutil/ChangeLog +++ b/src/kadmin/ktutil/ChangeLog @@ -1,3 +1,8 @@ +2002-11-05 Tom Yu + + * ktutil_funcs.c (ktutil_add): Remove trailing colon, as new + implementation of krb5_read_password() appends it. + 2002-08-29 Ken Raeburn * ktutil_ct.ct: Add final "end" statement. diff --git a/src/kadmin/ktutil/ktutil_funcs.c b/src/kadmin/ktutil/ktutil_funcs.c index 073b03628..c64a41cae 100644 --- a/src/kadmin/ktutil/ktutil_funcs.c +++ b/src/kadmin/ktutil/ktutil_funcs.c @@ -161,7 +161,7 @@ krb5_error_code ktutil_add(context, list, princ_str, kvno, goto cleanup; } - sprintf(promptstr, "Password for %.1000s: ", princ_str); + sprintf(promptstr, "Password for %.1000s", princ_str); retval = krb5_read_password(context, promptstr, NULL, password.data, &password.length); if (retval) diff --git a/src/kadmin/passwd/ChangeLog b/src/kadmin/passwd/ChangeLog index 213821472..206902358 100644 --- a/src/kadmin/passwd/ChangeLog +++ b/src/kadmin/passwd/ChangeLog @@ -1,3 +1,8 @@ +2002-11-05 Tom Yu + + * kpasswd_strings.et: Remove trailing colon, as new implementation + of krb5_read_password() appends it. + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/kadmin/passwd/kpasswd_strings.et b/src/kadmin/passwd/kpasswd_strings.et index b78aa9d6f..7e826d270 100644 --- a/src/kadmin/passwd/kpasswd_strings.et +++ b/src/kadmin/passwd/kpasswd_strings.et @@ -45,7 +45,7 @@ error_code KPW_STR_NOT_IN_PASSWD_FILE, "Unable to identify user from password fi error_code KPW_STR_CHANGING_PW_FOR, "Changing password for %s." # /* principal@realm */ -error_code KPW_STR_OLD_PASSWORD_PROMPT, "Old password:" +error_code KPW_STR_OLD_PASSWORD_PROMPT, "Old password" error_code KPW_STR_WHILE_READING_PASSWORD, "while reading new password." # /* M4 */ diff --git a/src/kadmin/v5passwdd/ChangeLog b/src/kadmin/v5passwdd/ChangeLog index 419b941ef..ced306736 100644 --- a/src/kadmin/v5passwdd/ChangeLog +++ b/src/kadmin/v5passwdd/ChangeLog @@ -1,3 +1,9 @@ +2002-11-05 Tom Yu + + * kpasswd.c (kpwd_change_prompt_1, kpwd_change_prompt_2) + (kpwd_old_password_prompt, kpwd_old_pwd_name_fmt): Remove trailing + colon, as new implementation of krb5_read_password() appends it. + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/kadmin/v5passwdd/kpasswd.c b/src/kadmin/v5passwdd/kpasswd.c index 5f76cea60..9a9318044 100644 --- a/src/kadmin/v5passwdd/kpasswd.c +++ b/src/kadmin/v5passwdd/kpasswd.c @@ -55,10 +55,10 @@ * Local data. */ #define kpwd_serror_head "server" -#define kpwd_change_prompt_1 " Enter new password: " -#define kpwd_change_prompt_2 "Re-enter new password: " -#define kpwd_old_password_prompt " Enter old password: " -#define kpwd_old_pwd_name_fmt "Enter old password for %s: " +#define kpwd_change_prompt_1 " Enter new password" +#define kpwd_change_prompt_2 "Re-enter new password" +#define kpwd_old_password_prompt " Enter old password" +#define kpwd_old_pwd_name_fmt "Enter old password for %s" #ifdef LANGUAGES_SUPPORTED #define kpwd_usage_error_fmt "%s: usage is %s [-u user] [-l language]\n" diff --git a/src/lib/kadm5/ChangeLog b/src/lib/kadm5/ChangeLog index 6a91bf428..a1b5057f1 100644 --- a/src/lib/kadm5/ChangeLog +++ b/src/lib/kadm5/ChangeLog @@ -1,3 +1,8 @@ +2002-11-05 Tom Yu + + * chpass_util_strings.et: Remove trailing colons, as new + implementation of krb5_read_password() appends it. + 2002-10-08 Tom Yu * adb.h (struct _osa_adb_db_ent_t): Add opencnt, which keeps track diff --git a/src/lib/kadm5/chpass_util_strings.et b/src/lib/kadm5/chpass_util_strings.et index 032254998..eb4bccaed 100644 --- a/src/lib/kadm5/chpass_util_strings.et +++ b/src/lib/kadm5/chpass_util_strings.et @@ -7,8 +7,8 @@ error_code CHPASS_UTIL_GET_PRINC_INFO, "while getting principal info." error_code CHPASS_UTIL_NEW_PASSWORD_MISMATCH, "New passwords do not match - password not changed.\n" -error_code CHPASS_UTIL_NEW_PASSWORD_PROMPT, "New password:" -error_code CHPASS_UTIL_NEW_PASSWORD_AGAIN_PROMPT, "New password (again):" +error_code CHPASS_UTIL_NEW_PASSWORD_PROMPT, "New password" +error_code CHPASS_UTIL_NEW_PASSWORD_AGAIN_PROMPT, "New password (again)" error_code CHPASS_UTIL_NO_PASSWORD_READ, "You must type a password. Passwords must be at least one character long.\n" error_code CHPASS_UTIL_NO_POLICY_YET_Q_ERROR, "yet no policy set! Contact your system security administrator." -- 2.26.2