Add --debug option to kgetcred
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
.Fl Fl enctype= Ns Ar enctype
|
||||
.Xc
|
||||
.Oc
|
||||
.Op Fl Fl debug
|
||||
.Op Fl name-type= Ns Ar name-type
|
||||
.Op Fl Fl no-transit-check
|
||||
.Op Fl Fl version
|
||||
@@ -73,6 +74,8 @@ Supported options:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl Fl canonicalize
|
||||
requests that the KDC canonicalize the principal.
|
||||
.It Fl Fl canonical
|
||||
turns off local canonicalization of the principal.
|
||||
.It Fl Fl name-type= Ns Ar name-type
|
||||
the name-type to use when parsing the principal name.
|
||||
.It Fl c Ar cache , Fl Fl cache= Ns Ar cache
|
||||
@@ -84,9 +87,13 @@ encryption type to use.
|
||||
.It Fl Fl no-transit-check
|
||||
requests that the KDC doesn't do transit checking.
|
||||
.It Fl Fl forwardable
|
||||
.It Fl Fl debug
|
||||
enables debug output to stderr.
|
||||
.It Fl Fl version
|
||||
.It Fl Fl help
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr kinit 1 ,
|
||||
.Xr klist 1
|
||||
.Xr klist 1 ,
|
||||
.Xr krb5.conf 5 ,
|
||||
.Xr krb5_openlog 3
|
||||
|
@@ -42,6 +42,7 @@ static int forwardable_flag;
|
||||
static int canonicalize_flag;
|
||||
static char *impersonate_str;
|
||||
static char *nametype_str;
|
||||
static int debug;
|
||||
static int version_flag;
|
||||
static int help_flag;
|
||||
|
||||
@@ -62,6 +63,7 @@ struct getargs args[] = {
|
||||
{ "impersonate", 0, arg_string, &impersonate_str,
|
||||
NP_("client to impersonate", ""), "principal"},
|
||||
{ "name-type", 0, arg_string, &nametype_str, NULL, NULL },
|
||||
{ "debug", 0, arg_flag, &debug, NULL, NULL },
|
||||
{ "version", 0, arg_flag, &version_flag, NULL, NULL },
|
||||
{ "help", 0, arg_flag, &help_flag, NULL, NULL }
|
||||
};
|
||||
@@ -108,6 +110,12 @@ main(int argc, char **argv)
|
||||
argc -= optidx;
|
||||
argv += optidx;
|
||||
|
||||
if (debug) {
|
||||
ret = krb5_set_debug_dest(context, getprogname(), "STDERR");
|
||||
if (ret)
|
||||
krb5_warn(context, ret, "krb5_set_debug_dest");
|
||||
}
|
||||
|
||||
if (cache_str) {
|
||||
ret = krb5_cc_resolve(context, cache_str, &cache);
|
||||
if (ret)
|
||||
|
@@ -574,6 +574,7 @@ EXPORTS
|
||||
krb5_sendto_kdc
|
||||
krb5_sendto_kdc_flags
|
||||
krb5_set_config_files
|
||||
krb5_set_debug_dest
|
||||
krb5_set_default_in_tkt_etypes
|
||||
krb5_set_default_realm
|
||||
krb5_set_dns_canonicalize_hostname
|
||||
|
@@ -514,3 +514,21 @@ _krb5_have_debug(krb5_context context, int level)
|
||||
return 0 ;
|
||||
return 1;
|
||||
}
|
||||
|
||||
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
|
||||
krb5_set_debug_dest(krb5_context context, const char *program,
|
||||
const char *log_spec)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
|
||||
if (context->debug_dest == NULL) {
|
||||
ret = krb5_initlog(context, program, &context->debug_dest);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = krb5_addlog_dest(context, context->debug_dest, log_spec);
|
||||
if (ret)
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
@@ -567,6 +567,7 @@ HEIMDAL_KRB5_2.0 {
|
||||
krb5_sendto_kdc;
|
||||
krb5_sendto_kdc_flags;
|
||||
krb5_set_config_files;
|
||||
krb5_set_debug_dest;
|
||||
krb5_set_default_in_tkt_etypes;
|
||||
krb5_set_default_realm;
|
||||
krb5_set_dns_canonicalize_hostname;
|
||||
|
Reference in New Issue
Block a user