swtpm: Don't set END_ON_HUP flag in CMD_SET_DATAFD handler

Don't set flag MAIN_LOOP_FLAG_END_ON_HUP in the handler for control
channel command CMD_SET_DATAFD, since this caused the swtpm daemon to
unconditionally terminate when the data channel connection dropped.
Removing the flag allows this behavior to be controlled by the user
via the --terminate command-line switch, as it was meant to be.

Signed-off-by: Nick Chevsky <nchevsky@users.noreply.github.com>
This commit is contained in:
Nick Chevsky 2021-09-18 16:23:55 -05:00 committed by Stefan Berger
parent ca4ee25ce7
commit 1e2a6d99cd

View File

@ -790,8 +790,7 @@ int ctrlchannel_process_fd(int fd,
goto err_bad_input;
}
mlp->flags |= MAIN_LOOP_FLAG_USE_FD | MAIN_LOOP_FLAG_KEEP_CONNECTION |
MAIN_LOOP_FLAG_END_ON_HUP;
mlp->flags |= MAIN_LOOP_FLAG_USE_FD | MAIN_LOOP_FLAG_KEEP_CONNECTION;
mlp->fd = *data_fd;
*res_p = htobe32(TPM_SUCCESS);