The branch, master has been updated via 7c7455926d9 ctdb-tests: Fix CID 1659221 - Error handling issues (CHECKED_RETURN) via 014a1bd981a ctdb-tcp: Fix CID 1291643 - Resource leak (RESOURCE_LEAK) via e8e118e5b38 ctdb-tests: Fix CID 1373387 - Time of check time of use (TOCTOU) from 7e91ad47108 gitignore: remove clang-format
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 7c7455926d9163286d9bf0e5cb3c3f2032e88bcd Author: Martin Schwenke <mschwe...@ddn.com> Date: Sat Jul 26 12:22:55 2025 +1000 ctdb-tests: Fix CID 1659221 - Error handling issues (CHECKED_RETURN) Signed-off-by: Martin Schwenke <mschwe...@ddn.com> Reviewed-by: Anoop C S <anoo...@samba.org> Autobuild-User(master): Anoop C S <anoo...@samba.org> Autobuild-Date(master): Mon Jul 28 06:45:51 UTC 2025 on atb-devel-224 commit 014a1bd981accc8aad0a81375b032ba33c25569d Author: Martin Schwenke <mschwe...@ddn.com> Date: Sun Jun 1 11:05:31 2025 +1000 ctdb-tcp: Fix CID 1291643 - Resource leak (RESOURCE_LEAK) Signed-off-by: Martin Schwenke <mschwe...@ddn.com> Reviewed-by: Anoop C S <anoo...@samba.org> commit e8e118e5b38fe86c038b1ed1c2e0815923d13008 Author: Martin Schwenke <mar...@meltin.net> Date: Fri Oct 7 14:30:19 2016 +1100 ctdb-tests: Fix CID 1373387 - Time of check time of use (TOCTOU) Coverity doesn't like the fopen(3) after stat(2). This is test code that runs in a simple test environment, so this doesn't really matter. However, reorder the code to put the stat(2) after the fopen(3). This means that the test still does all the same checks and it should now make Coverity happy. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Anoop C S <anoo...@samba.org> ----------------------------------------------------------------------- Summary of changes: ctdb/tcp/tcp_connect.c | 1 + ctdb/tests/src/pidfile_test.c | 8 ++++---- ctdb/tests/src/tunable_test.c | 5 ++++- 3 files changed, 9 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c index d69c196dbe4..e508e9aba1a 100644 --- a/ctdb/tcp/tcp_connect.c +++ b/ctdb/tcp/tcp_connect.c @@ -578,6 +578,7 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb) } TALLOC_FREE(ips_ctx); + close(lock_fd); if (i == ctdb->num_nodes) { D_ERR("Unable to bind to any node address - giving up\n"); diff --git a/ctdb/tests/src/pidfile_test.c b/ctdb/tests/src/pidfile_test.c index 592fc2b934a..5229ac2c02c 100644 --- a/ctdb/tests/src/pidfile_test.c +++ b/ctdb/tests/src/pidfile_test.c @@ -38,10 +38,6 @@ static void test1(const char *pidfile) assert(ret == 0); assert(pid_ctx != NULL); - ret = stat(pidfile, &st); - assert(ret == 0); - assert(S_ISREG(st.st_mode)); - fp = fopen(pidfile, "r"); assert(fp != NULL); ret = fscanf(fp, "%d", &pid); @@ -49,6 +45,10 @@ static void test1(const char *pidfile) assert(pid == getpid()); fclose(fp); + ret = stat(pidfile, &st); + assert(ret == 0); + assert(S_ISREG(st.st_mode)); + TALLOC_FREE(pid_ctx); ret = stat(pidfile, &st); diff --git a/ctdb/tests/src/tunable_test.c b/ctdb/tests/src/tunable_test.c index 748b31e2372..f70fe609385 100644 --- a/ctdb/tests/src/tunable_test.c +++ b/ctdb/tests/src/tunable_test.c @@ -51,7 +51,10 @@ int main(int argc, const char **argv) mem_ctx = talloc_new(NULL); assert(mem_ctx != NULL); - logging_init(mem_ctx, "file:", NULL, "tunable_test"); + ret = logging_init(mem_ctx, "file:", NULL, "tunable_test"); + if (ret != 0) { + fprintf(stderr, "%s: error initialising logging\n", argv[0]); + } ctdb_tunable_set_defaults(&tun_list); -- Samba Shared Repository