diff options
| author | Theodore Tso <tytso@mit.edu> | 1995-01-19 03:02:48 +0000 |
|---|---|---|
| committer | Theodore Tso <tytso@mit.edu> | 1995-01-19 03:02:48 +0000 |
| commit | 781cca93d561078bfe02e9ee4caa3a4cc184ef2a (patch) | |
| tree | 7b7060db2ecebbe60072072145757a597816ed7b /src | |
| parent | a4c08d0030804a3ecb282cdc9c9dad790644064c (diff) | |
| download | krb5-781cca93d561078bfe02e9ee4caa3a4cc184ef2a.tar.gz krb5-781cca93d561078bfe02e9ee4caa3a4cc184ef2a.tar.xz krb5-781cca93d561078bfe02e9ee4caa3a4cc184ef2a.zip | |
Make global_context a static variable and initialize it automatically
if necessary.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4825 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/des425/ChangeLog | 5 | ||||
| -rw-r--r-- | src/lib/des425/read_passwd.c | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/des425/ChangeLog b/src/lib/des425/ChangeLog index 6f73c5aad..db9cd7e5f 100644 --- a/src/lib/des425/ChangeLog +++ b/src/lib/des425/ChangeLog @@ -1,3 +1,8 @@ +Wed Jan 18 15:12:18 1995 Theodore Y. Ts'o (tytso@dcl) + + * read_passwd.c (des_read_password): Declare global_context and + initialize it if necessary. + Fri Jan 13 15:23:47 1995 Chris Provenzano (proven@mit.edu) * Added krb5_context to all krb5_routines diff --git a/src/lib/des425/read_passwd.c b/src/lib/des425/read_passwd.c index a618859e3..533165061 100644 --- a/src/lib/des425/read_passwd.c +++ b/src/lib/des425/read_passwd.c @@ -33,6 +33,8 @@ #include "des.h" +static krb5_context global_context = 0; + /*** Routines ****************************************************** */ int des_read_password/*_v4_compat_crock*/(k,prompt,verify) @@ -41,10 +43,17 @@ des_read_password/*_v4_compat_crock*/(k,prompt,verify) int verify; { int ok; + krb5_error_code retval; char key_string[BUFSIZ]; char prompt2[BUFSIZ]; int string_size = sizeof(key_string); + if (!global_context) { + retval = krb5_init_context(&global_context); + if (retval) + return retval; + } + if (verify) { strcpy(prompt2, "Verifying, please re-enter "); strncat(prompt2, prompt, sizeof(prompt2)-(strlen(prompt2)+1)); |
