Commit 61ef051f authored by Russ Allbery's avatar Russ Allbery
Browse files

Use _exit when failing to fork external commands

Failed kadmin commands were deleting the wallet database in the
test suite due to an END block in the test programs.  Use _exit
to avoid this.
parent 42379251
......@@ -16,6 +16,7 @@ use strict;
use warnings;
use vars qw(@ISA $VERSION);
use POSIX qw(_exit);
use Wallet::ACL::Base;
use Wallet::Config;
......@@ -59,11 +60,11 @@ sub check {
} elsif ($pid == 0) {
unless (open (STDERR, '>&STDOUT')) {
warn "wallet: cannot dup stdout: $!\n";
exit 1;
_exit(1);
}
unless (exec ($Wallet::Config::EXTERNAL_COMMAND, @args)) {
warn "wallet: cannot run $Wallet::Config::EXTERNAL_COMMAND: $!\n";
exit 1;
_exit(1);
}
}
local $_;
......
......@@ -18,6 +18,7 @@ use strict;
use warnings;
use vars qw(@ISA $VERSION);
use POSIX qw(_exit);
use Wallet::Config ();
use Wallet::Kadmin ();
......@@ -65,11 +66,11 @@ sub kadmin {
$self->{fork_callback} () if $self->{fork_callback};
unless (open (STDERR, '>&STDOUT')) {
warn "wallet: cannot dup stdout: $!\n";
exit 1;
_exit(1);
}
unless (exec ($Wallet::Config::KEYTAB_KADMIN, @args)) {
warn "wallet: cannot run $Wallet::Config::KEYTAB_KADMIN: $!\n";
exit 1;
_exit(1);
}
}
local $_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment