Authen::Krb5::KDB - Parse Kerberos V5 database dumps
use Authen::Krb5::KDB; $db = Authen::Krb5::KDB->new( file => 'slave_datatrans' ); while ($p = $db->next) { print "Found" if ($p->name eq 'foo@TEST.ORG'); } $db->close; use Authen::Krb5::KDB; $db = Authen::Krb5::KDB->new( realm => 'TEST.ORG' ); $db->read; $db->close; $policies = $db->policies; foreach my $p (@{$policies}) { $p->print_policy; }
Constructor and methods to parse Kerberos V5 database files, either directly from kerberos (via kdb5_util) or from already dumped files (e.g. slave_datatrans).
Open the database file and return a new database object. You can either read from a file or read directly from Kerberos (done via "kdb5_util -r <realm> dump |"; this is the default).
Arguments are:
realm => <realm_name>
The realm which should be extracted via kdb5_util. This is ignored if you use the file argument.
file => <filename>
Read from a file instead of Kerberos directly.
checks => <level>
Data checking level. Level 0 means no checks; level 1 (the default) does basic checks like checking that the lengths in the records are correct; level 2 does much further consistency checks on the data.
save => 1
Save the principal objects in the database object. Normally the objects are not saved for space considerations. Note that policy objects are always kept.
Returns the next principal or policy object.
Reads all principals and policies. The objects are saved in the database object.
Returns a reference to array of principal objects
Returns a reference to array of policy objects
Closes FH to database. It's especially important to call close when reading directly via kdb5_util to make sure there are no errors from the pipe.
close
Dave Steiner, <steiner@bakerst.rutgers.edu>
Copyright (c) 2002 David K. Steiner. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl(1), kerberos(1), Authen::Krb5::KDB::V5, Authen::Krb5::KDB::V4, Authen::Krb5::KDB::V3, Authen::Krb5::KDB::V2, Authen::Krb5::KDB_H.
To install Authen::Krb5::KDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Authen::Krb5::KDB
CPAN shell
perl -MCPAN -e shell install Authen::Krb5::KDB
For more information on module installation, please visit the detailed CPAN module installation guide.