aboutsummaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-05-18 16:47:31 -0700
committerRuss Allbery <rra@stanford.edu>2010-05-18 16:47:31 -0700
commit1e28788f0b0f5cae3dd815f07d39ad70e7da0ce2 (patch)
tree670fe3c909fc8c4bcc8baba2b1878dbe21c461fc /perl
parent4dbf126b079d87639d0a463770c3e72b5b53d5d1 (diff)
Fix error handling for klist with Heimdal user space
The check for the enctypes of created keytabs tries klist for MIT first and then Heimdal ktutil. The klist options are invalid for Heimdal. Suppress the resulting complaining to standard error.
Diffstat (limited to 'perl')
-rwxr-xr-xperl/t/keytab.t10
1 files changed, 8 insertions, 2 deletions
diff --git a/perl/t/keytab.t b/perl/t/keytab.t
index b16cea5..fabdc5b 100755
--- a/perl/t/keytab.t
+++ b/perl/t/keytab.t
@@ -103,8 +103,14 @@ sub enctypes {
close KEYTAB;
my @enctypes;
- open (KLIST, '-|', 'klist', '-ke', 'keytab')
- or die "cannot run klist: $!\n";
+ my $pid = open (KLIST, '-|');
+ if (not defined $pid) {
+ die "cannot fork: $!\n";
+ } elsif ($pid == 0) {
+ open (STDERR, '>', '/dev/null') or die "cannot reopen stderr: $!\n";
+ exec ('klist', '-ke', 'keytab')
+ or die "cannot run klist: $!\n";
+ }
local $_;
while (<KLIST>) {
next unless /^ *\d+ /;