From fabbf9e443459e8c0161c84563690ed70c7f6a61 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Fri, 10 Jun 2011 18:17:59 +0000 Subject: [PATCH] Add setlocale() calls to main functions ticket: 6918 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24963 dc483132-0cff-0310-8789-dd5450dbe970 --- src/clients/kdestroy/kdestroy.c | 1 + src/clients/kinit/kinit.c | 1 + src/clients/klist/klist.c | 1 + src/clients/kpasswd/kpasswd.c | 1 + src/clients/kvno/kvno.c | 2 +- src/kadmin/cli/ss_wrapper.c | 1 + src/kadmin/dbutil/kdb5_util.c | 1 + src/kadmin/ktutil/ktutil.c | 1 + src/kadmin/server/ovsec_kadmd.c | 1 + src/kdc/main.c | 1 + src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c | 1 + src/slave/kprop.c | 1 + src/slave/kpropd.c | 1 + src/slave/kproplog.c | 2 +- 14 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/clients/kdestroy/kdestroy.c b/src/clients/kdestroy/kdestroy.c index fe5ecacf6..73ce04459 100644 --- a/src/clients/kdestroy/kdestroy.c +++ b/src/clients/kdestroy/kdestroy.c @@ -75,6 +75,7 @@ main(argc, argv) int errflg = 0; int quiet = 0; + setlocale(LC_MESSAGES, ""); progname = GET_PROGNAME(argv[0]); while ((c = getopt(argc, argv, "54qc:")) != -1) { diff --git a/src/clients/kinit/kinit.c b/src/clients/kinit/kinit.c index 682dc6470..802229ae0 100644 --- a/src/clients/kinit/kinit.c +++ b/src/clients/kinit/kinit.c @@ -782,6 +782,7 @@ main(argc, argv) struct k5_data k5; int authed_k5 = 0; + setlocale(LC_MESSAGES, ""); progname = GET_PROGNAME(argv[0]); /* Ensure we can be driven from a pipe */ diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c index 1ecc5f8d8..d191f85c8 100644 --- a/src/clients/klist/klist.c +++ b/src/clients/klist/klist.c @@ -109,6 +109,7 @@ main(argc, argv) char *name; int mode; + setlocale(LC_MESSAGES, ""); progname = GET_PROGNAME(argv[0]); name = NULL; diff --git a/src/clients/kpasswd/kpasswd.c b/src/clients/kpasswd/kpasswd.c index 27325cc6d..b4b6eadd4 100644 --- a/src/clients/kpasswd/kpasswd.c +++ b/src/clients/kpasswd/kpasswd.c @@ -59,6 +59,7 @@ int main(int argc, char *argv[]) int result_code; krb5_data result_code_string, result_string; + setlocale(LC_MESSAGES, ""); if (argc > 2) { fprintf(stderr, _("usage: %s [principal]\n"), argv[0]); exit(1); diff --git a/src/clients/kvno/kvno.c b/src/clients/kvno/kvno.c index 9173daa76..74ecf58a8 100644 --- a/src/clients/kvno/kvno.c +++ b/src/clients/kvno/kvno.c @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) char *sname = NULL, *for_user = NULL; int canon = 0, unknown = 0, proxy = 0; - + setlocale(LC_MESSAGES, ""); set_com_err_hook (extended_com_err_fn); prog = strrchr(argv[0], '/'); diff --git a/src/kadmin/cli/ss_wrapper.c b/src/kadmin/cli/ss_wrapper.c index bde9b1561..f86c215f0 100644 --- a/src/kadmin/cli/ss_wrapper.c +++ b/src/kadmin/cli/ss_wrapper.c @@ -39,6 +39,7 @@ main(int argc, char *argv[]) krb5_error_code retval; int sci_idx, code = 0; + setlocale(LC_MESSAGES, ""); whoami = ((whoami = strrchr(argv[0], '/')) ? whoami+1 : argv[0]); request = kadmin_startup(argc, argv); diff --git a/src/kadmin/dbutil/kdb5_util.c b/src/kadmin/dbutil/kdb5_util.c index 7f5d6746b..70a04e259 100644 --- a/src/kadmin/dbutil/kdb5_util.c +++ b/src/kadmin/dbutil/kdb5_util.c @@ -198,6 +198,7 @@ int main(argc, argv) int cmd_argc; krb5_error_code retval; + setlocale(LC_MESSAGES, ""); set_com_err_hook(extended_com_err_fn); /* diff --git a/src/kadmin/ktutil/ktutil.c b/src/kadmin/ktutil/ktutil.c index 7fe15449e..c1106b156 100644 --- a/src/kadmin/ktutil/ktutil.c +++ b/src/kadmin/ktutil/ktutil.c @@ -45,6 +45,7 @@ int main(argc, argv) krb5_error_code retval; int sci_idx; + setlocale(LC_MESSAGES, ""); retval = krb5_init_context(&kcontext); if (retval) { com_err(argv[0], retval, _("while initializing krb5")); diff --git a/src/kadmin/server/ovsec_kadmd.c b/src/kadmin/server/ovsec_kadmd.c index 8c11480e8..04d8c4b84 100644 --- a/src/kadmin/server/ovsec_kadmd.c +++ b/src/kadmin/server/ovsec_kadmd.c @@ -246,6 +246,7 @@ int main(int argc, char *argv[]) kdb_log_context *log_ctx; + setlocale(LC_MESSAGES, ""); setvbuf(stderr, NULL, _IONBF, 0); /* This is OID value the Krb5_Name NameType */ diff --git a/src/kdc/main.c b/src/kdc/main.c index b2a52dd1a..e2446cdd0 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -953,6 +953,7 @@ int main(int argc, char **argv) int errout = 0; int i; + setlocale(LC_MESSAGES, ""); if (strrchr(argv[0], '/')) argv[0] = strrchr(argv[0], '/')+1; diff --git a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c index 022b94f80..6c81083fe 100644 --- a/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c +++ b/src/plugins/kdb/ldap/ldap_util/kdb5_ldap_util.c @@ -261,6 +261,7 @@ main(int argc, char *argv[]) /* * Ensure that "progname" is set before calling com_err. */ + setlocale(LC_MESSAGES, ""); progname = (strrchr(argv[0], '/') ? strrchr(argv[0], '/')+1 : argv[0]); retval = kadm5_init_krb5_context(&util_context); diff --git a/src/slave/kprop.c b/src/slave/kprop.c index 1aa78773b..f1b676fb8 100644 --- a/src/slave/kprop.c +++ b/src/slave/kprop.c @@ -96,6 +96,7 @@ main(argc, argv) krb5_creds *my_creds; krb5_auth_context auth_context; + setlocale(LC_MESSAGES, ""); retval = krb5_init_context(&context); if (retval) { com_err(argv[0], retval, _("while initializing krb5")); diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c index 58486bb28..259d63368 100644 --- a/src/slave/kpropd.c +++ b/src/slave/kpropd.c @@ -189,6 +189,7 @@ main(argc, argv) int ret = 0; kdb_log_context *log_ctx; + setlocale(LC_MESSAGES, ""); PRS(argv); log_ctx = kpropd_context->kdblog_context; diff --git a/src/slave/kproplog.c b/src/slave/kproplog.c index 0af30d92c..e8aac1e8e 100644 --- a/src/slave/kproplog.c +++ b/src/slave/kproplog.c @@ -495,7 +495,7 @@ main(int argc, char **argv) kdb_hlog_t *ulog = NULL; char **db_args = NULL; /* XXX */ - (void) setlocale(LC_ALL, ""); + setlocale(LC_MESSAGES, ""); #if !defined(TEXT_DOMAIN) #define TEXT_DOMAIN "SYS_TEST" -- 2.26.2