diff options
author | Greg Hudson <ghudson@mit.edu> | 2011-06-10 18:17:37 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2011-06-10 18:17:37 +0000 |
commit | 16277050f158f062337d1d08258f9499dbc1cdc7 (patch) | |
tree | 713b2deadd3696c359e9b0051db9fa3de1d5a518 /src/clients | |
parent | cb8b1138d6e349a77507f3c561fc7ee2dde5cd7c (diff) | |
download | krb5-16277050f158f062337d1d08258f9499dbc1cdc7.tar.gz krb5-16277050f158f062337d1d08258f9499dbc1cdc7.tar.xz krb5-16277050f158f062337d1d08258f9499dbc1cdc7.zip |
Mark up strings for translation
ticket: 6918
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24961 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/clients')
-rw-r--r-- | src/clients/kdestroy/kdestroy.c | 24 | ||||
-rw-r--r-- | src/clients/kinit/kinit.c | 128 | ||||
-rw-r--r-- | src/clients/klist/klist.c | 109 | ||||
-rw-r--r-- | src/clients/kpasswd/kpasswd.c | 39 | ||||
-rw-r--r-- | src/clients/ksu/authorization.c | 21 | ||||
-rw-r--r-- | src/clients/ksu/ccache.c | 22 | ||||
-rw-r--r-- | src/clients/ksu/krb_auth_su.c | 73 | ||||
-rw-r--r-- | src/clients/ksu/main.c | 168 | ||||
-rw-r--r-- | src/clients/kvno/kvno.c | 62 |
9 files changed, 331 insertions, 315 deletions
diff --git a/src/clients/kdestroy/kdestroy.c b/src/clients/kdestroy/kdestroy.c index 7f4469acf7..fe5ecacf6b 100644 --- a/src/clients/kdestroy/kdestroy.c +++ b/src/clients/kdestroy/kdestroy.c @@ -24,7 +24,7 @@ * or implied warranty. */ -#include "autoconf.h" +#include "k5-platform.h" #include <krb5.h> #include <com_err.h> #include <string.h> @@ -55,9 +55,9 @@ static void usage() { #define KRB_AVAIL_STRING(x) ((x)?"available":"not available") - fprintf(stderr, "Usage: %s [-q] [-c cache_name]\n", progname); - fprintf(stderr, "\t-q quiet mode\n"); - fprintf(stderr, "\t-c specify name of credentials cache\n"); + fprintf(stderr, _("Usage: %s [-q] [-c cache_name]\n"), progname); + fprintf(stderr, _("\t-q quiet mode\n")); + fprintf(stderr, _("\t-c specify name of credentials cache\n")); exit(2); } @@ -84,14 +84,14 @@ main(argc, argv) break; case 'c': if (cache_name) { - fprintf(stderr, "Only one -c option allowed\n"); + fprintf(stderr, _("Only one -c option allowed\n")); errflg++; } else { cache_name = optarg; } break; case '4': - fprintf(stderr, "Kerberos 4 is no longer supported\n"); + fprintf(stderr, _("Kerberos 4 is no longer supported\n")); exit(3); break; case '5': @@ -112,32 +112,32 @@ main(argc, argv) retval = krb5_init_context(&kcontext); if (retval) { - com_err(progname, retval, "while initializing krb5"); + com_err(progname, retval, _("while initializing krb5")); exit(1); } if (cache_name) { code = krb5_cc_resolve (kcontext, cache_name, &cache); if (code != 0) { - com_err (progname, code, "while resolving %s", cache_name); + com_err(progname, code, _("while resolving %s"), cache_name); exit(1); } } else { code = krb5_cc_default(kcontext, &cache); if (code) { - com_err(progname, code, "while getting default ccache"); + com_err(progname, code, _("while getting default ccache")); exit(1); } } code = krb5_cc_destroy (kcontext, cache); if (code != 0) { - com_err (progname, code, "while destroying cache"); + com_err (progname, code, _("while destroying cache")); if (code != KRB5_FCC_NOFILE) { if (quiet) - fprintf(stderr, "Ticket cache NOT destroyed!\n"); + fprintf(stderr, _("Ticket cache NOT destroyed!\n")); else { - fprintf(stderr, "Ticket cache %cNOT%c destroyed!\n", + fprintf(stderr, _("Ticket cache %cNOT%c destroyed!\n"), BELL_CHAR, BELL_CHAR); } errflg = 1; diff --git a/src/clients/kinit/kinit.c b/src/clients/kinit/kinit.c index 292d6c3d18..682dc64704 100644 --- a/src/clients/kinit/kinit.c +++ b/src/clients/kinit/kinit.c @@ -205,27 +205,27 @@ usage() progname); fprintf(stderr, " options:"); - fprintf(stderr, "\t-V verbose\n"); - fprintf(stderr, "\t-l lifetime\n"); - fprintf(stderr, "\t-s start time\n"); - fprintf(stderr, "\t-r renewable lifetime\n"); - fprintf(stderr, "\t-f forwardable\n"); - fprintf(stderr, "\t-F not forwardable\n"); - fprintf(stderr, "\t-p proxiable\n"); - fprintf(stderr, "\t-P not proxiable\n"); - fprintf(stderr, "\t-n anonymous\n"); - fprintf(stderr, "\t-a include addresses\n"); - fprintf(stderr, "\t-A do not include addresses\n"); - fprintf(stderr, "\t-v validate\n"); - fprintf(stderr, "\t-R renew\n"); - fprintf(stderr, "\t-C canonicalize\n"); - fprintf(stderr, "\t-E client is enterprise principal name\n"); - fprintf(stderr, "\t-k use keytab\n"); - fprintf(stderr, "\t-t filename of keytab to use\n"); - fprintf(stderr, "\t-c Kerberos 5 cache name\n"); - fprintf(stderr, "\t-S service\n"); - fprintf(stderr, "\t-T armor credential cache\n"); - fprintf(stderr, "\t-X <attribute>[=<value>]\n"); + fprintf(stderr, _("\t-V verbose\n")); + fprintf(stderr, _("\t-l lifetime\n")); + fprintf(stderr, _("\t-s start time\n")); + fprintf(stderr, _("\t-r renewable lifetime\n")); + fprintf(stderr, _("\t-f forwardable\n")); + fprintf(stderr, _("\t-F not forwardable\n")); + fprintf(stderr, _("\t-p proxiable\n")); + fprintf(stderr, _("\t-P not proxiable\n")); + fprintf(stderr, _("\t-n anonymous\n")); + fprintf(stderr, _("\t-a include addresses\n")); + fprintf(stderr, _("\t-A do not include addresses\n")); + fprintf(stderr, _("\t-v validate\n")); + fprintf(stderr, _("\t-R renew\n")); + fprintf(stderr, _("\t-C canonicalize\n")); + fprintf(stderr, _("\t-E client is enterprise principal name\n")); + fprintf(stderr, _("\t-k use keytab\n")); + fprintf(stderr, _("\t-t filename of keytab to use\n")); + fprintf(stderr, _("\t-c Kerberos 5 cache name\n")); + fprintf(stderr, _("\t-S service\n")); + fprintf(stderr, _("\t-T armor credential cache\n")); + fprintf(stderr, _("\t-X <attribute>[=<value>]\n")); exit(2); } @@ -292,7 +292,7 @@ parse_options(argc, argv, opts) /* Lifetime */ code = krb5_string_to_deltat(optarg, &opts->lifetime); if (code != 0 || opts->lifetime == 0) { - fprintf(stderr, "Bad lifetime value %s\n", optarg); + fprintf(stderr, _("Bad lifetime value %s\n"), optarg); errflg++; } break; @@ -300,7 +300,7 @@ parse_options(argc, argv, opts) /* Renewable Time */ code = krb5_string_to_deltat(optarg, &opts->rlife); if (code != 0 || opts->rlife == 0) { - fprintf(stderr, "Bad lifetime value %s\n", optarg); + fprintf(stderr, _("Bad lifetime value %s\n"), optarg); errflg++; } break; @@ -332,7 +332,7 @@ parse_options(argc, argv, opts) code = krb5_string_to_timestamp(optarg, &abs_starttime); if (code != 0 || abs_starttime == 0) { - fprintf(stderr, "Bad start time value %s\n", optarg); + fprintf(stderr, _("Bad start time value %s\n"), optarg); errflg++; } else { opts->starttime = abs_starttime - time(0); @@ -348,7 +348,7 @@ parse_options(argc, argv, opts) case 't': if (opts->keytab_name) { - fprintf(stderr, "Only one -t option allowed.\n"); + fprintf(stderr, _("Only one -t option allowed.\n")); errflg++; } else { opts->keytab_name = optarg; @@ -356,7 +356,7 @@ parse_options(argc, argv, opts) break; case 'T': if (opts->armor_ccache) { - fprintf(stderr, "Only one armor_ccache\n"); + fprintf(stderr, _("Only one armor_ccache\n")); errflg++; } else opts->armor_ccache = optarg; break; @@ -369,7 +369,7 @@ parse_options(argc, argv, opts) case 'c': if (opts->k5_cache_name) { - fprintf(stderr, "Only one -c option allowed\n"); + fprintf(stderr, _("Only one -c option allowed\n")); errflg++; } else { opts->k5_cache_name = optarg; @@ -379,7 +379,7 @@ parse_options(argc, argv, opts) code = add_preauth_opt(opts, optarg); if (code) { - com_err(progname, code, "while adding preauth option"); + com_err(progname, code, _("while adding preauth option")); errflg++; } break; @@ -390,7 +390,7 @@ parse_options(argc, argv, opts) opts->enterprise = 1; break; case '4': - fprintf(stderr, "Kerberos 4 is no longer supported\n"); + fprintf(stderr, _("Kerberos 4 is no longer supported\n")); exit(3); break; case '5': @@ -403,22 +403,22 @@ parse_options(argc, argv, opts) if (opts->forwardable && opts->not_forwardable) { - fprintf(stderr, "Only one of -f and -F allowed\n"); + fprintf(stderr, _("Only one of -f and -F allowed\n")); errflg++; } if (opts->proxiable && opts->not_proxiable) { - fprintf(stderr, "Only one of -p and -P allowed\n"); + fprintf(stderr, _("Only one of -p and -P allowed\n")); errflg++; } if (opts->addresses && opts->no_addresses) { - fprintf(stderr, "Only one of -a and -A allowed\n"); + fprintf(stderr, _("Only one of -a and -A allowed\n")); errflg++; } if (argc - optind > 1) { - fprintf(stderr, "Extra arguments (starting with \"%s\").\n", + fprintf(stderr, _("Extra arguments (starting with \"%s\").\n"), argv[optind+1]); errflg++; } @@ -441,7 +441,7 @@ k5_begin(opts, k5) code = krb5_init_context(&k5->ctx); if (code) { - com_err(progname, code, "while initializing Kerberos 5 library"); + com_err(progname, code, _("while initializing Kerberos 5 library")); return 0; } errctx = k5->ctx; @@ -449,23 +449,23 @@ k5_begin(opts, k5) { code = krb5_cc_resolve(k5->ctx, opts->k5_cache_name, &k5->cc); if (code != 0) { - com_err(progname, code, "resolving ccache %s", + com_err(progname, code, _("resolving ccache %s"), opts->k5_cache_name); return 0; } if (opts->verbose) { - fprintf(stderr, "Using specified cache: %s\n", + fprintf(stderr, _("Using specified cache: %s\n"), opts->k5_cache_name); } } else { if ((code = krb5_cc_default(k5->ctx, &k5->cc))) { - com_err(progname, code, "while getting default ccache"); + com_err(progname, code, _("while getting default ccache")); return 0; } if (opts->verbose) { - fprintf(stderr, "Using default cache: %s\n", + fprintf(stderr, _("Using default cache: %s\n"), krb5_cc_get_name(k5->ctx, k5->cc)); } } @@ -475,7 +475,7 @@ k5_begin(opts, k5) /* Use specified name */ if ((code = krb5_parse_name_flags(k5->ctx, opts->principal_name, flags, &k5->me))) { - com_err(progname, code, "when parsing name %s", + com_err(progname, code, _("when parsing name %s"), opts->principal_name); return 0; } @@ -487,7 +487,7 @@ k5_begin(opts, k5) char *defrealm; code = krb5_get_default_realm(k5->ctx, &defrealm); if (code) { - com_err(progname, code, "while getting default realm"); + com_err(progname, code, _("while getting default realm")); return 0; } code = krb5_build_principal_ext(k5->ctx, &k5->me, @@ -499,7 +499,7 @@ k5_begin(opts, k5) 0); krb5_free_default_realm(k5->ctx, defrealm); if (code) { - com_err(progname, code, "while building principal"); + com_err(progname, code, _("while building principal")); return 0; } } else { @@ -509,17 +509,17 @@ k5_begin(opts, k5) KRB5_NT_SRV_HST, &k5->me); if (code) { com_err(progname, code, - "when creating default server principal name"); + _("when creating default server principal name")); return 0; } if (k5->me->realm.data[0] == 0) { code = krb5_unparse_name(k5->ctx, k5->me, &k5->name); if (code == 0) { com_err(progname, KRB5_ERR_HOST_REALM_UNKNOWN, - "(principal %s)", k5->name); + _("(principal %s)"), k5->name); } else { com_err(progname, KRB5_ERR_HOST_REALM_UNKNOWN, - "for local services"); + _("for local services")); } return 0; } @@ -530,12 +530,12 @@ k5_begin(opts, k5) if (code) { char *name = get_name_from_os(); if (!name) { - fprintf(stderr, "Unable to identify user\n"); + fprintf(stderr, _("Unable to identify user\n")); return 0; } if ((code = krb5_parse_name_flags(k5->ctx, name, flags, &k5->me))) { - com_err(progname, code, "when parsing name %s", + com_err(progname, code, _("when parsing name %s"), name); return 0; } @@ -546,11 +546,11 @@ k5_begin(opts, k5) code = krb5_unparse_name(k5->ctx, k5->me, &k5->name); if (code) { - com_err(progname, code, "when unparsing name"); + com_err(progname, code, _("when unparsing name")); return 0; } if (opts->verbose) - fprintf(stderr, "Using principal: %s\n", k5->name); + fprintf(stderr, _("Using principal: %s\n"), k5->name); opts->principal_name = k5->name; @@ -633,7 +633,7 @@ k5_kinit(opts, k5) krb5_address **addresses = NULL; code = krb5_os_localaddr(k5->ctx, &addresses); if (code != 0) { - com_err(progname, code, "getting local addresses"); + com_err(progname, code, _("getting local addresses")); goto cleanup; } krb5_get_init_creds_opt_set_address_list(options, addresses); @@ -652,7 +652,7 @@ k5_kinit(opts, k5) krb5_princ_realm(k5->ctx, k5->me)->data); if (code != 0) { com_err(progname, code, - "while setting up KDB keytab for realm %s", + _("while setting up KDB keytab for realm %s"), krb5_princ_realm(k5->ctx, k5->me)->data); goto cleanup; } @@ -661,12 +661,12 @@ k5_kinit(opts, k5) code = krb5_kt_resolve(k5->ctx, opts->keytab_name, &keytab); if (code != 0) { - com_err(progname, code, "resolving keytab %s", + com_err(progname, code, _("resolving keytab %s"), opts->keytab_name); goto cleanup; } if (opts->verbose) - fprintf(stderr, "Using keytab: %s\n", opts->keytab_name); + fprintf(stderr, _("Using keytab: %s\n"), opts->keytab_name); } for (i = 0; i < opts->num_pa_opts; i++) { @@ -674,12 +674,12 @@ k5_kinit(opts, k5) opts->pa_opts[i].attr, opts->pa_opts[i].value); if (code != 0) { - com_err(progname, code, "while setting '%s'='%s'", + com_err(progname, code, _("while setting '%s'='%s'"), opts->pa_opts[i].attr, opts->pa_opts[i].value); goto cleanup; } if (opts->verbose) { - fprintf(stderr, "PA Option %s = %s\n", opts->pa_opts[i].attr, + fprintf(stderr, _("PA Option %s = %s\n"), opts->pa_opts[i].attr, opts->pa_opts[i].value); } } @@ -717,21 +717,21 @@ k5_kinit(opts, k5) switch (opts->action) { case INIT_PW: case INIT_KT: - doing = "getting initial credentials"; + doing = _("getting initial credentials"); break; case VALIDATE: - doing = "validating credentials"; + doing = _("validating credentials"); break; case RENEW: - doing = "renewing credentials"; + doing = _("renewing credentials"); break; } if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) - fprintf(stderr, "%s: Password incorrect while %s\n", progname, + fprintf(stderr, _("%s: Password incorrect while %s\n"), progname, doing); else - com_err(progname, code, "while %s", doing); + com_err(progname, code, _("while %s"), doing); goto cleanup; } @@ -739,20 +739,20 @@ k5_kinit(opts, k5) code = krb5_cc_initialize(k5->ctx, k5->cc, opts->canonicalize ? my_creds.client : k5->me); if (code) { - com_err(progname, code, "when initializing cache %s", + com_err(progname, code, _("when initializing cache %s"), opts->k5_cache_name?opts->k5_cache_name:""); goto cleanup; } if (opts->verbose) - fprintf(stderr, "Initialized cache\n"); + fprintf(stderr, _("Initialized cache\n")); code = krb5_cc_store_cred(k5->ctx, k5->cc, &my_creds); if (code) { - com_err(progname, code, "while storing credentials"); + com_err(progname, code, _("while storing credentials")); goto cleanup; } if (opts->verbose) - fprintf(stderr, "Stored credentials\n"); + fprintf(stderr, _("Stored credentials\n")); } notix = 0; @@ -805,7 +805,7 @@ main(argc, argv) authed_k5 = k5_kinit(&opts, &k5); if (authed_k5 && opts.verbose) - fprintf(stderr, "Authenticated to Kerberos v5\n"); + fprintf(stderr, _("Authenticated to Kerberos v5\n")); k5_end(&k5); diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c index 3d34aedd8a..1ecc5f8d81 100644 --- a/src/clients/klist/klist.c +++ b/src/clients/klist/klist.c @@ -79,22 +79,24 @@ static void usage() { #define KRB_AVAIL_STRING(x) ((x)?"available":"not available") - fprintf(stderr, "Usage: %s [-e] [-V] [[-c] [-d] [-f] [-s] [-a [-n]]] %s", - progname, "[-k [-t] [-K]] [name]\n"); - fprintf(stderr, "\t-c specifies credentials cache\n"); - fprintf(stderr, "\t-k specifies keytab\n"); - fprintf(stderr, "\t (Default is credentials cache)\n"); - fprintf(stderr, "\t-e shows the encryption type\n"); - fprintf(stderr, "\t-V shows the Kerberos version and exits\n"); - fprintf(stderr, "\toptions for credential caches:\n"); - fprintf(stderr, "\t\t-d shows the submitted authorization data types\n"); - fprintf(stderr, "\t\t-f shows credentials flags\n"); - fprintf(stderr, "\t\t-s sets exit status based on valid tgt existence\n"); - fprintf(stderr, "\t\t-a displays the address list\n"); - fprintf(stderr, "\t\t\t-n do not reverse-resolve\n"); - fprintf(stderr, "\toptions for keytabs:\n"); - fprintf(stderr, "\t\t-t shows keytab entry timestamps\n"); - fprintf(stderr, "\t\t-K shows keytab entry DES keys\n"); + fprintf(stderr, _("Usage: %s [-e] [-V] [[-c] [-d] [-f] [-s] [-a [-n]]] " + "[-k [-t] [-K]] [name]\n"), progname); + fprintf(stderr, _("\t-c specifies credentials cache\n")); + fprintf(stderr, _("\t-k specifies keytab\n")); + fprintf(stderr, _("\t (Default is credentials cache)\n")); + fprintf(stderr, _("\t-e shows the encryption type\n")); + fprintf(stderr, _("\t-V shows the Kerberos version and exits\n")); + fprintf(stderr, _("\toptions for credential caches:\n")); + fprintf(stderr, _("\t\t-d shows the submitted authorization data " + "types\n")); + fprintf(stderr, _("\t\t-f shows credentials flags\n")); + fprintf(stderr, _("\t\t-s sets exit status based on valid tgt " + "existence\n")); + fprintf(stderr, _("\t\t-a displays the address list\n")); + fprintf(stderr, _("\t\t\t-n do not reverse-resolve\n")); + fprintf(stderr, _("\toptions for keytabs:\n")); + fprintf(stderr, _("\t\t-t shows keytab entry timestamps\n")); + fprintf(stderr, _("\t\t-K shows keytab entry DES keys\n")); exit(1); } @@ -147,7 +149,7 @@ main(argc, argv) mode = KEYTAB; break; case '4': - fprintf(stderr, "Kerberos 4 is no longer supported\n"); + fprintf(stderr, _("Kerberos 4 is no longer supported\n")); exit(3); break; case '5': @@ -174,7 +176,7 @@ main(argc, argv) } if (argc - optind > 1) { - fprintf(stderr, "Extra arguments (starting with \"%s\").\n", + fprintf(stderr, _("Extra arguments (starting with \"%s\").\n"), argv[optind+1]); usage(); } @@ -183,7 +185,7 @@ main(argc, argv) #ifdef _WIN32 /* No access to autoconf vars; fix somehow. */ printf("Kerberos for Windows\n"); #else - printf("%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION); + printf(_("%s version %s\n"), PACKAGE_NAME, PACKAGE_VERSION); #endif exit(0); } @@ -206,7 +208,7 @@ main(argc, argv) krb5_error_code retval; retval = krb5_init_context(&kcontext); if (retval) { - com_err(progname, retval, "while initializing krb5"); + com_err(progname, retval, _("while initializing krb5")); exit(1); } @@ -231,29 +233,29 @@ void do_keytab(name) if (name == NULL) { if ((code = krb5_kt_default(kcontext, &kt))) { - com_err(progname, code, "while getting default keytab"); + com_err(progname, code, _("while getting default keytab")); exit(1); } } else { if ((code = krb5_kt_resolve(kcontext, name, &kt))) { - com_err(progname, code, "while resolving keytab %s", - name); + com_err(progname, code, _("while resolving keytab %s"), name); exit(1); } } if ((code = krb5_kt_get_name(kcontext, kt, buf, BUFSIZ))) { - com_err(progname, code, "while getting keytab name"); + com_err(progname, code, _("while getting keytab name")); exit(1); } printf("Keytab name: %s\n", buf); if ((code = krb5_kt_start_seq_get(kcontext, kt, &cursor))) { - com_err(progname, code, "while starting keytab scan"); + com_err(progname, code, _("while starting keytab scan")); exit(1); } + /* XXX Translating would disturb table alignment; skip for now. */ if (show_time) { printf("KVNO Timestamp"); fillit(stdout, timestamp_width - sizeof("Timestamp") + 2, (int) ' '); @@ -270,7 +272,7 @@ void do_keytab(name) while ((code = krb5_kt_next_entry(kcontext, kt, &entry, &cursor)) == 0) { if ((code = krb5_unparse_name(kcontext, entry.principal, &pname))) { - com_err(progname, code, "while unparsing principal name"); + com_err(progname, code, _("while unparsing principal name")); exit(1); } printf("%4d ", entry.vno); @@ -294,11 +296,11 @@ void do_keytab(name) krb5_free_unparsed_name(kcontext, pname); } if (code && code != KRB5_KT_END) { - com_err(progname, code, "while scanning keytab"); + com_err(progname, code, _("while scanning keytab")); exit(1); } if ((code = krb5_kt_end_seq_get(kcontext, kt, &cursor))) { - com_err(progname, code, "while ending keytab scan"); + com_err(progname, code, _("while ending keytab scan")); exit(1); } exit(0); @@ -321,13 +323,13 @@ void do_ccache(name) if (name == NULL) { if ((code = krb5_cc_default(kcontext, &cache))) { if (!status_only) - com_err(progname, code, "while getting default ccache"); + com_err(progname, code, _("while getting default ccache")); exit(1); } } else { if ((code = krb5_cc_resolve(kcontext, name, &cache))) { if (!status_only) - com_err(progname, code, "while resolving ccache %s", + com_err(progname, code, _("while resolving ccache %s"), name); exit(1); } @@ -337,7 +339,7 @@ void do_ccache(name) if ((code = krb5_cc_set_flags(kcontext, cache, flags))) { if (code == KRB5_FCC_NOFILE) { if (!status_only) { - com_err(progname, code, "(ticket cache %s:%s)", + com_err(progname, code, _("(ticket cache %s:%s)"), krb5_cc_get_type(kcontext, cache), krb5_cc_get_name(kcontext, cache)); #ifdef KRB5_KRB4_COMPAT @@ -348,7 +350,7 @@ void do_ccache(name) } else { if (!status_only) com_err(progname, code, - "while setting cache flags (ticket cache %s:%s)", + _("while setting cache flags (ticket cache %s:%s)"), krb5_cc_get_type(kcontext, cache), krb5_cc_get_name(kcontext, cache)); } @@ -356,18 +358,19 @@ void do_ccache(name) } if ((code = krb5_cc_get_principal(kcontext, cache, &princ))) { if (!status_only) - com_err(progname, code, "while retrieving principal name"); + com_err(progname, code, _("while retrieving principal name")); exit(1); } if ((code = krb5_unparse_name(kcontext, princ, &defname))) { if (!status_only) - com_err(progname, code, "while unparsing principal name"); + com_err(progname, code, _("while unparsing principal name")); exit(1); } if (!status_only) { - printf("Ticket cache: %s:%s\nDefault principal: %s\n\n", + printf(_("Ticket cache: %s:%s\nDefault principal: %s\n\n"), krb5_cc_get_type(kcontext, cache), krb5_cc_get_name(kcontext, cache), defname); + /* XXX Translating would disturb table alignment; skip for now. */ fputs("Valid starting", stdout); fillit(stdout, timestamp_width - sizeof("Valid starting") + 3, (int) ' '); @@ -378,7 +381,7 @@ void do_ccache(name) } if ((code = krb5_cc_start_seq_get(kcontext, cache, &cur))) { if (!status_only) - com_err(progname, code, "while starting to retrieve tickets"); + com_err(progname, code, _("while starting to retrieve tickets")); exit(1); } while (!(code = krb5_cc_next_cred(kcontext, cache, &cur, &creds))) { @@ -399,13 +402,13 @@ void do_ccache(name) if (code == KRB5_CC_END) { if ((code = krb5_cc_end_seq_get(kcontext, cache, &cur))) { if (!status_only) - com_err(progname, code, "while finishing ticket retrieval"); + com_err(progname, code, _("while finishing ticket retrieval")); exit(1); } flags = KRB5_TC_OPENCLOSE; /* turns on OPENCLOSE mode */ if ((code = krb5_cc_set_flags(kcontext, cache, flags))) { if (!status_only) - com_err(progname, code, "while closing ccache"); + com_err(progname, code, _("while closing ccache")); exit(1); } #ifdef KRB5_KRB4_COMPAT @@ -415,7 +418,7 @@ void do_ccache(name) exit(exit_status); } else { if (!status_only) - com_err(progname, code, "while retrieving a ticket"); + com_err(progname, code, _("while retrieving a ticket")); exit(1); } } @@ -501,12 +504,12 @@ show_credential(cred) retval = krb5_unparse_name(kcontext, cred->client, &name); if (retval) { - com_err(progname, retval, "while unparsing client name"); + com_err(progname, retval, _("while unparsing client name")); return; } retval = krb5_unparse_name(kcontext, cred->server, &sname); if (retval) { - com_err(progname, retval, "while unparsing server name"); + com_err(progname, retval, _("while unparsing server name")); krb5_free_unparsed_name(kcontext, name); return; } @@ -521,7 +524,7 @@ show_credential(cred) printf("%s\n", sname); if (strcmp(name, defname)) { - printf("\tfor client %s", name); + printf(_("\tfor client %s"), name); extra_field++; } @@ -530,7 +533,7 @@ show_credential(cred) fputs("\t",stdout); else fputs(", ",stdout); - fputs("renew until ", stdout); + fputs(_("renew until "), stdout); printtime(cred->times.renew_till); extra_field += 2; } @@ -547,7 +550,7 @@ show_credential(cred) fputs("\t",stdout); else fputs(", ",stdout); - printf("Flags: %s", flags); + printf(_("Flags: %s"), flags); extra_field++; } } @@ -566,7 +569,7 @@ show_credential(cred) fputs("\t",stdout); else fputs(", ",stdout); - printf("Etype (skey, tkt): %s, ", + printf(_("Etype (skey, tkt): %s, "), etype_string(cred->keyblock.enctype)); printf("%s ", etype_string(tkt->enc_part.enctype)); @@ -585,7 +588,7 @@ show_credential(cred) fputs("\t",stdout); else fputs(", ",stdout); - printf("AD types: "); + printf(_("AD types: ")); for (i = 0; cred->authdata[i] != NULL; i++) { if (i) printf(", "); @@ -602,11 +605,11 @@ show_credential(cred) if (show_addresses) { if (!cred->addresses || !cred->addresses[0]) { - printf("\tAddresses: (none)\n"); + printf(_("\tAddresses: (none)\n")); } else { int i; - printf("\tAddresses: "); + printf(_("\tAddresses: ")); one_addr(cred->addresses[0]); for (i=1; cred->addresses[i]; i++) { @@ -639,8 +642,8 @@ void one_addr(a) case ADDRTYPE_INET: if (a->length != 4) { broken: - printf ("broken address (type %d length %d)", - a->addrtype, a->length); + printf(_("broken address (type %d length %d)"), + a->addrtype, a->length); return; } { @@ -667,7 +670,7 @@ void one_addr(a) break; #endif default: - printf ("unknown addrtype %d", a->addrtype); + printf(_("unknown addrtype %d"), a->addrtype); return; } @@ -676,8 +679,8 @@ void one_addr(a) namebuf, sizeof (namebuf), 0, 0, no_resolve ? NI_NUMERICHOST : 0U); if (err) { - printf ("unprintable address (type %d, error %d %s)", a->addrtype, err, - gai_strerror (err)); + printf(_("unprintable address (type %d, error %d %s)"), a->addrtype, + err, gai_strerror (err)); return; } printf ("%s", namebuf); diff --git a/src/clients/kpasswd/kpasswd.c b/src/clients/kpasswd/kpasswd.c index 3a50aba31e..27325cc6df 100644 --- a/src/clients/kpasswd/kpasswd.c +++ b/src/clients/kpasswd/kpasswd.c @@ -1,7 +1,7 @@ /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ #include <stdio.h> #include <sys/types.h> -#include "autoconf.h" +#include "k5-platform.h" #ifndef _WIN32 #include <unistd.h> @@ -9,8 +9,8 @@ #include <krb5.h> -#define P1 "Enter new password" -#define P2 "Enter it again" +#define P1 _("Enter new password") +#define P2 _("Enter it again") #ifdef HAVE_PWD_H #include <pwd.h> @@ -25,11 +25,12 @@ void get_name_from_passwd_file(program_name, kcontext, me) krb5_error_code code; if ((pw = getpwuid(getuid()))) { if ((code = krb5_parse_name(kcontext, pw->pw_name, me))) { - com_err (program_name, code, "when parsing name %s", pw->pw_name); + com_err(program_name, code, _("when parsing name %s"), + pw->pw_name); exit(1); } } else { - fprintf(stderr, "Unable to identify user from password file\n"); + fprintf(stderr, _("Unable to identify user from password file\n")); exit(1); } } @@ -38,7 +39,7 @@ void get_name_from_passwd_file(kcontext, me) krb5_context kcontext; krb5_principal * me; { - fprintf(stderr, "Unable to identify user\n"); + fprintf(stderr, _("Unable to identify user\n")); exit(1); } #endif /* HAVE_PWD_H */ @@ -59,7 +60,7 @@ int main(int argc, char *argv[]) krb5_data result_code_string, result_string; if (argc > 2) { - fprintf(stderr, "usage: %s [principal]\n", argv[0]); + fprintf(stderr, _("usage: %s [principal]\n"), argv[0]); exit(1); } @@ -67,11 +68,11 @@ int main(int argc, char *argv[]) ret = krb5_init_context(&context); if (ret) { - com_err(argv[0], ret, "initializing kerberos library"); + com_err(argv[0], ret, _("initializing kerberos library")); exit(1); } if ((ret = krb5_get_init_creds_opt_alloc(context, &opts))) { - com_err(argv[0], ret, "allocating krb5_get_init_creds_opt"); + com_err(argv[0], ret, _("allocating krb5_get_init_creds_opt")); exit(1); } @@ -86,33 +87,33 @@ int main(int argc, char *argv[]) */ ret = krb5_cc_default(context, &ccache); if (ret != 0) { - com_err(argv[0], ret, "opening default ccache"); + com_err(argv[0], ret, _("opening default ccache")); exit(1); } ret = krb5_cc_get_principal(context, ccache, &princ); if (ret != 0 && ret != KRB5_CC_NOTFOUND && ret != KRB5_FCC_NOFILE) { - com_err(argv[0], ret, "getting principal from ccache"); + com_err(argv[0], ret, _("getting principal from ccache")); exit(1); } else { if (princ != NULL) { ret = krb5_get_init_creds_opt_set_fast_ccache(context, opts, ccache); if (ret) { - com_err(argv[0], ret, "while setting FAST ccache"); + com_err(argv[0], ret, _("while setting FAST ccache")); exit(1); } } } ret = krb5_cc_close(context, ccache); if (ret != 0) { - com_err(argv[0], ret, "closing ccache"); + com_err(argv[0], ret, _("closing ccache")); exit(1); } if (pname) { krb5_free_principal(context, princ); princ = NULL; if ((ret = krb5_parse_name(context, pname, &princ))) { - com_err(argv[0], ret, "parsing client name"); + com_err(argv[0], ret, _("parsing client name")); exit(1); } } @@ -129,16 +130,16 @@ int main(int argc, char *argv[]) 0, "kadmin/changepw", opts))) { if (ret == KRB5KRB_AP_ERR_BAD_INTEGRITY) com_err(argv[0], 0, - "Password incorrect while getting initial ticket"); + _("Password incorrect while getting initial ticket")); else - com_err(argv[0], ret, "getting initial ticket"); + com_err(argv[0], ret, _("getting initial ticket")); krb5_get_init_creds_opt_free(context, opts); exit(1); } pwlen = sizeof(pw); if ((ret = krb5_read_password(context, P1, P2, pw, &pwlen))) { - com_err(argv[0], ret, "while reading password"); + com_err(argv[0], ret, _("while reading password")); krb5_get_init_creds_opt_free(context, opts); exit(1); } @@ -146,7 +147,7 @@ int main(int argc, char *argv[]) if ((ret = krb5_change_password(context, &creds, pw, &result_code, &result_code_string, &result_string))) { - com_err(argv[0], ret, "changing password"); + com_err(argv[0], ret, _("changing password")); krb5_get_init_creds_opt_free(context, opts); exit(1); } @@ -167,6 +168,6 @@ int main(int argc, char *argv[]) free(result_code_string.data); krb5_get_init_creds_opt_free(context, opts); - printf("Password changed.\n"); + printf(_("Password changed.\n")); exit(0); } diff --git a/src/clients/ksu/authorization.c b/src/clients/ksu/authorization.c index fcc5ca99d9..f1cc8acd10 100644 --- a/src/clients/ksu/authorization.c +++ b/src/clients/ksu/authorization.c @@ -366,13 +366,17 @@ krb5_boolean fcmd_resolve(fcmd, out_fcmd, out_err) }else{ /* must be either full path or just the cmd name */ if (strchr(fcmd, '/')){ - asprintf(&err,"Error: bad entry - %s in %s file, must be either full path or just the cmd name\n", fcmd, KRB5_USERS_NAME); + asprintf(&err, _("Error: bad entry - %s in %s file, must be " + "either full path or just the cmd name\n"), + fcmd, KRB5_USERS_NAME); *out_err = err; return FALSE; } #ifndef CMD_PATH - asprintf(&err,"Error: bad entry - %s in %s file, since %s is just the cmd name, CMD_PATH must be defined \n", fcmd, KRB5_USERS_NAME, fcmd); + asprintf(&err, _("Error: bad entry - %s in %s file, since %s is just " + "the cmd name, CMD_PATH must be defined \n"), + fcmd, KRB5_USERS_NAME, fcmd); *out_err = err; return FALSE; #else @@ -385,7 +389,8 @@ krb5_boolean fcmd_resolve(fcmd, out_fcmd, out_err) tc = get_first_token (path_ptr, &lp); if (! tc){ - asprintf(&err,"Error: bad entry - %s in %s file, CMD_PATH contains no paths \n", fcmd, KRB5_USERS_NAME); + asprintf(&err, _("Error: bad entry - %s in %s file, CMD_PATH " + "contains no paths \n"), fcmd, KRB5_USERS_NAME); *out_err = err; return FALSE; } @@ -393,7 +398,8 @@ krb5_boolean fcmd_resolve(fcmd, out_fcmd, out_err) i=0; do{ if (*tc != '/'){ /* must be full path */ - asprintf(&err,"Error: bad path %s in CMD_PATH for %s must start with '/' \n",tc, KRB5_USERS_NAME ); + asprintf(&err, _("Error: bad path %s in CMD_PATH for %s must " + "start with '/' \n"), tc, KRB5_USERS_NAME ); *out_err = err; return FALSE; } @@ -508,7 +514,7 @@ krb5_boolean find_first_cmd_that_exists(fcmd_arr, cmd_out, err_out) if (retbool == FALSE ){ krb5int_buf_init_dynamic(&buf); - krb5int_buf_add(&buf, "Error: not found -> "); + krb5int_buf_add(&buf, _("Error: not found -> ")); for(j= 0; j < i; j ++) krb5int_buf_add_fmt(&buf, " %s ", fcmd_arr[j]); krb5int_buf_add(&buf, "\n"); @@ -714,9 +720,8 @@ void init_auth_names(pw_dir) pw_dir, sep, KRB5_USERS_NAME); if (SNPRINTF_OVERFLOW(r1, sizeof(k5login_path)) || SNPRINTF_OVERFLOW(r2, sizeof(k5users_path))) { - fprintf (stderr, - "home directory name `%s' too long, can't search for .k5login\n", - pw_dir); + fprintf(stderr, _("home directory name `%s' too long, can't search " + "for .k5login\n"), pw_dir); exit (1); } } diff --git a/src/clients/ksu/ccache.c b/src/clients/ksu/ccache.c index 5192623512..9916c75f30 100644 --- a/src/clients/ksu/ccache.c +++ b/src/clients/ksu/ccache.c @@ -70,8 +70,7 @@ krb5_error_code krb5_ccache_copy (context, cc_def, cc_other_tag, cc_other = (krb5_ccache *) xcalloc(1, sizeof (krb5_ccache)); if ((retval = krb5_cc_resolve(context, cc_other_tag, cc_other))){ - com_err (prog_name, retval, "resolving ccache %s", - cc_other_tag); + com_err(prog_name, retval, _("resolving ccache %s"), cc_other_tag); return retval; } @@ -382,7 +381,7 @@ krb5_get_login_princ(luser, princ_list) } result = snprintf(pbuf, sizeof(pbuf), "%s/.k5login", pwd->pw_dir); if (SNPRINTF_OVERFLOW(result, sizeof(pbuf))) { - fprintf (stderr, "home directory path for %s too long\n", luser); + fprintf(stderr, _("home directory path for %s too long\n"), luser); exit (1); } @@ -464,22 +463,22 @@ show_credential(context, cred, cc) retval = krb5_unparse_name(context, cred->client, &name); if (retval) { - com_err(prog_name, retval, "while unparsing client name"); + com_err(prog_name, retval, _("while unparsing client name")); return; } retval = krb5_unparse_name(context, cred->server, &sname); if (retval) { - com_err(prog_name, retval, "while unparsing server name"); + com_err(prog_name, retval, _("while unparsing server name")); free(name); return; } if ((retval = krb5_cc_get_principal(context, cc, &princ))) { - com_err(prog_name, retval, "while retrieving principal name"); + com_err(prog_name, retval, _("while retrieving principal name")); return; } if ((retval = krb5_unparse_name(context, princ, &defname))) { - com_err(prog_name, retval, "while unparsing principal name"); + com_err(prog_name, retval, _("while unparsing principal name")); return; } @@ -494,7 +493,7 @@ show_credential(context, cred, cc) printf("%s\n", sname); if (strcmp(name, defname)) { - printf("\tfor client %s", name); + printf(_("\tfor client %s"), name); first = 0; } @@ -503,7 +502,7 @@ show_credential(context, cred, cc) fputs("\t",stdout); else fputs(", ",stdout); - fputs("renew until ", stdout); + fputs(_("renew until "), stdout); printtime(cred->times.renew_till); } if (show_flags) { @@ -513,7 +512,7 @@ show_credential(context, cred, cc) fputs("\t",stdout); else fputs(", ",stdout); - printf("Flags: %s", flags); + printf(_("Flags: %s"), flags); first = 0; } } @@ -660,8 +659,7 @@ krb5_error_code krb5_ccache_copy_restricted (context, cc_def, cc_other_tag, cc_other = (krb5_ccache *) xcalloc(1, sizeof (krb5_ccache)); if ((retval = krb5_cc_resolve(context, cc_other_tag, cc_other))){ - com_err (prog_name, retval, "resolving ccache %s", - cc_other_tag); + com_err(prog_name, retval, _("resolving ccache %s"), cc_other_tag); return retval; } diff --git a/src/clients/ksu/krb_auth_su.c b/src/clients/ksu/krb_auth_su.c index b919c39b20..eb597aa268 100644 --- a/src/clients/ksu/krb_auth_su.c +++ b/src/clients/ksu/krb_auth_su.c @@ -63,7 +63,7 @@ krb5_boolean krb5_auth_check(context, client_pname, hostname, options, if ((retval= krb5_copy_principal(context, client_pname, &client))){ - com_err(prog_name, retval,"while copying client principal"); + com_err(prog_name, retval, _("while copying client principal")); return (FALSE) ; } @@ -75,7 +75,7 @@ krb5_boolean krb5_auth_check(context, client_pname, hostname, options, if ((retval = krb5_sname_to_principal(context, hostname, NULL, KRB5_NT_SRV_HST, &server))){ com_err(prog_name, retval, - "while creating server %s principal name", hostname); + _("while creating server %s principal name"), hostname); krb5_free_principal(context, client); return (FALSE) ; } @@ -100,14 +100,14 @@ krb5_boolean krb5_auth_check(context, client_pname, hostname, options, /* check to see if the local tgt is in the cache */ if ((retval= krb5_copy_principal(context, client, &tgtq.client))){ - com_err(prog_name, retval,"while copying client principal"); + com_err(prog_name, retval, _("while copying client principal")); return (FALSE) ; } if ((retval = ksu_tgtname(context, krb5_princ_realm(context, client), krb5_princ_realm(context, client), &tgtq.server))){ - com_err(prog_name, retval, "while creating tgt for local realm"); + com_err(prog_name, retval, _("while creating tgt for local realm")); krb5_free_principal(context, client); krb5_free_principal(context, server); return (FALSE) ; @@ -123,8 +123,7 @@ krb5_boolean krb5_auth_check(context, client_pname, hostname, options, if (retval){ if ((retval != KRB5_CC_NOTFOUND) && (retval != KRB5KRB_AP_ERR_TKT_EXPIRED)){ - com_err(prog_name, retval, - "while retrieving creds from cache"); + com_err(prog_name, retval, _("while retrieving creds from cache")); return (FALSE) ; } } else{ @@ -135,13 +134,15 @@ krb5_boolean krb5_auth_check(context, client_pname, hostname, options, #ifdef GET_TGT_VIA_PASSWD if (krb5_seteuid(0)||krb5_seteuid(target_uid)) { - com_err("ksu", errno, "while switching to target uid"); + com_err("ksu", errno, _("while switching to target uid")); return FALSE; } - fprintf(stderr,"WARNING: Your password may be exposed if you enter it here and are logged \n"); - fprintf(stderr," in remotely using an unsecure (non-encrypted) channel. \n"); + fprintf(stderr, _("WARNING: Your password may be exposed if you enter " + "it here and are logged \n")); + fprintf(stderr, _(" in remotely using an unsecure " + "(non-encrypted) channel. \n")); /*get the ticket granting ticket, via passwd(promt for passwd)*/ if (krb5_get_tkt_via_passwd (context, &cc, client, tgtq.server, @@ -152,13 +153,14 @@ krb5_boolean krb5_auth_check(context, client_pname, hostname, options, } *path_passwd = 1; if (krb5_seteuid(0)) { - com_err("ksu", errno, "while reclaiming root uid"); + com_err("ksu", errno, _("while reclaiming root uid")); return FALSE; } #else plain_dump_principal (context, client); - fprintf(stderr,"does not have any appropriate tickets in the cache.\n"); + fprintf(stderr, + _("does not have any appropriate tickets in the cache.\n")); return FALSE; #endif /* GET_TGT_VIA_PASSWD */ @@ -166,18 +168,18 @@ krb5_boolean krb5_auth_check(context, client_pname, hostname, options, } if ((retval= krb5_copy_principal(context, client, &in_creds.client))){ - com_err(prog_name, retval,"while copying client principal"); + com_err(prog_name, retval, _("while copying client principal")); return (FALSE) ; } if ((retval= krb5_copy_principal(context, server, &in_creds.server))){ - com_err(prog_name, retval,"while copying client principal"); + com_err(prog_name, retval, _("while copying client principal")); return (FALSE) ; } if ((retval = krb5_get_credentials(context, 0, cc, &in_creds, &out_creds))){ - com_err(prog_name, retval, "while getting credentials from kdc"); + com_err(prog_name, retval, _("while getting credentials from kdc")); return (FALSE); } @@ -194,7 +196,7 @@ krb5_boolean krb5_auth_check(context, client_pname, hostname, options, NULL /*output ccache*/, &vfy_opts); if (retval) { - com_err(prog_name, retval, "while verifying ticket for server"); + com_err(prog_name, retval, _("while verifying ticket for server")); return (FALSE); } @@ -220,12 +222,12 @@ krb5_boolean krb5_fast_auth(context, client, server, target_user, cc) memset(&tgt, 0, sizeof(tgt)); if ((retval= krb5_copy_principal(context, client, &tgtq.client))){ - com_err(prog_name, retval,"while copying client principal"); + com_err(prog_name, retval, _("while copying client principal")); return (FALSE) ; } if ((retval= krb5_copy_principal(context, server, &tgtq.server))){ - com_err(prog_name, retval,"while copying client principal"); + com_err(prog_name, retval, _("while copying client principal")); return (FALSE) ; } @@ -233,7 +235,7 @@ krb5_boolean krb5_fast_auth(context, client, server, target_user, cc) KRB5_TC_MATCH_SRV_NAMEONLY | KRB5_TC_SUPPORTED_KTYPES, &tgtq, &tgt))){ if (auth_debug) - com_err(prog_name, retval,"While Retrieving credentials"); + com_err(prog_name, retval, _("while Retrieving credentials")); return (FALSE) ; } @@ -243,7 +245,7 @@ krb5_boolean krb5_fast_auth(context, client, server, target_user, cc) NULL /*output ccache*/, &vfy_opts); if (retval){ - com_err(prog_name, retval, "while verifing ticket for server"); + com_err(prog_name, retval, _("while verifying ticket for server")); return (FALSE); } @@ -271,24 +273,24 @@ krb5_boolean krb5_get_tkt_via_passwd (context, ccache, client, server, *zero_password = FALSE; if ((code = krb5_unparse_name(context, client, &client_name))) { - com_err (prog_name, code, "when unparsing name"); + com_err (prog_name, code, _("when unparsing name")); return (FALSE); } memset(&my_creds, 0, sizeof(my_creds)); if ((code = krb5_copy_principal(context, client, &my_creds.client))){ - com_err (prog_name, code, "while copying principal"); + com_err (prog_name, code, _("while copying principal")); return (FALSE); } if ((code = krb5_copy_principal(context, server, &my_creds.server))){ - com_err (prog_name, code, "while copying principal"); + com_err (prog_name, code, _("while copying principal")); return (FALSE); } if ((code = krb5_timeofday(context, &now))) { - com_err(prog_name, code, "while getting time of day"); + com_err(prog_name, code, _("while getting time of day")); return (FALSE); } @@ -301,12 +303,12 @@ krb5_boolean krb5_get_tkt_via_passwd (context, ccache, client, server, } else my_creds.times.renew_till = 0; - result = snprintf(prompt, sizeof(prompt), "Kerberos password for %s: ", + result = snprintf(prompt, sizeof(prompt), _("Kerberos password for %s: "), client_name); if (SNPRINTF_OVERFLOW(result, sizeof(prompt))) { - fprintf (stderr, - "principal name %s too long for internal buffer space\n", - client_name); + fprintf(stderr, + _("principal name %s too long for internal buffer space\n"), + client_name); return FALSE; } @@ -314,14 +316,14 @@ krb5_boolean krb5_get_tkt_via_passwd (context, ccache, client, server, code = krb5_read_password(context, prompt, 0, password, &pwsize); if (code ) { - com_err(prog_name, code, "while reading password for '%s'\n", + com_err(prog_name, code, _("while reading password for '%s'\n"), client_name); memset(password, 0, sizeof(password)); return (FALSE); } if ( pwsize == 0) { - fprintf(stderr, "No password given\n"); + fprintf(stderr, _("No password given\n")); *zero_password = TRUE; memset(password, 0, sizeof(password)); return (FALSE); @@ -335,9 +337,9 @@ krb5_boolean krb5_get_tkt_via_passwd (context, ccache, client, server, if (code) { if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) - fprintf (stderr, "%s: Password incorrect\n", prog_name); + fprintf(stderr, _("%s: Password incorrect\n"), prog_name); else - com_err (prog_name, code, "while getting initial credentials"); + com_err(prog_name, code, _("while getting initial credentials")); return (FALSE); } return (TRUE); @@ -353,7 +355,8 @@ void dump_principal (context, str, p) krb5_error_code retval; if ((retval = krb5_unparse_name(context, p, &stname))) { - fprintf(stderr, " %s while unparsing name\n", error_message(retval)); + fprintf(stderr, _(" %s while unparsing name\n"), + error_message(retval)); } fprintf(stderr, " %s: %s\n", str, stname); } @@ -365,8 +368,10 @@ void plain_dump_principal (context, p) char * stname; krb5_error_code retval; - if ((retval = krb5_unparse_name(context, p, &stname))) - fprintf(stderr, " %s while unparsing name\n", error_message(retval)); + if ((retval = krb5_unparse_name(context, p, &stname))) { + fprintf(stderr, _(" %s while unparsing name\n"), + error_message(retval)); + } fprintf(stderr, "%s ", stname); } diff --git a/src/clients/ksu/main.c b/src/clients/ksu/main.c index e548f1699a..e3d2999e56 100644 --- a/src/clients/ksu/main.c +++ b/src/clients/ksu/main.c @@ -58,7 +58,10 @@ char * get_dir_of_file(); ill specified arguments to commands */ void usage (){ - fprintf(stderr, "Usage: %s [target user] [-n principal] [-c source cachename] [-k] [-D] [-r time] [-pf] [-l lifetime] [-zZ] [-q] [-e command [args... ] ] [-a [args... ] ]\n", prog_name); + fprintf(stderr, + _("Usage: %s [target user] [-n principal] [-c source cachename] " + "[-k] [-D] [-r time] [-pf] [-l lifetime] [-zZ] [-q] " + "[-e command [args... ] ] [-a [args... ] ]\n"), prog_name); } /* for Ultrix and friends ... */ @@ -128,7 +131,7 @@ main (argc, argv) retval = krb5_init_secure_context(&ksu_context); if (retval) { - com_err(argv[0], retval, "while initializing krb5"); + com_err(argv[0], retval, _("while initializing krb5")); exit(1); } @@ -137,7 +140,9 @@ main (argc, argv) prog_name = argv[0]; if (strlen (prog_name) > 50) { /* this many chars *after* last / ?? */ - com_err(prog_name, 0, "program name too long - quitting to avoid triggering system logging bugs"); + com_err(prog_name, 0, + _("program name too long - quitting to avoid triggering " + "system logging bugs")); exit (1); } @@ -162,7 +167,7 @@ main (argc, argv) pargc = argc -1; if ((pargv =(char **) calloc(pargc +1,sizeof(char *)))==NULL){ - com_err(prog_name, errno, "while allocating memory"); + com_err(prog_name, errno, _("while allocating memory")); exit(1); } @@ -175,7 +180,7 @@ main (argc, argv) } if (krb5_seteuid (ruid)) { - com_err (prog_name, errno, "while setting euid to source user"); + com_err (prog_name, errno, _("while setting euid to source user")); exit (1); } while(!done && ((option = getopt(pargc, pargv,"n:c:r:a:zZDfpkql:e:")) != -1)){ @@ -186,7 +191,7 @@ main (argc, argv) optarg = "bad-time"; retval = krb5_string_to_deltat(optarg, &options.rlife); if (retval != 0 || options.rlife == 0) { - fprintf(stderr, "Bad lifetime value (%s hours?)\n", optarg); + fprintf(stderr, _("Bad lifetime value (%s hours?)\n"), optarg); errflg++; } break; @@ -197,7 +202,7 @@ main (argc, argv) if (auth_debug){printf("Before get_params optind=%d\n", optind);} if ((retval = get_params( & optind, pargc, pargv, ¶ms))){ - com_err(prog_name, retval, "when gathering parameters"); + com_err(prog_name, retval, _("when gathering parameters")); errflg++; } if(auth_debug){ printf("After get_params optind=%d\n", optind);} @@ -220,13 +225,13 @@ main (argc, argv) optarg = "bad-time"; retval = krb5_string_to_deltat(optarg, &options.lifetime); if (retval != 0 || options.lifetime == 0) { - fprintf(stderr, "Bad lifetime value (%s hours?)\n", optarg); + fprintf(stderr, _("Bad lifetime value (%s hours?)\n"), optarg); errflg++; } break; case 'n': if ((retval = krb5_parse_name(ksu_context, optarg, &client))){ - com_err(prog_name, retval, "when parsing name %s", optarg); + com_err(prog_name, retval, _("when parsing name %s"), optarg); errflg++; } @@ -242,7 +247,7 @@ main (argc, argv) some_rest_copy = 1; if(all_rest_copy) { fprintf(stderr, - "-z option is mutually exclusive with -Z.\n"); + _("-z option is mutually exclusive with -Z.\n")); errflg++; } break; @@ -250,7 +255,7 @@ main (argc, argv) all_rest_copy = 1; if(some_rest_copy) { fprintf(stderr, - "-Z option is mutually exclusive with -z.\n"); + _("-Z option is mutually exclusive with -z.\n")); errflg++; } break; @@ -261,20 +266,20 @@ main (argc, argv) cc_source_tag_tmp = strchr(cc_source_tag, ':') + 1; if( stat( cc_source_tag_tmp, &st_temp)){ - com_err (prog_name, errno, - "while looking for credentials file %s", - cc_source_tag_tmp); + com_err(prog_name, errno, + _("while looking for credentials file %s"), + cc_source_tag_tmp); exit (1); } } else { - fprintf(stderr,"malformed credential cache name %s\n", + fprintf(stderr, _("malformed credential cache name %s\n"), cc_source_tag); errflg++; } } else { - fprintf(stderr, "Only one -c option allowed\n"); + fprintf(stderr, _("Only one -c option allowed\n")); errflg++; } break; @@ -282,7 +287,7 @@ main (argc, argv) cmd = xstrdup(optarg); if(auth_debug){printf("Before get_params optind=%d\n", optind);} if ((retval = get_params( & optind, pargc, pargv, ¶ms))){ - com_err(prog_name, retval, "when gathering parameters"); + com_err(prog_name, retval, _("when gathering parameters")); errflg++; } if(auth_debug){printf("After get_params optind=%d\n", optind);} @@ -326,11 +331,11 @@ main (argc, argv) } if (pwd == NULL) { - fprintf(stderr, "ksu: who are you?\n"); + fprintf(stderr, _("ksu: who are you?\n")); exit(1); } if (pwd->pw_uid != ruid) { - fprintf (stderr, "Your uid doesn't match your passwd entry?!\n"); + fprintf (stderr, _("Your uid doesn't match your passwd entry?!\n")); exit (1); } /* Okay, now we have *some* passwd entry that matches the @@ -347,7 +352,7 @@ main (argc, argv) } if ((target_pwd = getpwnam(target_user)) == NULL){ - fprintf(stderr, "ksu: unknown login %s\n", target_user); + fprintf(stderr, _("ksu: unknown login %s\n"), target_user); exit(1); } target_uid = target_pwd->pw_uid; @@ -368,13 +373,13 @@ main (argc, argv) /* get a handle for the cache */ if ((retval = krb5_cc_resolve(ksu_context, cc_source_tag, &cc_source))){ - com_err(prog_name, retval,"while getting source cache"); + com_err(prog_name, retval, _("while getting source cache")); exit(1); } if (((retval = krb5_cc_set_flags(ksu_context, cc_source, 0x0)) != 0) && (retval != KRB5_FCC_NOFILE)) { - com_err(prog_name, retval, "while opening ccache"); + com_err(prog_name, retval, _("while opening ccache")); exit(1); } if ((retval = get_best_princ_for_target(ksu_context, source_uid, @@ -382,7 +387,7 @@ main (argc, argv) target_user, cc_source, &options, cmd, localhostname, &client, &hp))){ - com_err(prog_name,retval, "while selecting the best principal"); + com_err(prog_name,retval, _("while selecting the best principal")); exit(1); } @@ -390,7 +395,8 @@ main (argc, argv) what happened; become source.*/ if ( geteuid() != source_uid) { if (krb5_seteuid(0) || krb5_seteuid(source_uid) ) { - com_err(prog_name, errno, "while returning to source uid after finding best principal"); + com_err(prog_name, errno, _("while returning to source uid after " + "finding best principal")); exit(1); } } @@ -409,7 +415,7 @@ main (argc, argv) if (hp){ if (gb_err) fprintf(stderr, "%s", gb_err); - fprintf(stderr,"account %s: authorization failed\n",target_user); + fprintf(stderr, _("account %s: authorization failed\n"), target_user); exit(1); } @@ -435,7 +441,7 @@ main (argc, argv) if (access(dir_of_cc_target, R_OK | W_OK )){ fprintf(stderr, - "%s does not have correct permissions for %s\n", + _("%s does not have correct permissions for %s\n"), source_user, cc_target_tag); exit(1); } @@ -465,19 +471,16 @@ main (argc, argv) cc_target_tag, client, &cc_target, &stored, target_uid))){ - com_err (prog_name, retval, - "while copying cache %s to %s", - krb5_cc_get_name(ksu_context, cc_source),cc_target_tag); + com_err(prog_name, retval, _("while copying cache %s to %s"), + krb5_cc_get_name(ksu_context, cc_source), cc_target_tag); exit(1); } } else { if ((retval = krb5_ccache_copy(ksu_context, cc_source, cc_target_tag, client,&cc_target, &stored, target_uid))) { - com_err (prog_name, retval, - "while copying cache %s to %s", - krb5_cc_get_name(ksu_context, cc_source), - cc_target_tag); + com_err(prog_name, retval, _("while copying cache %s to %s"), + krb5_cc_get_name(ksu_context, cc_source), cc_target_tag); exit(1); } @@ -486,7 +489,7 @@ main (argc, argv) /* Become root for authentication*/ if (krb5_seteuid(0)) { - com_err(prog_name, errno, "while reclaiming root uid"); + com_err(prog_name, errno, _("while reclaiming root uid")); exit(1); } @@ -498,25 +501,26 @@ main (argc, argv) krb5_princ_realm(ksu_context, client), &kdc_server))){ com_err(prog_name, retval, - "while creating tgt for local realm"); + _("while creating tgt for local realm")); sweep_up(ksu_context, cc_target); exit(1); } - fprintf(stderr,"WARNING: Your password may be exposed if you enter it here and are logged\n"); - fprintf(stderr," in remotely using an unsecure (non-encrypted) channel.\n"); + fprintf(stderr, _("WARNING: Your password may be exposed if you " + "enter it here and are logged\n")); + fprintf(stderr, _(" in remotely using an unsecure " + "(non-encrypted) channel.\n")); if (krb5_get_tkt_via_passwd (ksu_context, &cc_target, client, kdc_server, &options, &zero_password) == FALSE){ if (zero_password == FALSE){ - fprintf(stderr,"Goodbye\n"); + fprintf(stderr, _("Goodbye\n")); sweep_up(ksu_context, cc_target); exit(1); } - fprintf(stderr, - "Could not get a tgt for "); + fprintf(stderr, _("Could not get a tgt for ")); plain_dump_principal (ksu_context, client); fprintf(stderr, "\n"); @@ -536,9 +540,8 @@ main (argc, argv) /* if Kerberos authentication failed then exit */ if (auth_val ==FALSE){ - fprintf(stderr, "Authentication failed.\n"); - syslog(LOG_WARNING, - "'%s %s' authentication failed for %s%s", + fprintf(stderr, _("Authentication failed.\n")); + syslog(LOG_WARNING, "'%s %s' authentication failed for %s%s", prog_name,target_user,source_user,ontty()); sweep_up(ksu_context, cc_target); exit(1); @@ -572,51 +575,51 @@ main (argc, argv) #endif /*0*/ if ((retval = krb5_unparse_name(ksu_context, client, &client_name))) { - com_err (prog_name, retval, "When unparsing name"); + com_err(prog_name, retval, _("When unparsing name")); sweep_up(ksu_context, cc_target); exit(1); } - print_status("Authenticated %s\n", client_name); + print_status(_("Authenticated %s\n"), client_name); syslog(LOG_NOTICE,"'%s %s' authenticated %s for %s%s", prog_name,target_user,client_name, source_user,ontty()); /* Run authorization as target.*/ if (krb5_seteuid(target_uid)) { - com_err(prog_name, errno, "while switching to target for authorization check"); + com_err(prog_name, errno, _("while switching to target for " + "authorization check")); sweep_up(ksu_context, cc_target); exit(1); } if ((retval = krb5_authorization(ksu_context, client,target_user, cmd, &authorization_val, &exec_cmd))){ - com_err(prog_name,retval,"while checking authorization"); + com_err(prog_name,retval, _("while checking authorization")); krb5_seteuid(0); /*So we have some chance of sweeping up*/ sweep_up(ksu_context, cc_target); exit(1); } if (krb5_seteuid(0)) { - com_err(prog_name, errno, "while switching back from target after authorization check"); + com_err(prog_name, errno, _("while switching back from target " + "after authorization check")); sweep_up(ksu_context, cc_target); exit(1); } if (authorization_val == TRUE){ if (cmd) { - print_status( - "Account %s: authorization for %s for execution of\n", - target_user, client_name); - print_status(" %s successful\n",exec_cmd); + print_status(_("Account %s: authorization for %s for " + "execution of\n"), target_user, client_name); + print_status(_(" %s successful\n"), exec_cmd); syslog(LOG_NOTICE, "Account %s: authorization for %s for execution of %s successful", target_user, client_name, exec_cmd); }else{ - print_status( - "Account %s: authorization for %s successful\n", - target_user, client_name); + print_status(_("Account %s: authorization for %s " + "successful\n"), target_user, client_name); syslog(LOG_NOTICE, "Account %s: authorization for %s successful", target_user, client_name); @@ -627,16 +630,15 @@ main (argc, argv) fprintf(stderr, "%s", exec_cmd ); syslog(LOG_WARNING, "%s",exec_cmd); } - fprintf(stderr, - "Account %s: authorization for %s for execution of %s failed\n", + fprintf(stderr, _("Account %s: authorization for %s for " + "execution of %s failed\n"), target_user, client_name, cmd ); syslog(LOG_WARNING, "Account %s: authorization for %s for execution of %s failed", target_user, client_name, cmd ); }else{ - fprintf(stderr, - "Account %s: authorization of %s failed\n", + fprintf(stderr, _("Account %s: authorization of %s failed\n"), target_user, client_name); syslog(LOG_WARNING, "Account %s: authorization of %s failed", @@ -651,7 +653,7 @@ main (argc, argv) if( some_rest_copy){ if ((retval = krb5_ccache_filter(ksu_context, cc_target, client))){ - com_err(prog_name,retval,"while calling cc_filter"); + com_err(prog_name,retval, _("while calling cc_filter")); sweep_up(ksu_context, cc_target); exit(1); } @@ -659,8 +661,7 @@ main (argc, argv) if (all_rest_copy){ if ((retval = krb5_cc_initialize(ksu_context, cc_target, client))){ - com_err(prog_name, retval, - "while erasing target cache"); + com_err(prog_name, retval, _("while erasing target cache")); exit(1); } @@ -680,7 +681,7 @@ main (argc, argv) /* insist that the target login uses a standard shell (root is omited) */ if (!standard_shell(target_pwd->pw_shell) && source_uid) { - fprintf(stderr, "ksu: permission denied (shell).\n"); + fprintf(stderr, _("ksu: permission denied (shell).\n")); sweep_up(ksu_context, cc_target); exit(1); } @@ -689,20 +690,21 @@ main (argc, argv) if (target_pwd->pw_uid){ if(set_env_var("USER", target_pwd->pw_name)){ - fprintf(stderr,"ksu: couldn't set environment variable USER\n"); + fprintf(stderr, + _("ksu: couldn't set environment variable USER\n")); sweep_up(ksu_context, cc_target); exit(1); } } if(set_env_var( "HOME", target_pwd->pw_dir)){ - fprintf(stderr,"ksu: couldn't set environment variable USER\n"); + fprintf(stderr, _("ksu: couldn't set environment variable USER\n")); sweep_up(ksu_context, cc_target); exit(1); } if(set_env_var( "SHELL", shell)){ - fprintf(stderr,"ksu: couldn't set environment variable USER\n"); + fprintf(stderr, _("ksu: couldn't set environment variable SHELL\n")); sweep_up(ksu_context, cc_target); exit(1); } @@ -710,7 +712,7 @@ main (argc, argv) /* set the cc env name to target */ if(set_env_var( KRB5_ENV_CCNAME, cc_target_tag)){ - fprintf(stderr,"ksu: couldn't set environment variable %s\n", + fprintf(stderr, _("ksu: couldn't set environment variable %s\n"), KRB5_ENV_CCNAME); sweep_up(ksu_context, cc_target); exit(1); @@ -725,16 +727,16 @@ main (argc, argv) if (initgroups(target_user, target_pwd->pw_gid)) { - fprintf(stderr, "ksu: initgroups failed.\n"); + fprintf(stderr, _("ksu: initgroups failed.\n")); sweep_up(ksu_context, cc_target); exit(1); } if ( ! strcmp(target_user, source_user)){ - print_status("Leaving uid as %s (%ld)\n", + print_status(_("Leaving uid as %s (%ld)\n"), target_user, (long) target_pwd->pw_uid); }else{ - print_status("Changing uid to %s (%ld)\n", + print_status(_("Changing uid to %s (%ld)\n"), target_user, (long) target_pwd->pw_uid); } @@ -759,7 +761,7 @@ main (argc, argv) if (access( cc_target_tag_tmp, R_OK | W_OK )){ com_err(prog_name, errno, - "%s does not have correct permissions for %s, %s aborted", + _("%s does not have correct permissions for %s, %s aborted"), target_user, cc_target_tag_tmp, prog_name); exit(1); } @@ -773,8 +775,8 @@ main (argc, argv) } if( !exec_cmd){ - fprintf(stderr, - "Internal error: command %s did not get resolved\n",cmd); + fprintf(stderr, _("Internal error: command %s did not get " + "resolved\n"), cmd); exit(1); } @@ -790,8 +792,7 @@ main (argc, argv) if( keep_target_cache ) { execv(params[0], params); - com_err(prog_name, errno, "while trying to execv %s", - params[0]); + com_err(prog_name, errno, _("while trying to execv %s"), params[0]); sweep_up(ksu_context, cc_target); exit(1); }else{ @@ -817,17 +818,18 @@ main (argc, argv) printf("The exit status of the child is %d\n", statusp); } if (ret_pid == -1) { - com_err(prog_name, errno, "while calling waitpid"); + com_err(prog_name, errno, _("while calling waitpid")); } sweep_up(ksu_context, cc_target); exit (statusp); case -1: - com_err(prog_name, errno, "while trying to fork."); + com_err(prog_name, errno, _("while trying to fork.")); sweep_up(ksu_context, cc_target); exit (1); case 0: execv(params[0], params); - com_err(prog_name, errno, "while trying to execv %s", params[0]); + com_err(prog_name, errno, _("while trying to execv %s"), + params[0]); exit (1); } } @@ -859,7 +861,7 @@ static char * ontty() if ((p = ttyname(STDERR_FILENO))) { result = snprintf(buf, sizeof(buf), " on %s", p); if (SNPRINTF_OVERFLOW(result, sizeof(buf))) { - fprintf (stderr, "terminal name %s too long\n", p); + fprintf(stderr, _("terminal name %s too long\n"), p); exit (1); } } @@ -889,16 +891,14 @@ static void sweep_up(context, cc) krb5_seteuid(0); if (krb5_seteuid(target_uid) < 0) { com_err(prog_name, errno, - "while changing to target uid for destroying ccache"); + _("while changing to target uid for destroying ccache")); exit(1); } cc_name = krb5_cc_get_name(context, cc); if ( ! stat(cc_name, &st_temp)){ - if ((retval = krb5_cc_destroy(context, cc))){ - com_err(prog_name, retval, - "while destroying cache"); - } + if ((retval = krb5_cc_destroy(context, cc))) + com_err(prog_name, retval, _("while destroying cache")); } } diff --git a/src/clients/kvno/kvno.c b/src/clients/kvno/kvno.c index 3f01b0eb99..9173daa769 100644 --- a/src/clients/kvno/kvno.c +++ b/src/clients/kvno/kvno.c @@ -27,7 +27,7 @@ #include <stdio.h> #include <stdlib.h> -#include "autoconf.h" +#include "k5-platform.h" #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -40,9 +40,9 @@ static char *prog; static void xusage() { - fprintf(stderr, "usage: %s [-C] [-u] [-c ccache] [-e etype]\n", prog); - fprintf(stderr, "\t[-k keytab] [-S sname] [-U for_user [-P]]\n"); - fprintf(stderr, "\tservice1 service2 ...\n"); + fprintf(stderr, _("usage: %s [-C] [-u] [-c ccache] [-e etype]\n"), prog); + fprintf(stderr, _("\t[-k keytab] [-S sname] [-U for_user [-P]]\n")); + fprintf(stderr, _("\tservice1 service2 ...\n")); exit(1); } @@ -96,14 +96,16 @@ int main(int argc, char *argv[]) case 'S': sname = optarg; if (unknown == 1){ - fprintf(stderr, "Options -u and -S are mutually exclusive\n"); + fprintf(stderr, + _("Options -u and -S are mutually exclusive\n")); xusage(); } break; case 'u': unknown = 1; if (sname){ - fprintf(stderr, "Options -u and -S are mutually exclusive\n"); + fprintf(stderr, + _("Options -u and -S are mutually exclusive\n")); xusage(); } break; @@ -118,12 +120,12 @@ int main(int argc, char *argv[]) if (proxy) { if (keytab_name == NULL) { - fprintf(stderr, "Option -P (constrained delegation) " - "requires keytab to be specified\n"); + fprintf(stderr, _("Option -P (constrained delegation) " + "requires keytab to be specified\n")); xusage(); } else if (for_user == NULL) { - fprintf(stderr, "Option -P (constrained delegation) requires " - "option -U (protocol transition)\n"); + fprintf(stderr, _("Option -P (constrained delegation) requires " + "option -U (protocol transition)\n")); xusage(); } } @@ -167,14 +169,14 @@ static void do_v5_kvno (int count, char *names[], ret = krb5_init_context(&context); if (ret) { - com_err(prog, ret, "while initializing krb5 library"); + com_err(prog, ret, _("while initializing krb5 library")); exit(1); } if (etypestr) { ret = krb5_string_to_enctype(etypestr, &etype); if (ret) { - com_err(prog, ret, "while converting etype"); + com_err(prog, ret, _("while converting etype")); exit(1); } } else { @@ -186,14 +188,14 @@ static void do_v5_kvno (int count, char *names[], else ret = krb5_cc_default(context, &ccache); if (ret) { - com_err(prog, ret, "while opening ccache"); + com_err(prog, ret, _("while opening ccache")); exit(1); } if (keytab_name) { ret = krb5_kt_resolve(context, keytab_name, &keytab); if (ret) { - com_err(prog, ret, "resolving keytab %s", keytab_name); + com_err(prog, ret, _("resolving keytab %s"), keytab_name); exit(1); } } @@ -203,14 +205,14 @@ static void do_v5_kvno (int count, char *names[], KRB5_PRINCIPAL_PARSE_ENTERPRISE, &for_user_princ); if (ret) { - com_err(prog, ret, "while parsing principal name %s", for_user); + com_err(prog, ret, _("while parsing principal name %s"), for_user); exit(1); } } ret = krb5_cc_get_principal(context, ccache, &me); if (ret) { - com_err(prog, ret, "while getting client principal name"); + com_err(prog, ret, _("while getting client principal name")); exit(1); } @@ -236,8 +238,10 @@ static void do_v5_kvno (int count, char *names[], ret = krb5_parse_name(context, names[i], &server); } if (ret) { - if (!quiet) - com_err(prog, ret, "while parsing principal name %s", names[i]); + if (!quiet) { + com_err(prog, ret, _("while parsing principal name %s"), + names[i]); + } goto error; } if (unknown == 1) { @@ -246,9 +250,8 @@ static void do_v5_kvno (int count, char *names[], ret = krb5_unparse_name(context, server, &princ); if (ret) { - com_err(prog, ret, - "while formatting parsed principal name for '%s'", - names[i]); + com_err(prog, ret, _("while formatting parsed principal name for " + "'%s'"), names[i]); goto error; } @@ -258,7 +261,7 @@ static void do_v5_kvno (int count, char *names[], if (!proxy && !krb5_principal_compare(context, me, server)) { com_err(prog, EINVAL, - "client and server principal names must match"); + _("client and server principal names must match")); goto error; } @@ -275,14 +278,14 @@ static void do_v5_kvno (int count, char *names[], } if (ret) { - com_err(prog, ret, "while getting credentials for %s", princ); + com_err(prog, ret, _("while getting credentials for %s"), princ); goto error; } /* we need a native ticket */ ret = krb5_decode_ticket(&out_creds->ticket, &ticket); if (ret) { - com_err(prog, ret, "while decoding ticket for %s", princ); + com_err(prog, ret, _("while decoding ticket for %s"), princ); goto error; } @@ -293,12 +296,13 @@ static void do_v5_kvno (int count, char *names[], fprintf(stderr, "%s: kvno = %d, keytab entry invalid\n", princ, ticket->enc_part.kvno); } - com_err(prog, ret, "while decrypting ticket for %s", princ); + com_err(prog, ret, _("while decrypting ticket for %s"), princ); goto error; } - if (!quiet) - printf("%s: kvno = %d, keytab entry valid\n", + if (!quiet) { + printf(_("%s: kvno = %d, keytab entry valid\n"), princ, ticket->enc_part.kvno); + } if (proxy) { krb5_free_creds(context, out_creds); out_creds = NULL; @@ -314,13 +318,13 @@ static void do_v5_kvno (int count, char *names[], &out_creds); if (ret) { com_err(prog, ret, - "%s: constrained delegation failed", princ); + _("%s: constrained delegation failed"), princ); goto error; } } } else { if (!quiet) - printf("%s: kvno = %d\n", princ, ticket->enc_part.kvno); + printf(_("%s: kvno = %d\n"), princ, ticket->enc_part.kvno); } continue; |