From ac3f9212dac5bc6ed87252f07f240735b1ca2026 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Tue, 20 Jun 2023 12:21:48 +0000 Subject: [PATCH] appl/kf: Sprinkle const and rk_UNCONST. --- appl/kf/kfd.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/appl/kf/kfd.c b/appl/kf/kfd.c index 9099bab9b..74e646af8 100644 --- a/appl/kf/kfd.c +++ b/appl/kf/kfd.c @@ -39,10 +39,10 @@ char krb5_tkfile[MAXPATHLEN]; static int help_flag; static int version_flag; -static char *port_str; -char *service = KF_SERVICE; +static const char *port_str; +const char *service = KF_SERVICE; int do_inetd = 0; -static char *regpag_str=NULL; +static const char *regpag_str = NULL; static struct getargs args[] = { { "port", 'p', arg_string, &port_str, "port to listen to", "port" }, @@ -176,9 +176,12 @@ proto (int sock, const char *svc) krb5_err(context, 1, status, "krb5_unparse_name"); if(protocol_version == 0) { - data.data = "old clnt"; /* XXX old clients only had room for - 10 bytes of message, and also - didn't show it to the user */ + /* + * XXX old clients only had room for 10 bytes of message, and + * also didn't show it to the user + */ + /* used read-only by krb5_write_message */ + data.data = rk_UNCONST("old clnt"); data.length = strlen(data.data) + 1; krb5_write_message(context, &sock, &data); sleep(2); /* XXX give client time to finish */