# Decide whether we have the configuration to run the tests.
if (-f "$DATA/test.keytab" and -f "$DATA/test.principal") {
- plan tests => 89;
+ plan tests => 92;
} else {
plan skip_all => 'no keytab configuration';
exit 0;
is ($err, '', ' with no errors');
ok (!-f 'krb5cc_test', ' and the default cache file was not created');
+# Test propagation of exit status from a command which is killed by signal.
+unlink 'krb5cc_test';
+($out, $err, $status)
+ = command ($K5START, '-Uqf', "$DATA/test.keytab", '--', 'sh', '-c',
+ 'kill $$');
+is ($status, 143, 'k5start of kill $$ returns correct exit status');
+is ($err, '', ' with no errors');
+ok (!-f 'krb5cc_test', ' and the default cache file was not created');
+
# Clean up.
unlink 'krb5cc_test';
return -1;
if (result == 0)
return 0;
- *status = WEXITSTATUS(*status);
+
+ if (status) {
+ if (WIFEXITED(*status))
+ *status = WEXITSTATUS(*status);
+ else if (WIFSIGNALED(*status))
+ // +128 to match exit status set by bash when process is signaled
+ *status = WTERMSIG(*status) + 128;
+ }
+
return 1;
}