summaryrefslogtreecommitdiff
path: root/perl/Wallet/Kadmin/Heimdal.pm
diff options
context:
space:
mode:
authorJon Robertson <jonrober@stanford.edu>2010-01-21 20:53:20 -0800
committerJon Robertson <jonrober@stanford.edu>2010-01-21 21:17:16 -0800
commit854063db2095fac8079260b414714d239221fdff (patch)
treef363307f6a503f1cd7b9cdce12afd09ade8b718a /perl/Wallet/Kadmin/Heimdal.pm
parent42ff8edd0059988c5fa9af98ead4c19b3b52b37a (diff)
Removed valid_principal as a Kadmin API function
valid_principal has been removed from Wallet::Kadmin and Wallet::Kadmin::Heimdal. An accessor for it in Wallet::Object::Keytab has also been removed, as have the tests in perl/t/keytab.t for the function. It still remains within Wallet::Kadmin::MIT and is used there, but only as a private method for flagging what the kadmin command-line interface cannot handle.
Diffstat (limited to 'perl/Wallet/Kadmin/Heimdal.pm')
-rw-r--r--perl/Wallet/Kadmin/Heimdal.pm21
1 files changed, 1 insertions, 20 deletions
diff --git a/perl/Wallet/Kadmin/Heimdal.pm b/perl/Wallet/Kadmin/Heimdal.pm
index a8859bf..a05362e 100644
--- a/perl/Wallet/Kadmin/Heimdal.pm
+++ b/perl/Wallet/Kadmin/Heimdal.pm
@@ -21,21 +21,12 @@ use Wallet::Config ();
# This version should be increased on any code change to this module. Always
# use two digits for the minor version with a leading zero if necessary so
# that it will sort properly.
-$VERSION = '0.01';
+$VERSION = '0.02';
##############################################################################
# kadmin Interaction
##############################################################################
-# Make sure that principals are well-formed and don't contain characters that
-# will cause us problems when talking to kadmin. Takes a principal and
-# returns true if it's okay, false otherwise. Note that we do not permit
-# realm information here.
-sub valid_principal {
- my ($self, $principal) = @_;
- return scalar ($principal =~ m,^[\w-]+(/[\w_.-]+)?\z,);
-}
-
# Create a Heimdal::Kadm5 client object and return it. It should load
# configuration from Wallet::Config.
sub kadmin_client {
@@ -62,7 +53,6 @@ sub kadmin_client {
# so, false otherwise. Throws an exception if an error.
sub exists {
my ($self, $principal) = @_;
- return unless $self->valid_principal ($principal);
if ($Wallet::Config::KEYTAB_REALM) {
$principal .= '@' . $Wallet::Config::KEYTAB_REALM;
}
@@ -76,9 +66,6 @@ sub exists {
# undef.
sub addprinc {
my ($self, $principal) = @_;
- unless ($self->valid_principal ($principal)) {
- die "invalid principal name $principal\n";
- }
my $exists = eval { $self->exists ($principal) };
if ($Wallet::Config::KEYTAB_REALM) {
@@ -117,9 +104,6 @@ sub addprinc {
# error.
sub ktadd {
my ($self, $principal, $file, @enctypes) = @_;
- unless ($self->valid_principal ($principal)) {
- die "invalid principal name: $principal\n";
- }
if ($Wallet::Config::KEYTAB_REALM) {
$principal .= '@' . $Wallet::Config::KEYTAB_REALM;
}
@@ -164,9 +148,6 @@ sub ktadd {
# exist, return success; we're bringing reality in line with our expectations.
sub delprinc {
my ($self, $principal) = @_;
- unless ($self->valid_principal ($principal)) {
- die "invalid principal name: $principal\n";
- }
my $exists = eval { $self->exists ($principal) };
die $@ if $@;
if (not $exists) {