Skip to content

Commit

Permalink
fix: some open AF_UNIX sockets in forked child processes
Browse files Browse the repository at this point in the history
  • Loading branch information
Boquan Fang committed Oct 9, 2024
1 parent 66a3bcb commit d305f6f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/unit/s2n_examples_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ static S2N_RESULT s2n_run_self_talk_test(s2n_test_scenario scenario_fn)
EXPECT_SUCCESS(s2n_cert_chain_and_key_free(chain_and_key));
EXPECT_SUCCESS(s2n_config_free(config));
EXPECT_SUCCESS(s2n_free(&input));
EXPECT_SUCCESS(s2n_io_pair_close_one_end(&io_pair, S2N_CLIENT));

exit(EXIT_SUCCESS);
}
Expand All @@ -273,6 +274,7 @@ static S2N_RESULT s2n_run_self_talk_test(s2n_test_scenario scenario_fn)
EXPECT_SUCCESS(s2n_cert_chain_and_key_free(chain_and_key));
EXPECT_SUCCESS(s2n_config_free(config));
EXPECT_SUCCESS(s2n_free(&input));
EXPECT_SUCCESS(s2n_io_pair_close_one_end(&io_pair, S2N_SERVER));

exit(EXIT_SUCCESS);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/s2n_ktls_io_sendfile_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int main(int argc, char **argv)
EXPECT_NOT_NULL(conn);
conn->ktls_send_enabled = true;

DEFER_CLEANUP(struct s2n_test_io_pair io_pair = { 0 }, s2n_io_pair_close);
DEFER_CLEANUP(struct s2n_test_io_pair io_pair = { 0 });
EXPECT_SUCCESS(s2n_io_pair_init_non_blocking(&io_pair));
int write_fd = io_pair.server;
int read_fd = io_pair.client;
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/s2n_release_non_empty_buffers_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ int mock_client(struct s2n_test_io_pair *io_pair)
s2n_connection_free(conn);
s2n_config_free(client_config);
s2n_cleanup();
EXPECT_SUCCESS(s2n_io_pair_close_one_end(io_pair, S2N_CLIENT));

exit(0);
}
Expand Down Expand Up @@ -196,6 +197,7 @@ int main(int argc, char **argv)
free(private_key_pem);

s2n_cleanup();
EXPECT_SUCCESS(s2n_io_pair_close_one_end(&io_pair, S2N_SERVER));

END_TEST();

Expand Down
1 change: 1 addition & 0 deletions tests/unit/s2n_self_talk_broken_pipe_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void mock_client(struct s2n_test_io_pair *io_pair)
sleep(1);

s2n_io_pair_shutdown_one_end(io_pair, S2N_CLIENT, SHUT_WR);
EXPECT_SUCCESS(s2n_io_pair_close_one_end(io_pair, S2N_CLIENT));

exit(0);
}
Expand Down

0 comments on commit d305f6f

Please sign in to comment.