Skip to content

Commit

Permalink
fix: some open AF_UNIX sockets in forked child processes (#4834)
Browse files Browse the repository at this point in the history
  • Loading branch information
boquan-fang authored Oct 14, 2024
1 parent 21656e3 commit eec5713
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
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
1 change: 1 addition & 0 deletions tests/unit/s2n_key_update_threads_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ static S2N_RESULT s2n_run_self_talk_test(s2n_test_scenario scenario_fn)
EXPECT_SUCCESS(s2n_connection_free(client));
EXPECT_SUCCESS(s2n_cert_chain_and_key_free(chain_and_key));
EXPECT_SUCCESS(s2n_config_free(config));
EXPECT_SUCCESS(s2n_io_pair_close_one_end(&io_pair, S2N_CLIENT));

exit(EXIT_SUCCESS);
}
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 @@ -58,6 +58,7 @@ int mock_client(struct s2n_test_io_pair *io_pair)
s2n_shutdown(conn, &blocked);
s2n_connection_free(conn);
s2n_config_free(client_config);
EXPECT_SUCCESS(s2n_io_pair_close_one_end(io_pair, S2N_CLIENT));
s2n_cleanup();

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

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

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);
s2n_io_pair_close_one_end(io_pair, S2N_CLIENT);

exit(0);
}
Expand Down

0 comments on commit eec5713

Please sign in to comment.