From: Greg Hudson Date: Wed, 9 May 2012 17:55:27 +0000 (+0000) Subject: Constify get_init_creds string input params X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6b5bc54f09763e6fd6531a1b83759b1aa7415136;p=krb5.git Constify get_init_creds string input params The get_init_creds functions take read-only string input parameters for passwords and initial ticket services. Make these const char * parameters instead of just char * parameters, for caller convenience. Reported by rra@stanford.edu. ticket: 7121 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25858 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 2a4e8a73b..1ea8c10c9 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -1013,7 +1013,8 @@ krb5_error_code KRB5_CALLCONV krb5int_get_init_creds(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_prompter_fct prompter, void *prompter_data, krb5_deltat start_time, - char *in_tkt_service, krb5_get_init_creds_opt *options, + const char *in_tkt_service, + krb5_get_init_creds_opt *options, krb5_gic_get_as_key_fct gak, void *gak_data, int *master, krb5_kdc_rep **as_reply); diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin index 741477caf..f319136ec 100644 --- a/src/include/krb5/krb5.hin +++ b/src/include/krb5/krb5.hin @@ -6696,9 +6696,10 @@ krb5_get_init_creds_opt_set_expire_callback(krb5_context context, */ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_password(krb5_context context, krb5_creds *creds, - krb5_principal client, char *password, + krb5_principal client, const char *password, krb5_prompter_fct prompter, void *data, - krb5_deltat start_time, char *in_tkt_service, + krb5_deltat start_time, + const char *in_tkt_service, krb5_get_init_creds_opt *k5_gic_options); struct _krb5_init_creds_context; @@ -7040,7 +7041,7 @@ krb5_tkt_creds_get_times(krb5_context context, krb5_tkt_creds_context ctx, krb5_error_code KRB5_CALLCONV krb5_get_init_creds_keytab(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_keytab arg_keytab, - krb5_deltat start_time, char *in_tkt_service, + krb5_deltat start_time, const char *in_tkt_service, krb5_get_init_creds_opt *k5_gic_options); typedef struct _krb5_verify_init_creds_opt { @@ -7150,7 +7151,7 @@ krb5_verify_init_creds(krb5_context context, krb5_creds *creds, krb5_error_code KRB5_CALLCONV krb5_get_validated_creds(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_ccache ccache, - char *in_tkt_service); + const char *in_tkt_service); /** * Get renewed credential from KDC using an existing credential. @@ -7176,7 +7177,7 @@ krb5_get_validated_creds(krb5_context context, krb5_creds *creds, krb5_error_code KRB5_CALLCONV krb5_get_renewed_creds(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_ccache ccache, - char *in_tkt_service); + const char *in_tkt_service); /** * Decode an ASN.1-formatted ticket. diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index 738bd9c37..4c634f0dc 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -437,7 +437,7 @@ sort_krb5_padata_sequence(krb5_context context, krb5_data *realm, static krb5_error_code build_in_tkt_name(krb5_context context, - char *in_tkt_service, + const char *in_tkt_service, krb5_const_principal client, krb5_principal *server) { @@ -1616,7 +1616,7 @@ krb5int_get_init_creds(krb5_context context, krb5_prompter_fct prompter, void *prompter_data, krb5_deltat start_time, - char *in_tkt_service, + const char *in_tkt_service, krb5_get_init_creds_opt *options, krb5_gic_get_as_key_fct gak_fct, void *gak_data, diff --git a/src/lib/krb5/krb/gic_keytab.c b/src/lib/krb5/krb/gic_keytab.c index 3554b257c..bae83dbb3 100644 --- a/src/lib/krb5/krb/gic_keytab.c +++ b/src/lib/krb5/krb/gic_keytab.c @@ -209,7 +209,7 @@ krb5_init_creds_set_keytab(krb5_context context, static krb5_error_code get_init_creds_keytab(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_keytab keytab, - krb5_deltat start_time, char *in_tkt_service, + krb5_deltat start_time, const char *in_tkt_service, krb5_get_init_creds_opt *options, int *use_master) { krb5_error_code ret; @@ -250,7 +250,7 @@ krb5_get_init_creds_keytab(krb5_context context, krb5_principal client, krb5_keytab arg_keytab, krb5_deltat start_time, - char *in_tkt_service, + const char *in_tkt_service, krb5_get_init_creds_opt *options) { krb5_error_code ret, ret2; diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c index b25eb6da0..b8406a651 100644 --- a/src/lib/krb5/krb/gic_pwd.c +++ b/src/lib/krb5/krb/gic_pwd.c @@ -218,11 +218,11 @@ krb5_error_code KRB5_CALLCONV krb5_get_init_creds_password(krb5_context context, krb5_creds *creds, krb5_principal client, - char *password, + const char *password, krb5_prompter_fct prompter, void *data, krb5_deltat start_time, - char *in_tkt_service, + const char *in_tkt_service, krb5_get_init_creds_opt *options) { krb5_error_code ret, ret2; diff --git a/src/lib/krb5/krb/val_renew.c b/src/lib/krb5/krb/val_renew.c index 39912aaa8..8550674a8 100644 --- a/src/lib/krb5/krb/val_renew.c +++ b/src/lib/krb5/krb/val_renew.c @@ -136,7 +136,7 @@ krb5_get_credentials_renew(krb5_context context, krb5_flags options, static krb5_error_code get_valrenewed_creds(krb5_context context, krb5_creds *out_creds, krb5_principal client, krb5_ccache ccache, - char *in_tkt_service, int kdcopt) + const char *in_tkt_service, int kdcopt) { krb5_error_code code; krb5_creds in_creds, *new_creds; @@ -181,7 +181,7 @@ cleanup: krb5_error_code KRB5_CALLCONV krb5_get_validated_creds(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_ccache ccache, - char *in_tkt_service) + const char *in_tkt_service) { return get_valrenewed_creds(context, creds, client, ccache, in_tkt_service, KDC_OPT_VALIDATE); @@ -190,7 +190,7 @@ krb5_get_validated_creds(krb5_context context, krb5_creds *creds, krb5_error_code KRB5_CALLCONV krb5_get_renewed_creds(krb5_context context, krb5_creds *creds, krb5_principal client, krb5_ccache ccache, - char *in_tkt_service) + const char *in_tkt_service) { return get_valrenewed_creds(context, creds, client, ccache, in_tkt_service, KDC_OPT_RENEW);