Bite the bullet and pass LC_ALL to setlocale() instead of just
LC_MESSAGES. Calls to setlocale() itself were introduced in
fabbf9e443459e8c0161c84563690ed70c7f6a61 for ticket 6918, but
only for LC_MESSAGES since only localized strings were needed
and that was the most conservative option.
However, klist, kadmin, and kinit (and perhaps others) would benefit
from localized formats for times (i.e., LC_TIME). If potentially
localized data is being sent on the wire, that is a bug that should
be fixed. No such bugs are found with the current test suite, so we
are comfortable enabling LC_ALL at this time.
ticket: 7192
int quiet = 0;
int all = 0;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
progname = GET_PROGNAME(argv[0]);
while ((c = getopt(argc, argv, "54Aqc:")) != -1) {
struct k5_data k5;
int authed_k5 = 0;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
progname = GET_PROGNAME(argv[0]);
/* Ensure we can be driven from a pipe */
char *name;
int mode;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
progname = GET_PROGNAME(argv[0]);
name = NULL;
int result_code;
krb5_data result_code_string, result_string;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
if (argc > 2) {
fprintf(stderr, _("usage: %s [principal]\n"), argv[0]);
exit(1);
const char *cache_name = NULL, *princ_name = NULL;
krb5_boolean errflag = FALSE;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
progname = GET_PROGNAME(argv[0]);
while ((c = getopt(argc, argv, "c:p:")) != -1) {
char *sname = NULL, *for_user = NULL;
int canon = 0, unknown = 0, proxy = 0;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
set_com_err_hook (extended_com_err_fn);
prog = strrchr(argv[0], '/');
krb5_error_code retval;
int sci_idx, code = 0;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
whoami = ((whoami = strrchr(argv[0], '/')) ? whoami+1 : argv[0]);
request = kadmin_startup(argc, argv);
int cmd_argc;
krb5_error_code retval;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
set_com_err_hook(extended_com_err_fn);
/*
krb5_error_code retval;
int sci_idx;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
retval = krb5_init_context(&kcontext);
if (retval) {
com_err(argv[0], retval, _("while initializing krb5"));
verto_ctx *ctx;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
setvbuf(stderr, NULL, _IONBF, 0);
/* This is OID value the Krb5_Name NameType */
KRB5_CLIENT_KTNAME=$K5ROOT/client_keytab; export KRB5_CLIENT_KTNAME
KRB5CCNAME=$K5ROOT/krb5cc_unit-test; export KRB5CCNAME
-# Make sure we don't get confused by translated messages.
-LC_MESSAGES=C; export LC_MESSAGES
+# Make sure we don't get confused by translated messages
+# or localized times.
+LC_ALL=C; export LC_ALL
if [ "$TEST_SERVER" != "" ]; then
MAKE_KEYTAB="$MAKE_KEYTAB -server $TEST_SERVER"
int errout = 0;
int i;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
if (strrchr(argv[0], '/'))
argv[0] = strrchr(argv[0], '/')+1;
/*
* Ensure that "progname" is set before calling com_err.
*/
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
progname = (strrchr(argv[0], '/') ? strrchr(argv[0], '/')+1 : argv[0]);
retval = kadm5_init_krb5_context(&util_context);
krb5_creds *my_creds;
krb5_auth_context auth_context;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
retval = krb5_init_context(&context);
if (retval) {
com_err(argv[0], retval, _("while initializing krb5"));
int ret = 0;
kdb_log_context *log_ctx;
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
PRS(argv);
log_ctx = kpropd_context->kdblog_context;
kdb_hlog_t *ulog = NULL;
char **db_args = NULL; /* XXX */
- setlocale(LC_MESSAGES, "");
+ setlocale(LC_ALL, "");
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
verbose "savelist $envvars_tosave"
lappend krb5_init_vars $i
}
- # Make sure we don't get confused by translated messages.
- lappend envvars_tosave "LC_MESSAGES"
- lappend krb5_init_vars "LC_MESSAGES=C"
+ # Make sure we don't get confused by translated messages
+ # or localized times.
+ lappend envvars_tosave "LC_ALL"
+ lappend krb5_init_vars "LC_ALL=C"
}
set envstackp 0
envstack_push
krb5_context context;
char *msg;
- setlocale(LC_MESSAGES, "C");
+ setlocale(LC_ALL, "C");
check(krb5_init_context(&context));
env[k] = os.path.join(buildtop, v)
else:
env[k] = v
- # Make sure we don't get confused by translated messages.
- env['LC_MESSAGES'] = 'C'
+ # Make sure we don't get confused by translated messages
+ # or localized times.
+ env['LC_ALL'] = 'C'
return env