Skip Menu |

This queue is for tickets about the Krb5 CPAN distribution.

Report information
The Basics
Id: 50572
Status: resolved
Priority: 0/
Queue: Krb5

People
Owner: Nobody in particular
Requestors: tom.jones [...] oucs.ox.ac.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.9



Subject: patch: add Authen::Krb5::Creds functionality to Authen::Krb5
Hello, I wonder if you would apply the attached patch, which adds some Authen::Krb5::Creds functionality. It's against Krb5-1.8.tar.gz. So far I've used the new functionality to write a replacement for klist(1), but with (for me) more readable output. I'll attach this too for curiosity. cheers, Tom Jones.
Subject: add_creds.patch
diff -ru Krb5-1.8.orig/Krb5.pm Krb5-1.8.patched/Krb5.pm --- Krb5-1.8.orig/Krb5.pm 2008-03-16 15:07:09.000000000 +0000 +++ Krb5-1.8.patched/Krb5.pm 2009-10-13 16:10:01.000000000 +0100 @@ -558,6 +558,47 @@ =back +=item Authen::Krb5::Creds + +Object representing a credential. + +=over 4 + +=item o starttime() + +Returns the starttime time property of the credential. + +=item o authtime() + +Returns the authtime time property of the credential. + +=item o endtime() + +Returns the endtime time property of the credential. + +=item o renew_till() + +Returns the renew_till time property of the credential. + +=item o server() + +Returns the name of the service principal the credential is for. + +=item o client() + +Returns the client principal name (will usually be identical for all +credentials in a credential cache). + +=item o ticket() + +Returns the Authen::Krb5::Ticket for this credential. + +=item o keyblock() + +Returns the keyblock of the credential. + +=back + =head1 AUTHOR Jeff Horwitz (jeff@smashing.org) diff -ru Krb5-1.8.orig/Krb5.xs Krb5-1.8.patched/Krb5.xs --- Krb5-1.8.orig/Krb5.xs 2008-03-16 15:06:47.000000000 +0000 +++ Krb5-1.8.patched/Krb5.xs 2009-10-13 16:12:28.000000000 +0100 @@ -1286,6 +1286,123 @@ MODULE = Authen::Krb5 PACKAGE = Authen::Krb5::Creds +krb5_timestamp +starttime(cred) + Authen::Krb5::Creds cred + + CODE: + if (!cred->times.starttime) + cred->times.starttime = cred->times.authtime; + RETVAL = cred->times.starttime; + + OUTPUT: + RETVAL + +krb5_timestamp +authtime(cred) + Authen::Krb5::Creds cred + + CODE: + RETVAL = cred->times.authtime; + + OUTPUT: + RETVAL + +krb5_timestamp +endtime(cred) + Authen::Krb5::Creds cred + + CODE: + RETVAL = cred->times.endtime; + + OUTPUT: + RETVAL + +krb5_timestamp +renew_till(cred) + Authen::Krb5::Creds cred + + CODE: + RETVAL = cred->times.renew_till; + + OUTPUT: + RETVAL + +char * +server(cred) + Authen::Krb5::Creds cred + + PREINIT: + krb5_error_code retval; + char *sname; + + CODE: + retval = krb5_unparse_name(context, cred->server, &sname); + if (retval) { + com_err("Authen::Krb5::Creds", retval, "while unparsing server name"); + return; + } + + RETVAL = sname; + + OUTPUT: + RETVAL + +char * +client(cred) + Authen::Krb5::Creds cred + + PREINIT: + krb5_error_code retval; + char *name; + + CODE: + retval = krb5_unparse_name(context, cred->client, &name); + if (retval) { + com_err("Authen::Krb5::Creds", retval, "while unparsing client name"); + return; + } + + RETVAL = name; + + OUTPUT: + RETVAL + +Authen::Krb5::Ticket +ticket(cred) + Authen::Krb5::Creds cred + + PREINIT: + krb5_error_code retval; + krb5_ticket *t; + + CODE: + if (!New(0,t,1,krb5_ticket)) XSRETURN_UNDEF; + + retval = krb5_decode_ticket(&cred->ticket, &t); + + RETVAL = t; + + can_free((SV *)RETVAL); + + OUTPUT: + RETVAL + +Authen::Krb5::Keyblock +keyblock(cred) + Authen::Krb5::Creds cred + + CODE: + RETVAL = &cred->keyblock; + + can_free((SV *)RETVAL); + + OUTPUT: + RETVAL + +# TODO: Authen::Krb5::Address +# addresses(cred) + void DESTROY(creds) Authen::Krb5::Creds creds
Subject: kls
Download kls
application/x-perl 6.4k

Message body not shown because it is not plain text.

This appears to have been added in the 1.9 release