Add options to kcpytkt and kdeltkt for exp tix
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
static char *etypestr = 0;
|
static char *etypestr = 0;
|
||||||
static char *fromccachestr = 0;
|
static char *fromccachestr = 0;
|
||||||
static char *flagstr = 0;
|
static char *flagstr = 0;
|
||||||
|
static int exp_ok = 0;
|
||||||
static int quiet_flag = 0;
|
static int quiet_flag = 0;
|
||||||
static int version_flag = 0;
|
static int version_flag = 0;
|
||||||
static int help_flag = 0;
|
static int help_flag = 0;
|
||||||
@@ -15,6 +16,8 @@ struct getargs args[] = {
|
|||||||
"Encryption type", "enctype" },
|
"Encryption type", "enctype" },
|
||||||
{ "flags", 'f', arg_string, &flagstr,
|
{ "flags", 'f', arg_string, &flagstr,
|
||||||
"Flags", "flags" },
|
"Flags", "flags" },
|
||||||
|
{ "expired-ok", 'E', arg_flag, &exp_ok,
|
||||||
|
"Keep expired tickets" },
|
||||||
{ "quiet", 'q', arg_flag, &quiet_flag, "Quiet" },
|
{ "quiet", 'q', arg_flag, &quiet_flag, "Quiet" },
|
||||||
{ "version", 0, arg_flag, &version_flag },
|
{ "version", 0, arg_flag, &version_flag },
|
||||||
{ "help", 0, arg_flag, &help_flag }
|
{ "help", 0, arg_flag, &help_flag }
|
||||||
@@ -129,6 +132,11 @@ static void do_kcpytkt (int count, char *names[],
|
|||||||
|
|
||||||
in_creds.session.keytype = etype;
|
in_creds.session.keytype = etype;
|
||||||
|
|
||||||
|
if (!exp_ok) {
|
||||||
|
krb5_timeofday(context, &in_creds.times.endtime);
|
||||||
|
retflags |= KRB5_TC_MATCH_TIMES;
|
||||||
|
}
|
||||||
|
|
||||||
ret = krb5_cc_retrieve_cred(context, fromccache, retflags,
|
ret = krb5_cc_retrieve_cred(context, fromccache, retflags,
|
||||||
&in_creds, &out_creds);
|
&in_creds, &out_creds);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
static char *etypestr = 0;
|
static char *etypestr = 0;
|
||||||
static char *ccachestr = 0;
|
static char *ccachestr = 0;
|
||||||
static char *flagstr = 0;
|
static char *flagstr = 0;
|
||||||
|
static int exp_only = 0;
|
||||||
static int quiet_flag = 0;
|
static int quiet_flag = 0;
|
||||||
static int help_flag = 0;
|
static int help_flag = 0;
|
||||||
static int version_flag = 0;
|
static int version_flag = 0;
|
||||||
@@ -15,6 +16,8 @@ struct getargs args[] = {
|
|||||||
"Encryption type", "enctype" },
|
"Encryption type", "enctype" },
|
||||||
{ "flags", 'f', arg_string, &flagstr,
|
{ "flags", 'f', arg_string, &flagstr,
|
||||||
"Flags", "flags" },
|
"Flags", "flags" },
|
||||||
|
{ "expired-only", 'E', arg_flag, &exp_only,
|
||||||
|
"Delete only expired tickets" },
|
||||||
{ "quiet", 'q', arg_flag, &quiet_flag, "Quiet" },
|
{ "quiet", 'q', arg_flag, &quiet_flag, "Quiet" },
|
||||||
{ "version", 0, arg_flag, &version_flag },
|
{ "version", 0, arg_flag, &version_flag },
|
||||||
{ "help", 0, arg_flag, &help_flag }
|
{ "help", 0, arg_flag, &help_flag }
|
||||||
@@ -124,6 +127,11 @@ static void do_kdeltkt (int count, char *names[],
|
|||||||
|
|
||||||
in_creds.session.keytype = etype;
|
in_creds.session.keytype = etype;
|
||||||
|
|
||||||
|
if (exp_only) {
|
||||||
|
krb5_timeofday(context, &in_creds.times.endtime);
|
||||||
|
retflags |= KRB5_TC_MATCH_TIMES;
|
||||||
|
}
|
||||||
|
|
||||||
ret = krb5_cc_retrieve_cred(context, ccache, retflags,
|
ret = krb5_cc_retrieve_cred(context, ccache, retflags,
|
||||||
&in_creds, &out_creds);
|
&in_creds, &out_creds);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Reference in New Issue
Block a user