From: Ezra Peisach Date: Mon, 5 Feb 2007 15:32:13 +0000 (+0000) Subject: krb5_kt_get_type should return const char *. X-Git-Tag: krb5-1.7-alpha1~1293 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6683ca81d531800937887170f6c0f2a19ca10535;p=krb5.git krb5_kt_get_type should return const char *. The code returns a pointer to static structures. Just to enforce the assumption that users can not change the returned data. Change prototype of krb5_kt_get_type to return const char *. The other changes are to clean up warnings - no change in code - usage assumed const. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19143 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin index ff0a31be7..a404b2531 100644 --- a/src/include/krb5/krb5.hin +++ b/src/include/krb5/krb5.hin @@ -1323,7 +1323,7 @@ typedef struct krb5_keytab_entry_st { struct _krb5_kt; typedef struct _krb5_kt *krb5_keytab; -char * KRB5_CALLCONV +const char * KRB5_CALLCONV krb5_kt_get_type (krb5_context, krb5_keytab keytab); krb5_error_code KRB5_CALLCONV krb5_kt_get_name(krb5_context context, krb5_keytab keytab, char *name, diff --git a/src/lib/gssapi/krb5/add_cred.c b/src/lib/gssapi/krb5/add_cred.c index 225f125d2..611019395 100644 --- a/src/lib/gssapi/krb5/add_cred.c +++ b/src/lib/gssapi/krb5/add_cred.c @@ -179,8 +179,8 @@ krb5_gss_add_cred(minor_status, input_cred_handle, if (output_cred_handle) { /* make a copy */ krb5_gss_cred_id_t new_cred; - char *kttype, ktboth[1024]; - const char *cctype, *ccname; + char ktboth[1024]; + const char *kttype, *cctype, *ccname; char ccboth[1024]; if ((new_cred = diff --git a/src/lib/krb5/keytab/ktfns.c b/src/lib/krb5/keytab/ktfns.c index 63fa6399b..24d8eb267 100644 --- a/src/lib/krb5/keytab/ktfns.c +++ b/src/lib/krb5/keytab/ktfns.c @@ -30,7 +30,7 @@ #include "k5-int.h" -char * KRB5_CALLCONV +const char * KRB5_CALLCONV krb5_kt_get_type (krb5_context context, krb5_keytab keytab) { return keytab->ops->prefix; diff --git a/src/lib/krb5/keytab/t_keytab.c b/src/lib/krb5/keytab/t_keytab.c index 63e4689d8..d16184e25 100644 --- a/src/lib/krb5/keytab/t_keytab.c +++ b/src/lib/krb5/keytab/t_keytab.c @@ -95,7 +95,7 @@ static void kt_test(krb5_context context, const char *name) { krb5_error_code kret; krb5_keytab kt; - char *type; + const char *type; char buf[BUFSIZ]; char *p; krb5_keytab_entry kent;