]> eyrie.org Git - kerberos/kstart.git/commitdiff
NEWS entry and test suite for k5start exit changes
authorRuss Allbery <rra@stanford.edu>
Mon, 30 Apr 2012 20:11:18 +0000 (13:11 -0700)
committerRuss Allbery <rra@stanford.edu>
Mon, 30 Apr 2012 20:11:18 +0000 (13:11 -0700)
NEWS
tests/k5start/daemon-t

diff --git a/NEWS b/NEWS
index aea3b6f9dab7a8e2bf5ea332db7dc7f99cf82148..2f6c7917af79bbb15321dbd72380bd78621b16c2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@
 
 kstart 4.2 (unreleased)
 
+    k5start, when run with the -K option to run as a daemon, no longer
+    exits if the initial authentication fails (unless -x was given).
+    Instead, it reports the error to standard error and then continues to
+    run, attempting authentication every minute as if authentication had
+    failed after it had started.  Patch from Rasmus Borup Hansen.
+
     If -i is given to krenew and the initial ticket renewal failed, start
     with the shorter wake-up interval of one minute just as if a
     subsequent renewal failed.  Patch from Rasmus Borup Hansen.
index 321311d08241aeff130783f2eba0b14c82733c71..ede4b193c7da3c75bec835772ae7a9b5114d727b 100755 (executable)
@@ -108,6 +108,35 @@ kill (15, $pid) or warn "Can't kill $pid: $!\n";
 select (undef, undef, undef, 0.2);
 ok (!-f "$TMP/pid", ' and the PID file was removed');
 
+# Try again with an initial authentication failure and ensure that k5start
+# keeps running anyway.
+unlink "$TMP/krb5cc_test";
+($out, $err, $status)
+    = command ($K5START, '-bK', 1, '-f', "$DATA/test.keytab-BAD", '-p',
+               "$TMP/pid", $principal);
+is ($status, 0, 'Backgrounding k5start with bad keytab works');
+like ($err, qr/^k5start: error getting credentials: /, ' with error output');
+is ($out, '', ' and -q was added implicitly');
+$pid = contents ("$TMP/pid");
+ok (kill (0, $pid), ' and the PID file is correct');
+kill (15, $pid) or warn "Can't kill $pid: $!\n";
+select (undef, undef, undef, 0.2);
+ok (!-f "$TMP/pid", ' and the PID file was removed');
+
+# Providing -x should override that behavior and cause the daemon to refuse
+# to start.
+unlink "$TMP/krb5cc_test";
+($out, $err, $status)
+    = command ($K5START, '-bxK', 1, '-f', "$DATA/test.keytab-BAD", '-p',
+               "$TMP/pid", $principal);
+is ($status, 1, 'Backgrounding k5start -x with bad keytab fails');
+like ($err, qr/^k5start: error getting credentials: /, ' with error output');
+is ($out, '', ' and -q was added implicitly');
+if ($status == 0) {
+    $pid = contents ("$TMP/pid");
+    kill (15, $pid) or warn "Can't kill $pid: $!\n";
+}
+
 # Check that k5start keeps running if the ticket cache directory is not
 # writeable.
 $pid = fork;