i18n kinit

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23824 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-09-13 09:45:20 +00:00
parent 166b4b975c
commit 326718e312
4 changed files with 262 additions and 49 deletions

View File

@@ -2,7 +2,9 @@
include $(top_srcdir)/Makefile.am.common include $(top_srcdir)/Makefile.am.common
AM_CPPFLAGS += $(INCLUDE_hcrypto) -I$(srcdir)/../lib/krb5 AM_CPPFLAGS += $(INCLUDE_hcrypto) -I$(srcdir)/../lib/krb5 \
$(INCLUDE_libintl) \
-DHEIMDAL_LOCALEDIR='"$(localedir)"'
man_MANS = \ man_MANS = \
kinit.1 \ kinit.1 \
@@ -24,6 +26,7 @@ kinit_LDADD = \
$(top_builddir)/lib/ntlm/libheimntlm.la \ $(top_builddir)/lib/ntlm/libheimntlm.la \
$(LIB_hcrypto) \ $(LIB_hcrypto) \
$(top_builddir)/lib/asn1/libasn1.la \ $(top_builddir)/lib/asn1/libasn1.la \
$(LIB_libintl) \
$(LIB_roken) $(LIB_roken)
kdestroy_LDADD = $(kinit_LDADD) kdestroy_LDADD = $(kinit_LDADD)

View File

@@ -84,94 +84,94 @@ static struct getargs args[] = {
* 5: * 5:
*/ */
{ "524init", '4', arg_flag, &get_v4_tgt, { "524init", '4', arg_flag, &get_v4_tgt,
"obtain version 4 TGT" }, NP_("obtain version 4 TGT", "") },
{ "524convert", '9', arg_flag, &convert_524, { "524convert", '9', arg_flag, &convert_524,
"only convert ticket to version 4" }, NP_("only convert ticket to version 4", "") },
{ "afslog", 0 , arg_flag, &do_afslog, { "afslog", 0 , arg_flag, &do_afslog,
"obtain afs tokens" }, NP_("obtain afs tokens", "") },
{ "cache", 'c', arg_string, &cred_cache, { "cache", 'c', arg_string, &cred_cache,
"credentials cache", "cachename" }, NP_("credentials cache", ""), "cachename" },
{ "forwardable", 'f', arg_flag, &forwardable_flag, { "forwardable", 'f', arg_flag, &forwardable_flag,
"get forwardable tickets"}, NP_("get forwardable tickets", "")},
{ "keytab", 't', arg_string, &keytab_str, { "keytab", 't', arg_string, &keytab_str,
"keytab to use", "keytabname" }, NP_("keytab to use", ""), "keytabname" },
{ "lifetime", 'l', arg_string, &lifetime, { "lifetime", 'l', arg_string, &lifetime,
"lifetime of tickets", "time"}, NP_("lifetime of tickets", ""), "time"},
{ "proxiable", 'p', arg_flag, &proxiable_flag, { "proxiable", 'p', arg_flag, &proxiable_flag,
"get proxiable tickets" }, NP_("get proxiable tickets", "") },
{ "renew", 'R', arg_flag, &renew_flag, { "renew", 'R', arg_flag, &renew_flag,
"renew TGT" }, NP_("renew TGT", "") },
{ "renewable", 0, arg_flag, &renewable_flag, { "renewable", 0, arg_flag, &renewable_flag,
"get renewable tickets" }, NP_("get renewable tickets", "") },
{ "renewable-life", 'r', arg_string, &renew_life, { "renewable-life", 'r', arg_string, &renew_life,
"renewable lifetime of tickets", "time" }, NP_("renewable lifetime of tickets", ""), "time" },
{ "server", 'S', arg_string, &server_str, { "server", 'S', arg_string, &server_str,
"server to get ticket for", "principal" }, NP_("server to get ticket for", ""), "principal" },
{ "start-time", 's', arg_string, &start_str, { "start-time", 's', arg_string, &start_str,
"when ticket gets valid", "time" }, NP_("when ticket gets valid", ""), "time" },
{ "use-keytab", 'k', arg_flag, &use_keytab, { "use-keytab", 'k', arg_flag, &use_keytab,
"get key from keytab" }, NP_("get key from keytab", "") },
{ "validate", 'v', arg_flag, &validate_flag, { "validate", 'v', arg_flag, &validate_flag,
"validate TGT" }, NP_("validate TGT", "") },
{ "enctypes", 'e', arg_strings, &etype_str, { "enctypes", 'e', arg_strings, &etype_str,
"encryption types to use", "enctypes" }, NP_("encryption types to use", ""), "enctypes" },
{ "fcache-version", 0, arg_integer, &fcache_version, { "fcache-version", 0, arg_integer, &fcache_version,
"file cache version to create" }, NP_("file cache version to create", "") },
{ "addresses", 'A', arg_negative_flag, &addrs_flag, { "addresses", 'A', arg_negative_flag, &addrs_flag,
"request a ticket with no addresses" }, NP_("request a ticket with no addresses", "") },
{ "extra-addresses",'a', arg_strings, &extra_addresses, { "extra-addresses",'a', arg_strings, &extra_addresses,
"include these extra addresses", "addresses" }, NP_("include these extra addresses", ""), "addresses" },
{ "anonymous", 0, arg_flag, &anonymous_flag, { "anonymous", 0, arg_flag, &anonymous_flag,
"request an anonymous ticket" }, NP_("request an anonymous ticket", "") },
{ "request-pac", 0, arg_flag, &pac_flag, { "request-pac", 0, arg_flag, &pac_flag,
"request a Windows PAC" }, NP_("request a Windows PAC", "") },
{ "password-file", 0, arg_string, &password_file, { "password-file", 0, arg_string, &password_file,
"read the password from a file" }, NP_("read the password from a file", "") },
{ "canonicalize",0, arg_flag, &canonicalize_flag, { "canonicalize",0, arg_flag, &canonicalize_flag,
"canonicalize client principal" }, NP_("canonicalize client principal", "") },
#ifdef PKINIT #ifdef PKINIT
{ "pk-user", 'C', arg_string, &pk_user_id, { "pk-user", 'C', arg_string, &pk_user_id,
"principal's public/private/certificate identifier", "id" }, NP_("principal's public/private/certificate identifier", ""), "id" },
{ "x509-anchors", 'D', arg_string, &pk_x509_anchors, { "x509-anchors", 'D', arg_string, &pk_x509_anchors,
"directory with CA certificates", "directory" }, NP_("directory with CA certificates", ""), "directory" },
{ "pk-use-enckey", 0, arg_flag, &pk_use_enckey, { "pk-use-enckey", 0, arg_flag, &pk_use_enckey,
"Use RSA encrypted reply (instead of DH)" }, NP_("Use RSA encrypted reply (instead of DH)", "") },
#endif #endif
{ "ntlm-domain", 0, arg_string, &ntlm_domain, { "ntlm-domain", 0, arg_string, &ntlm_domain,
"NTLM domain", "domain" }, NP_("NTLM domain", ""), "domain" },
{ "ok-as-delegate", 0, arg_flag, &ok_as_delegate_flag, { "ok-as-delegate", 0, arg_flag, &ok_as_delegate_flag,
"honor ok-as-delegate on tickets" }, NP_("honor ok-as-delegate on tickets", "") },
{ "use-referrals", 0, arg_flag, &use_referrals_flag, { "use-referrals", 0, arg_flag, &use_referrals_flag,
"only use referrals, no dns canalisation" }, NP_("only use referrals, no dns canalisation", "") },
{ "windows", 0, arg_flag, &windows_flag, { "windows", 0, arg_flag, &windows_flag,
"get windows behavior" }, NP_("get windows behavior", "") },
{ "version", 0, arg_flag, &version_flag }, { "version", 0, arg_flag, &version_flag },
{ "help", 0, arg_flag, &help_flag } { "help", 0, arg_flag, &help_flag }
@@ -180,10 +180,12 @@ static struct getargs args[] = {
static void static void
usage (int ret) usage (int ret)
{ {
arg_printusage (args, arg_printusage_i18n (args,
sizeof(args)/sizeof(*args), sizeof(args)/sizeof(*args),
NULL, N_("Usage: ", ""),
"[principal [command]]"); NULL,
"[principal [command]]",
getarg_i18n);
exit (ret); exit (ret);
} }
@@ -396,7 +398,8 @@ get_new_tickets(krb5_context context,
if (fgets(passwd, sizeof(passwd), f) == NULL) if (fgets(passwd, sizeof(passwd), f) == NULL)
krb5_errx(context, 1, krb5_errx(context, 1,
"Failed to read password from file %s", password_file); N_("Failed to read password from file %s", ""),
password_file);
if (f != stdin) if (f != stdin)
fclose(f); fclose(f);
passwd[strcspn(passwd, "\n")] = '\0'; passwd[strcspn(passwd, "\n")] = '\0';
@@ -460,7 +463,7 @@ get_new_tickets(krb5_context context,
if(start_str) { if(start_str) {
int tmp = parse_time (start_str, "s"); int tmp = parse_time (start_str, "s");
if (tmp < 0) if (tmp < 0)
errx (1, "unparsable time: %s", start_str); errx (1, N_("unparsable time: %s", ""), start_str);
start_time = tmp; start_time = tmp;
} }
@@ -518,7 +521,7 @@ get_new_tickets(krb5_context context,
char *p, *prompt; char *p, *prompt;
krb5_unparse_name (context, principal, &p); krb5_unparse_name (context, principal, &p);
asprintf (&prompt, "%s's Password: ", p); asprintf (&prompt, N_("%s's Password: ", ""), p);
free (p); free (p);
if (UI_UTIL_read_pw_string(passwd, sizeof(passwd)-1, prompt, 0)){ if (UI_UTIL_read_pw_string(passwd, sizeof(passwd)-1, prompt, 0)){
@@ -552,10 +555,10 @@ get_new_tickets(krb5_context context,
case KRB5KRB_AP_ERR_BAD_INTEGRITY: case KRB5KRB_AP_ERR_BAD_INTEGRITY:
case KRB5KRB_AP_ERR_MODIFIED: case KRB5KRB_AP_ERR_MODIFIED:
case KRB5KDC_ERR_PREAUTH_FAILED: case KRB5KDC_ERR_PREAUTH_FAILED:
krb5_errx(context, 1, "Password incorrect"); krb5_errx(context, 1, N_("Password incorrect", ""));
break; break;
case KRB5KRB_AP_ERR_V4_REPLY: case KRB5KRB_AP_ERR_V4_REPLY:
krb5_errx(context, 1, "Looks like a Kerberos 4 reply"); krb5_errx(context, 1, N_("Looks like a Kerberos 4 reply", ""));
break; break;
default: default:
krb5_err(context, 1, ret, "krb5_get_init_creds"); krb5_err(context, 1, ret, "krb5_get_init_creds");
@@ -566,7 +569,7 @@ get_new_tickets(krb5_context context,
char life[64]; char life[64];
unparse_time_approx(cred.times.endtime - cred.times.starttime, unparse_time_approx(cred.times.endtime - cred.times.starttime,
life, sizeof(life)); life, sizeof(life));
krb5_warnx(context, "NOTICE: ticket lifetime is %s", life); krb5_warnx(context, N_("NOTICE: ticket lifetime is %s", ""), life);
} }
} }
if(renew_life) { if(renew_life) {
@@ -574,7 +577,8 @@ get_new_tickets(krb5_context context,
char life[64]; char life[64];
unparse_time_approx(cred.times.renew_till - cred.times.starttime, unparse_time_approx(cred.times.renew_till - cred.times.starttime,
life, sizeof(life)); life, sizeof(life));
krb5_warnx(context, "NOTICE: ticket renewable lifetime is %s", krb5_warnx(context,
N_("NOTICE: ticket renewable lifetime is %s", ""),
life); life);
} }
} }
@@ -791,7 +795,7 @@ main (int argc, char **argv)
} }
} }
if (ret) if (ret)
krb5_err (context, 1, ret, "resolving credentials cache"); krb5_err (context, 1, ret, N_("resolving credentials cache", ""));
if(argc > 1 && k_hasafs ()) if(argc > 1 && k_hasafs ())
k_setpag(); k_setpag();
@@ -799,14 +803,15 @@ main (int argc, char **argv)
if (lifetime) { if (lifetime) {
int tmp = parse_time (lifetime, "s"); int tmp = parse_time (lifetime, "s");
if (tmp < 0) if (tmp < 0)
errx (1, "unparsable time: %s", lifetime); errx (1, N_("unparsable time: %s", ""), lifetime);
ticket_life = tmp; ticket_life = tmp;
} }
if(addrs_flag == 0 && extra_addresses.num_strings > 0) if(addrs_flag == 0 && extra_addresses.num_strings > 0)
krb5_errx(context, 1, "specifying both extra addresses and " krb5_errx(context, 1,
"no addresses makes no sense"); N_("specifying both extra addresses and "
"no addresses makes no sense", ""));
{ {
int i; int i;
krb5_addresses addresses; krb5_addresses addresses;
@@ -851,9 +856,9 @@ main (int argc, char **argv)
#define EX_NOEXEC 126 #define EX_NOEXEC 126
#define EX_NOTFOUND 127 #define EX_NOTFOUND 127
if(ret == EX_NOEXEC) if(ret == EX_NOEXEC)
krb5_warnx(context, "permission denied: %s", argv[1]); krb5_warnx(context, N_("permission denied: %s", ""), argv[1]);
else if(ret == EX_NOTFOUND) else if(ret == EX_NOTFOUND)
krb5_warnx(context, "command not found: %s", argv[1]); krb5_warnx(context, N_("command not found: %s", ""), argv[1]);
krb5_cc_destroy(context, ccache); krb5_cc_destroy(context, ccache);
_krb5_krb_dest_tkt(context, krb4_cc_name); _krb5_krb_dest_tkt(context, krb4_cc_name);

View File

@@ -82,6 +82,19 @@
#include <sys/ioccom.h> #include <sys/ioccom.h>
#endif #endif
#include <kafs.h> #include <kafs.h>
#include "crypto-headers.h" /* for des_read_pw_string */ #include "crypto-headers.h" /* for UI_UTIL_read_pw_string */
#ifdef LIBINTL
#include <libintl.h>
#define N_(x,y) gettext(x)
#define NP_(x,y) (x)
#define getarg_i18n gettext
#else
#define N_(x,y) (x)
#define NP_(x,y) (x)
#define getarg_i18n NULL
#define bindtextdomain(package, localedir)
#endif
#endif /* __KUSER_LOCL_H__ */ #endif /* __KUSER_LOCL_H__ */

View File

@@ -0,0 +1,192 @@
# SOME DESCRIPTIVE TITLE.
# This file is put in the public domain.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Heimdal 1.2.99\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-09-12 20:08+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: kuser/kinit.c:87
msgid "obtain version 4 TGT"
msgstr ""
#: kuser/kinit.c:90
msgid "only convert ticket to version 4"
msgstr ""
#: kuser/kinit.c:93
msgid "obtain afs tokens"
msgstr ""
#: kuser/kinit.c:96
msgid "credentials cache"
msgstr ""
#: kuser/kinit.c:99
msgid "get forwardable tickets"
msgstr ""
#: kuser/kinit.c:102
msgid "keytab to use"
msgstr ""
#: kuser/kinit.c:105
msgid "lifetime of tickets"
msgstr ""
#: kuser/kinit.c:108
msgid "get proxiable tickets"
msgstr ""
#: kuser/kinit.c:111
msgid "renew TGT"
msgstr ""
#: kuser/kinit.c:114
msgid "get renewable tickets"
msgstr ""
#: kuser/kinit.c:117
msgid "renewable lifetime of tickets"
msgstr ""
#: kuser/kinit.c:120
msgid "server to get ticket for"
msgstr ""
#: kuser/kinit.c:123
msgid "when ticket gets valid"
msgstr ""
#: kuser/kinit.c:126
msgid "get key from keytab"
msgstr ""
#: kuser/kinit.c:129
msgid "validate TGT"
msgstr ""
#: kuser/kinit.c:132
msgid "encryption types to use"
msgstr ""
#: kuser/kinit.c:135
msgid "file cache version to create"
msgstr ""
#: kuser/kinit.c:138
msgid "request a ticket with no addresses"
msgstr ""
#: kuser/kinit.c:141
msgid "include these extra addresses"
msgstr ""
#: kuser/kinit.c:144
msgid "request an anonymous ticket"
msgstr ""
#: kuser/kinit.c:147
msgid "request a Windows PAC"
msgstr ""
#: kuser/kinit.c:150
msgid "read the password from a file"
msgstr ""
#: kuser/kinit.c:153
msgid "canonicalize client principal"
msgstr ""
#: kuser/kinit.c:156
msgid "principal's public/private/certificate identifier"
msgstr ""
#: kuser/kinit.c:159
msgid "directory with CA certificates"
msgstr ""
#: kuser/kinit.c:162
msgid "Use RSA encrypted reply (instead of DH)"
msgstr ""
#: kuser/kinit.c:165
msgid "NTLM domain"
msgstr ""
#: kuser/kinit.c:168
msgid "honor ok-as-delegate on tickets"
msgstr ""
#: kuser/kinit.c:171
msgid "only use referrals, no dns canalisation"
msgstr ""
#: kuser/kinit.c:174
msgid "get windows behavior"
msgstr ""
#: kuser/kinit.c:185
msgid "Usage: "
msgstr ""
#: kuser/kinit.c:401
#, c-format
msgid "Failed to read password from file %s"
msgstr ""
#: kuser/kinit.c:466
#: kuser/kinit.c:806
#, c-format
msgid "unparsable time: %s"
msgstr ""
#: kuser/kinit.c:524
#, c-format
msgid "%s's Password: "
msgstr ""
#: kuser/kinit.c:558
msgid "Password incorrect"
msgstr ""
#: kuser/kinit.c:561
msgid "Looks like a Kerberos 4 reply"
msgstr ""
#: kuser/kinit.c:572
#, c-format
msgid "NOTICE: ticket lifetime is %s"
msgstr ""
#: kuser/kinit.c:581
#, c-format
msgid "NOTICE: ticket renewable lifetime is %s"
msgstr ""
#: kuser/kinit.c:798
msgid "resolving credentials cache"
msgstr ""
#: kuser/kinit.c:813
msgid "specifying both extra addresses and no addresses makes no sense"
msgstr ""
#: kuser/kinit.c:859
#, c-format
msgid "permission denied: %s"
msgstr ""
#: kuser/kinit.c:861
#, c-format
msgid "command not found: %s"
msgstr ""