diff options
Diffstat (limited to 'perl/Wallet')
| -rw-r--r-- | perl/Wallet/ACL/NetDB.pm | 18 | ||||
| -rw-r--r-- | perl/Wallet/Object/Keytab.pm | 4 | 
2 files changed, 16 insertions, 6 deletions
| diff --git a/perl/Wallet/ACL/NetDB.pm b/perl/Wallet/ACL/NetDB.pm index ad706b3..cc7121b 100644 --- a/perl/Wallet/ACL/NetDB.pm +++ b/perl/Wallet/ACL/NetDB.pm @@ -24,7 +24,7 @@ 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.02'; +$VERSION = '0.03';  ##############################################################################  # Interface @@ -46,10 +46,20 @@ sub new {          die "NetDB ACL support not available: $error\n";      }      local $ENV{KRB5CCNAME} = $Wallet::Config::NETDB_REMCTL_CACHE; -    my $port = $Wallet::Config::NETDB_REMCTL_PORT; -    my $principal = $Wallet::Config::NETDB_REMCTL_PRINCIPAL;      my $remctl = Net::Remctl->new; -    unless ($remctl->open ($host, $port, $principal)) { + +    # Net::Remctl 2.12 and later will support passing in an empty string for +    # the principal.  Until then, be careful not to pass principal unless it +    # was specified. +    my $port = $Wallet::Config::NETDB_REMCTL_PORT || 0; +    my $principal = $Wallet::Config::NETDB_REMCTL_PRINCIPAL; +    my $status; +    if (defined $principal) { +        $status = $remctl->open ($host, $port, $principal); +    } else { +        $status = $remctl->open ($host, $port); +    } +    unless ($status) {          die "cannot connect to NetDB remctl interface: ", $remctl->error, "\n";      }      my $self = { remctl => $remctl }; diff --git a/perl/Wallet/Object/Keytab.pm b/perl/Wallet/Object/Keytab.pm index e2c21a4..34fa12d 100644 --- a/perl/Wallet/Object/Keytab.pm +++ b/perl/Wallet/Object/Keytab.pm @@ -511,8 +511,8 @@ sub keytab_retrieve {          $keytab .= '@' . $Wallet::Config::KEYTAB_REALM;      }      local $ENV{KRB5CCNAME} = $Wallet::Config::KEYTAB_REMCTL_CACHE; -    my $port = $Wallet::Config::KEYTAB_REMCTL_PORT; -    my $principal = $Wallet::Config::KEYTAB_REMCTL_PRINCIPAL; +    my $port = $Wallet::Config::KEYTAB_REMCTL_PORT || 0; +    my $principal = $Wallet::Config::KEYTAB_REMCTL_PRINCIPAL || '';      my @command = ('keytab', 'retrieve', $keytab);      my $result = Net::Remctl::remctl ($host, $port, $principal, @command);      if ($result->error) { | 
