aboutsummaryrefslogtreecommitdiff
path: root/perl/lib
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2016-01-03 21:26:28 -0800
committerRuss Allbery <eagle@eyrie.org>2016-01-03 21:26:28 -0800
commit61ef051f79682742a30d1501b81cd86ed172fa3c (patch)
tree88a608cf1e3cbdf1d74a32c432b2d71bb0076239 /perl/lib
parent423792510f017d36580eb6d96342f6d09433a078 (diff)
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.
Diffstat (limited to 'perl/lib')
-rw-r--r--perl/lib/Wallet/ACL/External.pm5
-rw-r--r--perl/lib/Wallet/Kadmin/MIT.pm5
2 files changed, 6 insertions, 4 deletions
diff --git a/perl/lib/Wallet/ACL/External.pm b/perl/lib/Wallet/ACL/External.pm
index 76d0891..77c2499 100644
--- a/perl/lib/Wallet/ACL/External.pm
+++ b/perl/lib/Wallet/ACL/External.pm
@@ -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 $_;
diff --git a/perl/lib/Wallet/Kadmin/MIT.pm b/perl/lib/Wallet/Kadmin/MIT.pm
index ac45265..c5dea23 100644
--- a/perl/lib/Wallet/Kadmin/MIT.pm
+++ b/perl/lib/Wallet/Kadmin/MIT.pm
@@ -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 $_;