From 2fa979aa62ae6fb4a258b0f600de82767c3a606f Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 19 May 2003 17:34:41 +0000 Subject: [PATCH] Register writable keytabs by default We have a customer requirement to support writable keytabs using the public API in 1.3 Discussion on krbcore indicates there is no good reason why these are not registered by default. So, they are now registered by default. Also adjust other code in the tree not to try and register them. Ticket: new Target_Version: 1.3 Component: krb5-libs Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15459 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/cli/ChangeLog | 4 ++++ src/kadmin/cli/kadmin.c | 6 ------ src/kadmin/ktutil/ChangeLog | 5 +++++ src/kadmin/ktutil/ktutil.c | 7 ------- src/lib/krb5/keytab/ChangeLog | 4 ++++ src/lib/krb5/keytab/ktbase.c | 7 ++++++- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/kadmin/cli/ChangeLog b/src/kadmin/cli/ChangeLog index aa463ba12..12c4a1671 100644 --- a/src/kadmin/cli/ChangeLog +++ b/src/kadmin/cli/ChangeLog @@ -1,3 +1,7 @@ +2003-05-19 Sam Hartman + + * kadmin.c (kadmin_startup): Don't register writable keytabs as this is always done by the library now. + 2003-02-07 Tom Yu * Makefile.in (install): Fix typo in k5srvutil.M install rule. diff --git a/src/kadmin/cli/kadmin.c b/src/kadmin/cli/kadmin.c index 189938e65..256537b28 100644 --- a/src/kadmin/cli/kadmin.c +++ b/src/kadmin/cli/kadmin.c @@ -175,7 +175,6 @@ char *kadmin_startup(argc, argv) int argc; char *argv[]; { - extern krb5_kt_ops krb5_ktf_writable_ops; extern char *optarg; char *princstr = NULL, *keytab_name = NULL, *query = NULL; char *password = NULL; @@ -449,11 +448,6 @@ char *kadmin_startup(argc, argv) } /* register the WRFILE keytab type and set it as the default */ - if ((retval = krb5_kt_register(context, &krb5_ktf_writable_ops))) { - com_err(whoami, retval, - "while registering writable key table functions"); - exit(1); - } { #define DEFAULT_KEYTAB "WRFILE:/etc/krb5.keytab" /* XXX krb5_defkeyname is an internal library global and diff --git a/src/kadmin/ktutil/ChangeLog b/src/kadmin/ktutil/ChangeLog index cccc49363..0202686b7 100644 --- a/src/kadmin/ktutil/ChangeLog +++ b/src/kadmin/ktutil/ChangeLog @@ -1,3 +1,8 @@ +2003-05-19 Sam Hartman + + * ktutil.c (main): Don't register writable keytab ops as they are + registered by the library now + 2002-11-05 Tom Yu * ktutil_funcs.c (ktutil_add): Remove trailing colon, as new diff --git a/src/kadmin/ktutil/ktutil.c b/src/kadmin/ktutil/ktutil.c index e01bbdbef..e2464e853 100644 --- a/src/kadmin/ktutil/ktutil.c +++ b/src/kadmin/ktutil/ktutil.c @@ -45,7 +45,6 @@ int main(argc, argv) char *argv[]; { krb5_error_code retval; - extern krb5_kt_ops krb5_ktf_writable_ops; int sci_idx; retval = krb5_init_context(&kcontext); @@ -53,12 +52,6 @@ int main(argc, argv) com_err(argv[0], retval, "while initializing krb5"); exit(1); } - retval = krb5_kt_register(kcontext, &krb5_ktf_writable_ops); - if (retval) { - com_err(argv[0], retval, - "while registering writable key table functions"); - exit(1); - } sci_idx = ss_create_invocation("ktutil", "5.0", (char *)NULL, &ktutil_cmds, &retval); if (retval) { diff --git a/src/lib/krb5/keytab/ChangeLog b/src/lib/krb5/keytab/ChangeLog index 864a412e7..87f76ed2f 100644 --- a/src/lib/krb5/keytab/ChangeLog +++ b/src/lib/krb5/keytab/ChangeLog @@ -1,3 +1,7 @@ +2003-05-19 Sam Hartman + + * ktbase.c: Register writable keytab by default + 2003-04-01 Nalin Dahyabhai * kt_file.c (krb5_ktfileint_internal_read_entry): Use diff --git a/src/lib/krb5/keytab/ktbase.c b/src/lib/krb5/keytab/ktbase.c index 41f473d47..684c4e477 100644 --- a/src/lib/krb5/keytab/ktbase.c +++ b/src/lib/krb5/keytab/ktbase.c @@ -30,15 +30,20 @@ #include "k5-int.h" extern const krb5_kt_ops krb5_ktf_ops; +extern const krb5_kt_ops krb5_ktf_writable_ops; extern const krb5_kt_ops krb5_kts_ops; struct krb5_kt_typelist { const krb5_kt_ops *ops; struct krb5_kt_typelist *next; }; +static struct krb5_kt_typelist krb5_kt_typelist_wrfile = { + &krb5_ktf_writable_ops, + 0 +}; static struct krb5_kt_typelist krb5_kt_typelist_file = { &krb5_ktf_ops, - 0 + &krb5_kt_typelist_wrfile }; static struct krb5_kt_typelist krb5_kt_typelist_srvtab = { &krb5_kts_ops, -- 2.26.2