From 3ccc6f691d07635a465d927cbb723275d813fd9c Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 6 Mar 2004 00:45:33 +0000 Subject: [PATCH] Use more const data in the keytab type registry git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16149 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 2 ++ src/include/krb5.hin | 2 +- src/lib/krb5/keytab/ChangeLog | 8 ++++++++ src/lib/krb5/keytab/ktbase.c | 12 ++++++------ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 12abf8a75..0fd2369ab 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,5 +1,7 @@ 2004-03-05 Ken Raeburn + * krb5.hin (krb5_kt_register): Ops table is now const. + * k5-thread.h: New file. 2004-02-26 Jeffrey Altman diff --git a/src/include/krb5.hin b/src/include/krb5.hin index 676cf22ea..518b5dd81 100644 --- a/src/include/krb5.hin +++ b/src/include/krb5.hin @@ -1625,7 +1625,7 @@ int KRB5_CALLCONV krb5_524_convert_creds #if KRB5_PRIVATE krb5_error_code KRB5_CALLCONV krb5_kt_register (krb5_context, - struct _krb5_kt_ops * ); + const struct _krb5_kt_ops * ); #endif krb5_error_code KRB5_CALLCONV krb5_kt_resolve diff --git a/src/lib/krb5/keytab/ChangeLog b/src/lib/krb5/keytab/ChangeLog index bfb1ebcf2..b5a9e41e4 100644 --- a/src/lib/krb5/keytab/ChangeLog +++ b/src/lib/krb5/keytab/ChangeLog @@ -1,3 +1,11 @@ +2004-03-05 Ken Raeburn + + * ktbase.c (krb5_kt_register): Ops table is now const. + (struct krb5_kt_typelist): "next" pointer now points to const. + (krb5_kt_typelist_wrfile, krb5_kt_typelist_file, + krb5_kt_typelist_srvtab): Now const. + (kt_typehead): Now points to const. + 2003-07-17 Ken Raeburn * Makefile.in (LIBNAME) [##WIN16##]: Don't define. diff --git a/src/lib/krb5/keytab/ktbase.c b/src/lib/krb5/keytab/ktbase.c index 684c4e477..6e199d685 100644 --- a/src/lib/krb5/keytab/ktbase.c +++ b/src/lib/krb5/keytab/ktbase.c @@ -35,21 +35,21 @@ extern const krb5_kt_ops krb5_kts_ops; struct krb5_kt_typelist { const krb5_kt_ops *ops; - struct krb5_kt_typelist *next; + const struct krb5_kt_typelist *next; }; -static struct krb5_kt_typelist krb5_kt_typelist_wrfile = { +const static struct krb5_kt_typelist krb5_kt_typelist_wrfile = { &krb5_ktf_writable_ops, 0 }; -static struct krb5_kt_typelist krb5_kt_typelist_file = { +const static struct krb5_kt_typelist krb5_kt_typelist_file = { &krb5_ktf_ops, &krb5_kt_typelist_wrfile }; -static struct krb5_kt_typelist krb5_kt_typelist_srvtab = { +const static struct krb5_kt_typelist krb5_kt_typelist_srvtab = { &krb5_kts_ops, &krb5_kt_typelist_file }; -static struct krb5_kt_typelist *kt_typehead = &krb5_kt_typelist_srvtab; +static const struct krb5_kt_typelist *kt_typehead = &krb5_kt_typelist_srvtab; /* @@ -58,7 +58,7 @@ static struct krb5_kt_typelist *kt_typehead = &krb5_kt_typelist_srvtab; */ krb5_error_code KRB5_CALLCONV -krb5_kt_register(krb5_context context, krb5_kt_ops *ops) +krb5_kt_register(krb5_context context, const krb5_kt_ops *ops) { struct krb5_kt_typelist *t; for (t = kt_typehead;t && strcmp(t->ops->prefix,ops->prefix);t = t->next) -- 2.26.2