]> eyrie.org Git - kerberos/perl-kerberos.git/commitdiff
Add password_expiration method to ::Kadmin::Entry
authorRuss Allbery <rra@cpan.org>
Thu, 17 Apr 2014 00:51:46 +0000 (17:51 -0700)
committerRuss Allbery <rra@cpan.org>
Thu, 17 Apr 2014 00:51:46 +0000 (17:51 -0700)
lib/Authen/Kerberos/Kadmin.xs
lib/Authen/Kerberos/Kadmin/Entry.pm
t/kadmin/heimdal.t

index 933dd564029480b2bbdc35212dc20da75c4cd60f..499e667c90849a85ac2d3fcfe4e02eff552db015 100644 (file)
@@ -318,3 +318,16 @@ last_password_change(self)
 }
   OUTPUT:
     RETVAL
+
+
+krb5_timestamp
+password_expiration(self)
+    Authen::Kerberos::Kadmin::Entry self
+  CODE:
+{
+    CROAK_NULL_SELF(self, "Authen::Kerberos::Kadmin::Entry",
+                    "password_expiration");
+    RETVAL = self->ent->pw_expiration;
+}
+  OUTPUT:
+    RETVAL
index 6e5066a938b0bf61800288d2f43e9ea917ed0019..faac2d9b08335f5053449997df39bb1d95413ee8 100644 (file)
@@ -94,6 +94,12 @@ Returns the last password change time for this database entry in seconds
 since UNIX epoch, or C<0> if there is no password change information
 available.
 
+=item password_expiration
+
+Returns the password expiration time for this database entry in seconds
+since UNIX epoch, or C<0> if this principal does not have a password
+expiration set.
+
 =back
 
 =head1 AUTHOR
index 162d5425bf7d8f3a3d5354756bea4e770b750ada..a1ffc0938a995f462468dd031ae74a327e0604f5 100755 (executable)
@@ -31,7 +31,7 @@ use warnings;
 
 use File::Copy qw(copy);
 
-use Test::More tests => 13;
+use Test::More tests => 14;
 
 BEGIN {
     use_ok('Authen::Kerberos::Kadmin');
@@ -66,6 +66,7 @@ isa_ok($kadmin, 'Authen::Kerberos::Kadmin');
 my $entry = $kadmin->get('test@TEST.EXAMPLE.COM');
 isa_ok($entry, 'Authen::Kerberos::Kadmin::Entry');
 is($entry->last_password_change, 1_393_043_331, 'Last password change time');
+is($entry->password_expiration,  0,             'No password expiration');
 
 # Test password change.  At the moment, we don't check whether the password
 # change is performed in the database.  We'll do that later.