summaryrefslogtreecommitdiff
path: root/perl/Wallet
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-12-01 02:26:31 +0000
committerRuss Allbery <rra@stanford.edu>2007-12-01 02:26:31 +0000
commite0af03a54282129355d127f2787ed5516062e695 (patch)
treea3f2423624d62cfbc6fa9d57bffd202c4be949e0 /perl/Wallet
parent62f4dc22e3d9739c93c2b29acfdefb34afc448a2 (diff)
Make sure we always have a valid object and access to our database
handle when calling kadmin so that we can do our database handle mangling.
Diffstat (limited to 'perl/Wallet')
-rw-r--r--perl/Wallet/Object/Keytab.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/perl/Wallet/Object/Keytab.pm b/perl/Wallet/Object/Keytab.pm
index 1189150..7725241 100644
--- a/perl/Wallet/Object/Keytab.pm
+++ b/perl/Wallet/Object/Keytab.pm
@@ -65,7 +65,7 @@ sub kadmin {
# Don't use die here; it will get trapped as an exception. Also be
# careful about our database handles. (We still lose if there's some
# other database handle open we don't know about.)
- $self->{dbh}->{InactiveDestroy} = 0 if ref $self;
+ $self->{dbh}->{InactiveDestroy} = 0;
unless (open (STDERR, '>&STDOUT')) {
warn "wallet: cannot dup stdout: $!\n";
exit 1;
@@ -617,7 +617,9 @@ sub attr_show {
# caller.
sub create {
my ($class, $type, $name, $dbh, $creator, $host, $time) = @_;
- $class->kadmin_addprinc ($name);
+ my $self = { dbh => $dbh };
+ bless $self, $class;
+ $self->kadmin_addprinc ($name);
return $class->SUPER::create ($type, $name, $dbh, $creator, $host, $time);
}