From c69ce29a31360f8e698a1bb061cd99e545b6379b Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 28 May 2023 19:06:40 +0000 Subject: [PATCH] krb5/constants.c: Make some constants constant. This changes the public header file but I doubt it was ever intended that applications could change these by writing to them. (Not sure why they're not declared as const arrays in any case.) --- lib/krb5/constants.c | 18 +++++++++--------- lib/krb5/krb5.h | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/krb5/constants.c b/lib/krb5/constants.c index 42b460f61..43b8f54eb 100644 --- a/lib/krb5/constants.c +++ b/lib/krb5/constants.c @@ -35,7 +35,7 @@ #include "krb5_locl.h" -KRB5_LIB_VARIABLE const char *krb5_config_file = +KRB5_LIB_VARIABLE const char *const krb5_config_file = #ifdef KRB5_DEFAULT_CONFIG_FILE KRB5_DEFAULT_CONFIG_FILE #else @@ -56,12 +56,12 @@ SYSCONFDIR "/krb5.conf" PATH_SEP #endif /* KRB5_DEFAULT_CONFIG_FILE */ ; -KRB5_LIB_VARIABLE const char *krb5_defkeyname = KEYTAB_DEFAULT; +KRB5_LIB_VARIABLE const char *const krb5_defkeyname = KEYTAB_DEFAULT; -KRB5_LIB_VARIABLE const char *krb5_cc_type_api = "API"; -KRB5_LIB_VARIABLE const char *krb5_cc_type_file = "FILE"; -KRB5_LIB_VARIABLE const char *krb5_cc_type_memory = "MEMORY"; -KRB5_LIB_VARIABLE const char *krb5_cc_type_kcm = "KCM"; -KRB5_LIB_VARIABLE const char *krb5_cc_type_scc = "SCC"; -KRB5_LIB_VARIABLE const char *krb5_cc_type_dcc = "DIR"; -KRB5_LIB_VARIABLE const char *krb5_cc_type_keyring = "KEYRING"; +KRB5_LIB_VARIABLE const char *const krb5_cc_type_api = "API"; +KRB5_LIB_VARIABLE const char *const krb5_cc_type_file = "FILE"; +KRB5_LIB_VARIABLE const char *const krb5_cc_type_memory = "MEMORY"; +KRB5_LIB_VARIABLE const char *const krb5_cc_type_kcm = "KCM"; +KRB5_LIB_VARIABLE const char *const krb5_cc_type_scc = "SCC"; +KRB5_LIB_VARIABLE const char *const krb5_cc_type_dcc = "DIR"; +KRB5_LIB_VARIABLE const char *const krb5_cc_type_keyring = "KEYRING"; diff --git a/lib/krb5/krb5.h b/lib/krb5/krb5.h index e4a9e7ec8..eb9f18046 100644 --- a/lib/krb5/krb5.h +++ b/lib/krb5/krb5.h @@ -1018,8 +1018,8 @@ typedef struct krb5_kx509_req_ctx_data *krb5_kx509_req_ctx; /* variables */ -extern KRB5_LIB_VARIABLE const char *krb5_config_file; -extern KRB5_LIB_VARIABLE const char *krb5_defkeyname; +extern KRB5_LIB_VARIABLE const char *const krb5_config_file; +extern KRB5_LIB_VARIABLE const char *const krb5_defkeyname; extern KRB5_LIB_VARIABLE const krb5_cc_ops krb5_acc_ops; @@ -1038,13 +1038,13 @@ extern KRB5_LIB_VARIABLE const krb5_kt_ops krb5_mkt_ops; extern KRB5_LIB_VARIABLE const krb5_kt_ops krb5_akf_ops; extern KRB5_LIB_VARIABLE const krb5_kt_ops krb5_any_ops; -extern KRB5_LIB_VARIABLE const char *krb5_cc_type_api; -extern KRB5_LIB_VARIABLE const char *krb5_cc_type_file; -extern KRB5_LIB_VARIABLE const char *krb5_cc_type_memory; -extern KRB5_LIB_VARIABLE const char *krb5_cc_type_kcm; -extern KRB5_LIB_VARIABLE const char *krb5_cc_type_scc; -extern KRB5_LIB_VARIABLE const char *krb5_cc_type_dcc; -extern KRB5_LIB_VARIABLE const char *krb5_cc_type_keyring; +extern KRB5_LIB_VARIABLE const char *const krb5_cc_type_api; +extern KRB5_LIB_VARIABLE const char *const krb5_cc_type_file; +extern KRB5_LIB_VARIABLE const char *const krb5_cc_type_memory; +extern KRB5_LIB_VARIABLE const char *const krb5_cc_type_kcm; +extern KRB5_LIB_VARIABLE const char *const krb5_cc_type_scc; +extern KRB5_LIB_VARIABLE const char *const krb5_cc_type_dcc; +extern KRB5_LIB_VARIABLE const char *const krb5_cc_type_keyring; /* clang analyzer workarounds */