Skip to content

Commit

Permalink
swtpm: Don't set END_ON_HUP flag in CMD_SET_DATAFD handler
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nchevsky authored and stefanberger committed Sep 21, 2021
1 parent ca4ee25 commit 1e2a6d9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/swtpm/ctrlchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1e2a6d9

Please sign in to comment.