From c82d8c3561c67cb875a05c9f8caa37fad68dc4b5 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 31 Oct 2002 22:54:00 +0000 Subject: [PATCH] * k5-int.h (krb5_ser_handle): Now points to const. (krb5_kt_dfl_ops): Now const. (struct _krb5_kt_ops): Field serializer now points to const krb5_ser_entry instead of void. * krb5.hin (struct _krb5_kt): Field ops now points to const. * kt_file.c (krb5_ktf_ops, krb5_ktf_writable_ops): Now const. Drop cast of serializer entry initializer. (fopen_mode_rbplus, fopen_mode_rb): Now const. * kt_srvtab.c (krb5_kts_ops): Now const. * ktbase.c (krb5_ktf_ops, krb5_kts_ops): Update declarations. (struct krb5_kt_typelist): Field ops now points to const. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14953 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 8 ++++++++ src/include/k5-int.h | 6 +++--- src/include/krb5.hin | 2 +- src/lib/krb5/keytab/ChangeLog | 9 +++++++++ src/lib/krb5/keytab/kt_file.c | 24 ++++++++++++------------ src/lib/krb5/keytab/kt_srvtab.c | 4 ++-- src/lib/krb5/keytab/ktbase.c | 6 +++--- 7 files changed, 38 insertions(+), 21 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 6c6e50742..94b426519 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,11 @@ +2002-10-31 Ken Raeburn + + * k5-int.h (krb5_ser_handle): Now points to const. + (krb5_kt_dfl_ops): Now const. + (struct _krb5_kt_ops): Field serializer now points to const + krb5_ser_entry instead of void. + * krb5.hin (struct _krb5_kt): Field ops now points to const. + 2002-10-30 Ken Hornstein * krb5.hin: Change definitions of new SAM preauth types to diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 0ee5dd9a8..e6d69205c 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -1525,7 +1525,7 @@ struct __krb5_serializer { krb5_octet **, size_t *); }; -typedef struct __krb5_serializer * krb5_ser_handle; +typedef const struct __krb5_serializer * krb5_ser_handle; typedef struct __krb5_serializer krb5_ser_entry; krb5_ser_handle krb5_find_serializer @@ -1793,10 +1793,10 @@ typedef struct _krb5_kt_ops { krb5_keytab_entry *); /* Handle for serializer */ - void * serializer; + const krb5_ser_entry *serializer; } krb5_kt_ops; -extern krb5_kt_ops krb5_kt_dfl_ops; +extern const krb5_kt_ops krb5_kt_dfl_ops; extern krb5_error_code krb5int_translate_gai_error (int); diff --git a/src/include/krb5.hin b/src/include/krb5.hin index ceb5a47b8..a1fb92617 100644 --- a/src/include/krb5.hin +++ b/src/include/krb5.hin @@ -1328,7 +1328,7 @@ typedef struct krb5_keytab_entry_st { struct _krb5_kt_ops; typedef struct _krb5_kt { /* should move into k5-int.h */ krb5_magic magic; - struct _krb5_kt_ops *ops; + const struct _krb5_kt_ops *ops; krb5_pointer data; } *krb5_keytab; #else diff --git a/src/lib/krb5/keytab/ChangeLog b/src/lib/krb5/keytab/ChangeLog index 203eb1f74..7112d7f90 100644 --- a/src/lib/krb5/keytab/ChangeLog +++ b/src/lib/krb5/keytab/ChangeLog @@ -1,3 +1,12 @@ +2002-10-31 Ken Raeburn + + * kt_file.c (krb5_ktf_ops, krb5_ktf_writable_ops): Now const. + Drop cast of serializer entry initializer. + (fopen_mode_rbplus, fopen_mode_rb): Now const. + * kt_srvtab.c (krb5_kts_ops): Now const. + * ktbase.c (krb5_ktf_ops, krb5_kts_ops): Update declarations. + (struct krb5_kt_typelist): Field ops now points to const. + 2002-09-03 Ken Raeburn * kt_file.c, kt_srvtab.c, ktadd.c, ktbase.c, ktdefault.c, diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index 732933cb2..47050798a 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -63,8 +63,8 @@ typedef struct _krb5_ktfile_data { #define KTFILEP(id) (((krb5_ktfile_data *)(id)->data)->openf) #define KTVERSION(id) (((krb5_ktfile_data *)(id)->data)->version) -extern struct _krb5_kt_ops krb5_ktf_ops; -extern struct _krb5_kt_ops krb5_ktf_writable_ops; +extern const struct _krb5_kt_ops krb5_ktf_ops; +extern const struct _krb5_kt_ops krb5_ktf_writable_ops; krb5_error_code KRB5_CALLCONV krb5_ktfile_resolve (krb5_context, @@ -849,7 +849,7 @@ krb5_ktfile_remove(krb5_context context, krb5_keytab id, krb5_keytab_entry *entr * krb5_ktf_ops */ -struct _krb5_kt_ops krb5_ktf_ops = { +const struct _krb5_kt_ops krb5_ktf_ops = { 0, "FILE", /* Prefix -- this string should not appear anywhere else! */ krb5_ktfile_resolve, @@ -861,14 +861,14 @@ struct _krb5_kt_ops krb5_ktf_ops = { krb5_ktfile_end_get, 0, 0, - (void *) &krb5_ktfile_ser_entry + &krb5_ktfile_ser_entry }; /* * krb5_ktf_writable_ops */ -struct _krb5_kt_ops krb5_ktf_writable_ops = { +const struct _krb5_kt_ops krb5_ktf_writable_ops = { 0, "WRFILE", /* Prefix -- this string should not appear anywhere else! */ krb5_ktfile_wresolve, @@ -880,14 +880,14 @@ struct _krb5_kt_ops krb5_ktf_writable_ops = { krb5_ktfile_end_get, krb5_ktfile_add, krb5_ktfile_remove, - (void *) &krb5_ktfile_ser_entry + &krb5_ktfile_ser_entry }; /* * krb5_kt_dfl_ops */ -krb5_kt_ops krb5_kt_dfl_ops = { +const krb5_kt_ops krb5_kt_dfl_ops = { 0, "FILE", /* Prefix -- this string should not appear anywhere else! */ krb5_ktfile_resolve, @@ -899,7 +899,7 @@ krb5_kt_ops krb5_kt_dfl_ops = { krb5_ktfile_end_get, 0, 0, - (void *) &krb5_ktfile_ser_entry + &krb5_ktfile_ser_entry }; /* @@ -987,11 +987,11 @@ krb5_kt_vno krb5_kt_default_vno = KRB5_KT_DEFAULT_VNO; #define xfread(a, b, c, d) fread((char *)a, b, (unsigned) c, d) #ifdef ANSI_STDIO -static char *fopen_mode_rbplus= "rb+"; -static char *fopen_mode_rb = "rb"; +static char *const fopen_mode_rbplus= "rb+"; +static char *const fopen_mode_rb = "rb"; #else -static char *fopen_mode_rbplus= "r+"; -static char *fopen_mode_rb = "r"; +static char *const fopen_mode_rbplus= "r+"; +static char *const fopen_mode_rb = "r"; #endif static krb5_error_code diff --git a/src/lib/krb5/keytab/kt_srvtab.c b/src/lib/krb5/keytab/kt_srvtab.c index 56019058b..b516614e6 100644 --- a/src/lib/krb5/keytab/kt_srvtab.c +++ b/src/lib/krb5/keytab/kt_srvtab.c @@ -54,7 +54,7 @@ typedef struct _krb5_ktsrvtab_data { #define KTFILENAME(id) (((krb5_ktsrvtab_data *)(id)->data)->name) #define KTFILEP(id) (((krb5_ktsrvtab_data *)(id)->data)->openf) -extern struct _krb5_kt_ops krb5_kts_ops; +extern const struct _krb5_kt_ops krb5_kts_ops; static krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_resolve (krb5_context, @@ -333,7 +333,7 @@ krb5_ktsrvtab_end_get(krb5_context context, krb5_keytab id, krb5_kt_cursor *curs * krb5_kts_ops */ -struct _krb5_kt_ops krb5_kts_ops = { +const struct _krb5_kt_ops krb5_kts_ops = { 0, "SRVTAB", /* Prefix -- this string should not appear anywhere else! */ krb5_ktsrvtab_resolve, diff --git a/src/lib/krb5/keytab/ktbase.c b/src/lib/krb5/keytab/ktbase.c index 15ab7fe83..41f473d47 100644 --- a/src/lib/krb5/keytab/ktbase.c +++ b/src/lib/krb5/keytab/ktbase.c @@ -29,11 +29,11 @@ #include "k5-int.h" -extern krb5_kt_ops krb5_ktf_ops; -extern krb5_kt_ops krb5_kts_ops; +extern const krb5_kt_ops krb5_ktf_ops; +extern const krb5_kt_ops krb5_kts_ops; struct krb5_kt_typelist { - krb5_kt_ops *ops; + const krb5_kt_ops *ops; struct krb5_kt_typelist *next; }; static struct krb5_kt_typelist krb5_kt_typelist_file = { -- 2.26.2