kadmin: Support heredocs better to speed up tests

Now we can use heredocs to execute multiple kadmin commands with just
one `execve()`:

```
${kadmin} <<EOF || exit 1
init ...
add ...
...
EOF
```

This will allow tests to use heredocs in setting up an HDB so as to go a
bit faster.
This commit is contained in:
Nicolas Williams
2022-12-07 21:26:01 -06:00
parent 1c4902378f
commit 9fb46adf97

View File

@@ -296,10 +296,13 @@ main(int argc, char **argv)
} else {
while(!exit_seen) {
ret = sl_command_loop(commands, "kadmin> ", NULL);
if (ret == -2)
if (ret == -2) {
exit_seen = 1;
else if (ret != 0)
} else if (ret != 0) {
exit_status = 1;
if (!isatty(STDIN_FILENO))
exit_seen = 1;
}
}
}