[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f749330ddab lib: Fix CID 1620428: Memory - illegal accesses (OVERRUN) from 7d255e5c233 lib/addns: match additional names in a non case insensitive way https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f749330ddaba04cdae20570a9e842327715f3594 Author: Volker Lendecke Date: Sun Sep 29 08:13:04 2024 +0200 lib: Fix CID 1620428: Memory - illegal accesses (OVERRUN) Beginner's mistake, sorry. Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sun Sep 29 11:49:13 UTC 2024 on atb-devel-224 --- Summary of changes: libcli/smb/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/libcli/smb/util.c b/libcli/smb/util.c index a864a1078cd..473b479a2ab 100644 --- a/libcli/smb/util.c +++ b/libcli/smb/util.c @@ -176,7 +176,7 @@ static mode_t unix_filetypes[] = mode_t wire_filetype_to_unix(uint32_t wire_type) { - if (wire_type > ARRAY_SIZE(unix_filetypes)) { + if (wire_type >= ARRAY_SIZE(unix_filetypes)) { return (mode_t)0; } return unix_filetypes[wire_type]; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 03e880931d0 doc: Update doc about talloc vs malloc speed via a66db6c16e4 lib:talloc: Use tabs to align output in speed test via 39c13f062a8 lib:talloc: Increase alloc size to 128 kilobytes via 00d5982da2f lib:talloc: Don't optimize the speed test via b6bf9cba80e lib:talloc: Add talloc_zero vs calloc test via 8dddea2ceda lib:talloc: Use memset_s() to avoid the call gets optimized out via 6812e30be35 lib:talloc: Remove trailing spaces from testsuite.c from 20a3a94e06a lib:ldb: Document environment variables in ldb manpage https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 03e880931d0a6171826f5ffc33e7b4d86eea54a6 Author: Andreas Schneider Date: Wed Mar 29 11:04:38 2023 +0200 doc: Update doc about talloc vs malloc speed Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sat Sep 28 01:20:01 UTC 2024 on atb-devel-224 commit a66db6c16e4225e200da7f6f939b756026cee61f Author: Andreas Schneider Date: Thu Apr 27 11:31:07 2023 +0200 lib:talloc: Use tabs to align output in speed test Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke commit 39c13f062a859d17b5be3a2a02fece8d0b1819f1 Author: Andreas Schneider Date: Thu Apr 27 11:24:59 2023 +0200 lib:talloc: Increase alloc size to 128 kilobytes We want to avoid that the optimizer will use stack allocations. This way the test should be a bit more realistic. Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke commit 00d5982da2f5f2595b634b957c7d0b990e12b37b Author: Andreas Schneider Date: Mon Apr 17 09:25:48 2023 +0200 lib:talloc: Don't optimize the speed test If the speed test gets optimized, the malloc() and free() might be replaced by stack allocations. Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke commit b6bf9cba80e55ca5aac3611e55dc952782c867c7 Author: Andreas Schneider Date: Fri Apr 14 21:34:59 2023 +0200 lib:talloc: Add talloc_zero vs calloc test Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke commit 8dddea2ceda40f2365bd6b1a62826b84dc523b74 Author: Andreas Schneider Date: Tue Feb 13 09:22:56 2024 +0100 lib:talloc: Use memset_s() to avoid the call gets optimized out Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke commit 6812e30be35508db3ac23406243fe08da9cf3084 Author: Andreas Schneider Date: Tue Feb 6 18:03:22 2024 +0100 lib:talloc: Remove trailing spaces from testsuite.c Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke --- Summary of changes: lib/talloc/doc/mainpage.dox | 10 ++-- lib/talloc/man/talloc.3.xml | 12 ++-- lib/talloc/talloc_guide.txt | 11 ++-- lib/talloc/testsuite.c | 142 ++-- lib/talloc/wscript | 2 +- 5 files changed, 114 insertions(+), 63 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/talloc/doc/mainpage.dox b/lib/talloc/doc/mainpage.dox index ece6ccb8f0c..d881e503a43 100644 --- a/lib/talloc/doc/mainpage.dox +++ b/lib/talloc/doc/mainpage.dox @@ -69,11 +69,11 @@ * @section talloc_performance Performance * * All the additional features of talloc() over malloc() do come at a price. We - * have a simple performance test in Samba4 that measures talloc() versus - * malloc() performance, and it seems that talloc() is about 4% slower than - * malloc() on my x86 Debian Linux box. For Samba, the great reduction in code - * complexity that we get by using talloc makes this worthwhile, especially as - * the total overhead of talloc/malloc in Samba is already quite small. + * have a performance test in Samba that measures talloc() versus malloc() + * performance, and it seems that talloc() is about 50% slower than malloc() + * (AMD Ryzen 9 3900X). For Samba, the great reduction in code complexity that + * we get by using talloc makes this worthwhile, especially as the total + * overhead of talloc/malloc in Samba is already quite small. * * @section talloc_named Named blocks * diff --git a/lib/talloc/man/talloc.3.xml b/lib/talloc/man/talloc.3.xml index c51061fce1f..e26b16dbecf 100644 --- a/lib/talloc/man/talloc.3.xml +++ b/lib/talloc/man/talloc.3.xml @@ -767,12 +767,12 @@ if (ptr) memcpy(ptr, p, strlen(p)+1); PERFORMANCE All the additional features of talloc(3) over malloc(3) do come at a - price. We have a simple performance test in Samba4 that measures - talloc() versus malloc() performance, and it seems that talloc() is - about 10% slower than malloc() on my x86 Debian Linux box. For - Samba, the great reducti
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 4f3dfb2029c s3: SIGHUP handlers use consistent log level 3 from bb12f19e4fe samba-tool: Fix for inability to delete GPOs containing GPWL policies https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 4f3dfb2029c667b6dcd43223fe154dca59143e95 Author: Jones Syue Date: Mon Sep 2 17:11:00 2024 +0800 s3: SIGHUP handlers use consistent log level 3 When turn-on 'log level = 3', sending SIGHUP to samba processes, for example: smbd parent/children, smbd-notifyd, and smbd-cleanupd. Then monitor log.smbd in order to parse sighup logs, it looks like the log level is inconsistent among these processes: smbd parent/children use level 1, and smbd-notifyd/smbd-cleanupd use level 3. This patch raises sighup handler's log level from level 1 to level 3, which is more consistent with smbd-notifyd by Commit 6e5bff80a0a0b ("s3:notifyd: Handle sigup in notifyd to reparse smb.conf"), and smbd-cleanupd by Commit 57c1e115ecef4 ("smbd: reopen logs on SIGHUP for notifyd and cleanupd"). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15706 Signed-off-by: Jones Syue Reviewed-by: Jeremy Allison Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Sep 25 01:38:02 UTC 2024 on atb-devel-224 --- Summary of changes: source3/printing/queue_process.c | 2 +- source3/smbd/server.c| 2 +- source3/smbd/smb2_process.c | 2 +- source3/winbindd/winbindd_dual.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c index d1e95bb083a..0f95bd736f2 100644 --- a/source3/printing/queue_process.c +++ b/source3/printing/queue_process.c @@ -221,7 +221,7 @@ static void bq_sig_hup_handler(struct tevent_context *ev, state = talloc_get_type_abort(pvt, struct bq_state); change_to_root_user(); - DEBUG(1, ("Reloading pcap cache after SIGHUP\n")); + DBG_NOTICE("Reloading pcap cache after SIGHUP\n"); pcap_cache_reload(state->ev, state->msg, reload_pcap_change_notify); printing_subsystem_queue_tasks(state); diff --git a/source3/smbd/server.c b/source3/smbd/server.c index b43d654d6a5..e6f8f584964 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1432,7 +1432,7 @@ static void smbd_parent_sig_hup_handler(struct tevent_context *ev, void *private_data) { change_to_root_user(); - DEBUG(1,("parent: Reloading services after SIGHUP\n")); + DBG_NOTICE("parent: Reloading services after SIGHUP\n"); reload_services(NULL, NULL, false); } diff --git a/source3/smbd/smb2_process.c b/source3/smbd/smb2_process.c index a4a0e8265ad..6931bfba81c 100644 --- a/source3/smbd/smb2_process.c +++ b/source3/smbd/smb2_process.c @@ -1677,7 +1677,7 @@ static void smbd_sig_hup_handler(struct tevent_context *ev, struct smbd_server_connection); change_to_root_user(); - DEBUG(1,("Reloading services after SIGHUP\n")); + DBG_NOTICE("Reloading services after SIGHUP\n"); reload_services(sconn, conn_snum_used, false); } diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index fdb66d0e1c7..d4e1995f928 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -2062,7 +2062,7 @@ static void winbindd_sig_hup_handler(struct tevent_context *ev, { const char *file = (const char *)private_data; - DEBUG(1,("Reloading services after SIGHUP\n")); + DBG_NOTICE("Reloading services after SIGHUP\n"); flush_caches_noinit(); winbindd_reload_services_file(file); } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 25a25db ctdb: Use str_list_add_printf() in lock_helper_args() via 83716809a8f ctdb: Change the ctdb_vfork_exec prototype to const char*const* via cc76e2c7d7d smbd: We can expect the file to exist in is_visible_fsp() from 81ecdb125bf auth: Fix CID 1615191 Uninitialized scalar variable https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 25a25db1779d09d8c97aee6b5d9be1c6dbe8 Author: Volker Lendecke Date: Thu Sep 19 17:32:42 2024 +0200 ctdb: Use str_list_add_printf() in lock_helper_args() Saves lines, str_list_add_printf takes care of NULL checks Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sun Sep 22 10:44:59 UTC 2024 on atb-devel-224 commit 83716809a8ff0057aa5ef58b6f951b8d5197c67f Author: Volker Lendecke Date: Fri Sep 20 02:54:57 2024 +0200 ctdb: Change the ctdb_vfork_exec prototype to const char*const* I could not find out how to cast a char ** to const char ** without warning. This transfers fine to the execv call as well. Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit cc76e2c7d7d2535a736420283a38a89f17f5c21e Author: Volker Lendecke Date: Thu Sep 19 16:09:43 2024 +0200 smbd: We can expect the file to exist in is_visible_fsp() Another leftover from symlinks in posix context to not open an fsp Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- Summary of changes: ctdb/include/ctdb_private.h | 8 ++-- ctdb/server/ctdb_fork.c | 8 ++-- ctdb/server/ctdb_lock.c | 92 - source3/smbd/dir.c | 9 - 4 files changed, 43 insertions(+), 74 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 88f775ce126..b36eaa08a08 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -609,9 +609,11 @@ int switch_from_server_to_client(struct ctdb_context *ctdb); void ctdb_track_child(struct ctdb_context *ctdb, pid_t pid); pid_t ctdb_fork(struct ctdb_context *ctdb); -pid_t ctdb_vfork_exec(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, - const char *helper, int helper_argc, - const char **helper_argv); +pid_t ctdb_vfork_exec(TALLOC_CTX *mem_ctx, + struct ctdb_context *ctdb, + const char *helper, + int helper_argc, + const char *const *helper_argv); struct tevent_signal *ctdb_init_sigchld(struct ctdb_context *ctdb); diff --git a/ctdb/server/ctdb_fork.c b/ctdb/server/ctdb_fork.c index 1065423199d..8f3e0896b32 100644 --- a/ctdb/server/ctdb_fork.c +++ b/ctdb/server/ctdb_fork.c @@ -105,9 +105,11 @@ pid_t ctdb_fork(struct ctdb_context *ctdb) /* * vfork + exec */ -pid_t ctdb_vfork_exec(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, - const char *helper, int helper_argc, - const char **helper_argv) +pid_t ctdb_vfork_exec(TALLOC_CTX *mem_ctx, + struct ctdb_context *ctdb, + const char *helper, + int helper_argc, + const char *const *helper_argv) { pid_t pid; struct timeval before; diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c index d526413454e..4231313b654 100644 --- a/ctdb/server/ctdb_lock.c +++ b/ctdb/server/ctdb_lock.c @@ -606,68 +606,39 @@ skip_lock_debug: (void *)lock_ctx); } -static bool lock_helper_args(TALLOC_CTX *mem_ctx, -struct lock_context *lock_ctx, int fd, -int *argc, const char ***argv) +static char **lock_helper_args(TALLOC_CTX *mem_ctx, + struct lock_context *lock_ctx, + int fd) { - const char **args = NULL; - int nargs = 0, i; - - switch (lock_ctx->type) { - case LOCK_RECORD: - nargs = 6; - break; - - case LOCK_DB: - nargs = 5; - break; - } - - /* Add extra argument for null termination */ - nargs++; + int tdb_flags = tdb_get_flags(lock_ctx->ctdb_db->ltdb->tdb); + char **args = str_list_make_empty(mem_ctx); - args = talloc_array(mem_ctx, const char *, nargs); - if (args == NULL) { - return false; - } + str_list_add_printf(&args, "%d", getpid()); + str_list_add_printf(&args, "%d", fd); + str_list_add_printf(&args, + "
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 574f2c3ed8d ctdb-tests: Add persistent TDB backup tests via 05da9001b9e ctdb-scripts: Add support for backing up persistent TDBs via 82250f36294 ctdb-scripts: Move database handling to its own event script via 9c354e358e5 ctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn" via b4c7a4f7f0e ctdb-scripts: Remove unused variable NFS_HOSTNAME via ece6153038b ctdb-scripts: Use nfs-utils' sm-notify instead of CTDB's smnotify via d89506449fc ctdb-failover: Add ctdb_smnotify_helper from e2c8f718cad s4:torture/smb2: better error handling in create.c https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 574f2c3ed8dde01610ad9a36d57cc30d6d0008ed Author: Martin Schwenke Date: Wed Apr 10 16:55:01 2024 +1000 ctdb-tests: Add persistent TDB backup tests Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Aug 30 00:08:41 UTC 2024 on atb-devel-224 commit 05da9001b9edc954c009be19a881626b2a763146 Author: Martin Schwenke Date: Fri Apr 5 17:12:40 2024 +1100 ctdb-scripts: Add support for backing up persistent TDBs Signed-off-by: Vinit Agnihotri Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 82250f3629424385f21d18dc65e68eb2866d3d73 Author: Martin Schwenke Date: Mon Apr 8 11:15:24 2024 +1000 ctdb-scripts: Move database handling to its own event script Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 9c354e358e59da2e0b5ad1d13d5b411458476ab3 Author: Martin Schwenke Date: Mon Apr 8 11:08:33 2024 +1000 ctdb-scripts: Reformat with "shfmt -w -p -i 0 -fn" Best reviewed with "git show -w". Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit b4c7a4f7f0e40079b7e5f13b97e33148ec995376 Author: Martin Schwenke Date: Wed May 1 10:22:05 2024 +1000 ctdb-scripts: Remove unused variable NFS_HOSTNAME This was passed to CTDB's old smnotify. This has been replaced by use of nfs-utils' sm-notify, which doesn't need this. In test, a fake NFS_HOSTNAME is still needed. Real sm-notify will get it from a reverse host lookup of the IP address. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit ece6153038b7556877ae82c1c0843175d743eff7 Author: Martin Schwenke Date: Fri Mar 3 15:44:08 2017 +1100 ctdb-scripts: Use nfs-utils' sm-notify instead of CTDB's smnotify CTDB's smnotify does not support IPv6 and is difficult to maintain. So, create directories of files and pass them to NFS util's sm-notify. There is an implied change here, because NFS utils sm-notify stopped sending IP addresses as mon_name back in 2010: http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commitdiff;h=900df0e7c0b9006d72d8459b30dc2cd69ce495a5 This will change advice given in the wiki to use a hostname for the cluster with round-robin DNS, since this is what is best supported. Another behavioural change is that sm-notify only sends "up" notifications with an odd state. Signed-off-by: Martin Schwenke Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit d89506449fc01debc4013de9afe7f5784019806f Author: Martin Schwenke Date: Wed May 10 12:21:07 2023 +1000 ctdb-failover: Add ctdb_smnotify_helper statd callout will shortly be updated to use NFS utils' sm-notify. This tiny helper will be used to create on-disk state files used by sm-notify. These state files contain endian-specific fields, so better to write a simple C implementation than to do crazy things in a shell script (or call out to Python). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- Summary of changes: ctdb/.gitignore| 3 - ctdb/config/ctdb-backup-persistent-tdbs.sh | 123 ctdb/config/events/legacy/00.ctdb.script | 107 +- ctdb/config/events/legacy/95.database.script | 156 + ctdb/doc/ctdb-script.options.5.xml | 57 +++- ctdb/doc/ctdb.1.xml| 60 ctdb/doc/examples/ctdb.spec.in | 2 + ctdb/failover/smnotify_helper.c| 81 +++ ...00.ctdb.init.001.sh => 95.database.init.001.sh} | 0 ...00.ctdb.init.002.sh => 95.database.init.002.sh} | 0 ...00.ctdb.init.003.sh => 95.database.init.003.sh} | 0 ...00.ctdb.init.004.sh => 95.database.init.004.sh} | 0 ...00.ctdb.init.005.sh => 95.data
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 8ab5a032d72 bootstrap: Migrate to Rocky8 from fab7416a3d2 idl: dnsp.h references NTTIME https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 8ab5a032d72da6dfab595c00efd8c6123a4eefcd Author: David Mulder Date: Tue Aug 27 09:32:43 2024 -0600 bootstrap: Migrate to Rocky8 Signed-off-by: David Mulder Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Aug 28 00:24:35 UTC 2024 on atb-devel-224 --- Summary of changes: .gitlab-ci-main.yml| 8 bootstrap/.gitlab-ci.yml | 2 +- bootstrap/config.py| 13 + bootstrap/generated-dists/Vagrantfile | 14 +++--- bootstrap/generated-dists/{centos8s => rocky8}/Dockerfile | 2 +- .../generated-dists/{centos8s => rocky8}/bootstrap.sh | 3 --- bootstrap/generated-dists/{centos8s => rocky8}/locale.sh | 0 .../generated-dists/{centos8s => rocky8}/packages.yml | 0 bootstrap/sha1sum.txt | 2 +- 9 files changed, 19 insertions(+), 25 deletions(-) rename bootstrap/generated-dists/{centos8s => rocky8}/Dockerfile (90%) rename bootstrap/generated-dists/{centos8s => rocky8}/bootstrap.sh (92%) rename bootstrap/generated-dists/{centos8s => rocky8}/locale.sh (100%) rename bootstrap/generated-dists/{centos8s => rocky8}/packages.yml (100%) Changeset truncated at 500 lines: diff --git a/.gitlab-ci-main.yml b/.gitlab-ci-main.yml index acca9e0754b..660cb6e9735 100644 --- a/.gitlab-ci-main.yml +++ b/.gitlab-ci-main.yml @@ -47,7 +47,7 @@ variables: # Set this to the contents of bootstrap/sha1sum.txt # which is generated by bootstrap/template.py --render # - SAMBA_CI_CONTAINER_TAG: d7e721bceae90834dfe04e8a9ba864a55d1c49e1 + SAMBA_CI_CONTAINER_TAG: d1ce7e10953d16253a34b8e58077fd32c1dbd59c # # We use the ubuntu2204 image as default as # it matches what we have on atb-devel-224 @@ -64,7 +64,7 @@ variables: SAMBA_CI_CONTAINER_IMAGE_debian11_32bit: debian11-32bit SAMBA_CI_CONTAINER_IMAGE_debian12: debian12 SAMBA_CI_CONTAINER_IMAGE_opensuse155: opensuse155 - SAMBA_CI_CONTAINER_IMAGE_centos8s: centos8s + SAMBA_CI_CONTAINER_IMAGE_rocky8: rocky8 SAMBA_CI_CONTAINER_IMAGE_centos9s: centos9s SAMBA_CI_CONTAINER_IMAGE_fedora40: fedora40 @@ -662,10 +662,10 @@ opensuse155-samba-o3: variables: SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_opensuse155} -centos8s-samba-o3: +rocky8-samba-o3: extends: .samba-o3-template variables: -SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_centos8s} +SAMBA_CI_JOB_IMAGE: ${SAMBA_CI_CONTAINER_IMAGE_rocky8} centos9s-samba-o3: extends: .samba-o3-template diff --git a/bootstrap/.gitlab-ci.yml b/bootstrap/.gitlab-ci.yml index 1f94532e757..ac2b4ebed09 100644 --- a/bootstrap/.gitlab-ci.yml +++ b/bootstrap/.gitlab-ci.yml @@ -106,7 +106,7 @@ debian11-32bit: variables: SAMBA_CI_TEST_JOB: "samba-32bit" -centos8s: +rocky8: extends: .build_image_template centos9s: diff --git a/bootstrap/config.py b/bootstrap/config.py index 178c9029098..7e6c0f47d67 100644 --- a/bootstrap/config.py +++ b/bootstrap/config.py @@ -236,14 +236,11 @@ if [ ! -f /usr/bin/python3 ]; then fi """ -CENTOS8S_YUM_BOOTSTRAP = r""" +ROCKY8_DNF_BOOTSTRAP = r""" #!/bin/bash {GENERATED_MARKER} set -xueo pipefail -sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* -sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* - yum update -y yum install -y dnf-plugins-core yum install -y epel-release @@ -507,10 +504,10 @@ DEB_DISTS = { RPM_DISTS = { -'centos8s': { -'docker_image': 'quay.io/centos/centos:stream8', -'vagrant_box': 'centos/stream8', -'bootstrap': CENTOS8S_YUM_BOOTSTRAP, +'rocky8': { +'docker_image': 'docker.io/library/rockylinux:8', +'vagrant_box': 'rocky/8', +'bootstrap': ROCKY8_DNF_BOOTSTRAP, 'replace': { 'lsb-release': 'redhat-lsb', '@development-tools': '"@Development Tools"', # add quotes diff --git a/bootstrap/generated-dists/Vagrantfile b/bootstrap/generated-dists/Vagrantfile index 79ccea780be..c1809cfe6b8 100644 --- a/bootstrap/generated-dists/Vagrantfile +++ b/bootstrap/generated-dists/Vagrantfile @@ -10,13 +10,6 @@ Vagrant.configure("2") do |config| config.ssh.
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b0996ed589a s3:tests: Fix spelling error via 7217129ba4a codespell: Ignore CTDB bin/ from cbba4008a7f vfs_ceph_new: add missing newline in debug-logging https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b0996ed589a931902a304237d6c03efce2b16f6b Author: Martin Schwenke Date: Tue Aug 13 21:55:34 2024 +1000 s3:tests: Fix spelling error Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Aug 22 10:38:09 UTC 2024 on atb-devel-224 commit 7217129ba4a73be429e2f7dfc58f0e2cb387d174 Author: Martin Schwenke Date: Tue Aug 13 21:43:48 2024 +1000 codespell: Ignore CTDB bin/ This might be hanging around if standalone CTDB builds have been done. Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S --- Summary of changes: .codespellrc| 2 +- source3/script/tests/test_smbget.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/.codespellrc b/.codespellrc index a712c779c0a..02c07fb6ea1 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,4 @@ [codespell] -skip = ./.git,./bin,./docs-xml/archives,./docs-xml/manpages/vfs_fruit.8.xml,./docs-xml/smbdotconf/browse/preferredmaster.xml,./lib/ldb/ldb_sqlite3/trees.ps,./libcli/util/hresult_err_table.txt,./python/samba/tests/blackbox/testdata,./source3/include/MacExtensions.h,./source3/selftest/ktest-krb5_ccache-2.txt,./source4/setup/display-specifiers,./source4/ldap_server/devdocs,./source4/selftest/provisions,./source4/setup/adprep/WindowsServerDocs,./source4/setup/display-specifiers,./source4/torture/vfs/fruit.c,./testdata,./third_party,*.IBM-DS,*.config,*.diff,*.dump,*.ldif,*.ldf,*.pdml,*.pem,*.po,*.schema +skip = ./.git,./bin,./ctdb/bin,./docs-xml/archives,./docs-xml/manpages/vfs_fruit.8.xml,./docs-xml/smbdotconf/browse/preferredmaster.xml,./lib/ldb/ldb_sqlite3/trees.ps,./libcli/util/hresult_err_table.txt,./python/samba/tests/blackbox/testdata,./source3/include/MacExtensions.h,./source3/selftest/ktest-krb5_ccache-2.txt,./source4/setup/display-specifiers,./source4/ldap_server/devdocs,./source4/selftest/provisions,./source4/setup/adprep/WindowsServerDocs,./source4/setup/display-specifiers,./source4/torture/vfs/fruit.c,./testdata,./third_party,*.IBM-DS,*.config,*.diff,*.dump,*.ldif,*.ldf,*.pdml,*.pem,*.po,*.schema ignore-regex = \\[t] ignore-words = .codespellignore diff --git a/source3/script/tests/test_smbget.sh b/source3/script/tests/test_smbget.sh index acc492d11c7..8f8513d5b62 100755 --- a/source3/script/tests/test_smbget.sh +++ b/source3/script/tests/test_smbget.sh @@ -510,7 +510,7 @@ test_kerberos_trust() # TODO FIXME # This test does not work, as we can't tell the libsmb code that the -# principal is an enterprice principal. We need support for enterprise +# principal is an enterprise principal. We need support for enterprise # principals in kerberos_kinit_password_ext() and a way to pass it via the # credenitals structure and commandline options. # It works if you do: kinit -E testdenied_upn@${REALM}.upn -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via dd03cf8b4c8 libsmb: Remove cli_state->rap_error via c3f73a905dc libsmb: Remove unused cli_NetWkstaUserLogoff() via c831e21d88c libsmb: Remove unused cli_ns_check_server_type() from 3790d0d3b98 WHATSNEW: add 'vfs mkdir use tmp name' option https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit dd03cf8b4c8b9c6e626c939564b718b02ba2cd36 Author: Volker Lendecke Date: Tue Aug 20 15:13:52 2024 +0200 libsmb: Remove cli_state->rap_error I could not find any caller which uses rap_error outside of the routine implementing the rap client call itself. Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Aug 21 12:49:45 UTC 2024 on atb-devel-224 commit c3f73a905dc9847b903c61da130b7bfba902fe0c Author: Volker Lendecke Date: Mon Aug 19 14:17:42 2024 +0200 libsmb: Remove unused cli_NetWkstaUserLogoff() Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit c831e21d88c0a2f1590d414d070f2e8124803023 Author: Volker Lendecke Date: Mon Aug 19 14:16:40 2024 +0200 libsmb: Remove unused cli_ns_check_server_type() Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke --- Summary of changes: source3/include/client.h | 1 - source3/libsmb/clirap.c | 6 +- source3/utils/clirap2.c | 209 --- source3/utils/clirap2.h | 2 - 4 files changed, 20 insertions(+), 198 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/client.h b/source3/include/client.h index 2024cec8fbe..aaac2956f32 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -48,7 +48,6 @@ struct cli_state { * A list of subsidiary connections for DFS. */ struct cli_state *prev, *next; - int rap_error; bool map_dos_errors; /* diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 256331f77c3..758d6ccbb1e 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -433,7 +433,7 @@ NTSTATUS cli_oem_change_password(struct cli_state *cli, .data = old_pw_hash, .size = sizeof(old_pw_hash), }; - int rc; + int rc, res; NTSTATUS status; if (strlen(user) >= sizeof(fstring)-1) { @@ -529,9 +529,9 @@ NTSTATUS cli_oem_change_password(struct cli_state *cli, if (!NT_STATUS_IS_OK(status)) { return status; } - cli->rap_error = PULL_LE_U16(rparam, 0); + res = PULL_LE_U16(rparam, 0); - status = werror_to_ntstatus(W_ERROR(cli->rap_error)); + status = werror_to_ntstatus(W_ERROR(res)); TALLOC_FREE(rparam); diff --git a/source3/utils/clirap2.c b/source3/utils/clirap2.c index b60cbfd4a70..dff54985e26 100644 --- a/source3/utils/clirap2.c +++ b/source3/utils/clirap2.c @@ -460,11 +460,10 @@ int cli_RNetGroupEnum(struct cli_state *cli, void (*fn)(const char *, const char char *endp = rparam + rdrcnt; res = GETRES(rparam, endp); - cli->rap_error = res; - if(cli->rap_error == 234) { + if(res == 234) { DEBUG(1,("Not all group names were returned (such as those longer than 21 characters)\n")); - } else if (cli->rap_error != 0) { - DEBUG(1,("NetGroupEnum gave error %d\n", cli->rap_error)); + } else if (res != 0) { + DEBUG(1,("NetGroupEnum gave error %d\n", res)); } } @@ -549,11 +548,10 @@ int cli_RNetGroupEnum0(struct cli_state *cli, &rdata, &rdrcnt)) { char *endp = rparam+rprcnt; res = GETRES(rparam,endp); - cli->rap_error = res; - if(cli->rap_error == 234) { + if(res == 234) { DEBUG(1,("Not all group names were returned (such as those longer than 21 characters)\n")); - } else if (cli->rap_error != 0) { - DEBUG(1,("NetGroupEnum gave error %d\n", cli->rap_error)); + } else if (res != 0) { + DEBUG(1,("NetGroupEnum gave error %d\n", res)); } } @@ -740,7 +738,6 @@ int cli_NetGroupGetUsers(struct cli_state * cli, const char *group_name, void (* &rdata, &rdrcnt)) { char *endp = rparam + rprcnt; res = GETRES(rparam,endp); - cli->rap_error = res; if (res != 0) {
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ffc75c569c6 lib/param: Don't treat a missing include file as an error in handle_include(). via 578dfa57651 ctdb-scripts: Avoid flapping NFS services at startup via 18a29ed3672 ctdb-scripts: Make initial statistics output empty via 032b7b49c9f ctdb-scripts: Only consider statistics on timeout via f7a96deafa9 ctdb-tests: Make _rpc_service_up() and _rpc_services_down() internal via 0919701a68b ctdb-tests: Make NFS RPC monitoring tests consistent via 47c33a2442c ctdb-tests: Drop unnecessarily "else" via 8b2f228198b ctdb-tests: Replace implicit healthy behaviour with early exits via a522864138a ctdb-tests: Simplify handling of statistics change via 084a69d5522 ctdb-tests: Move result check to rpc_set_service_failure_response() via 47540012009 ctdb-tests: Initialise return code file via 833deb067d8 ctdb-tests: Add function rpc_failure() to log failures and warnings via 1d9661d587f ctdb-tests: Argument 3 to nfs_iterate_test() is up iteration via 7c5e7080015 ctdb-tests: nfs_iterate_test() marks RPC service down from 8edb1fd13c1 ctdb-tcp: Remove a use of ctdb_addr_to_str() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ffc75c569c69ce22a39b5d1df8cb4906095c8654 Author: Pavel Filipenský Date: Tue Aug 20 17:15:46 2024 +0200 lib/param: Don't treat a missing include file as an error in handle_include(). Same fix as in commit 09d7690 'samba-tool domain provision -d10' fails if the included file does not exist: lpcfg_load: refreshing parameters from /etc/samba/smb.conf Processing section "[global]" Can't find include file /etc/samba/usershares.conf pm_process() returned No ERROR: Unable to load default file File "/usr/lib64/python3.12/site-packages/samba/netcmd/domain/provision.py", line 183, in run lp = sambaopts.get_loadparm() File "/usr/lib64/python3.12/site-packages/samba/getopt.py", line 282, in get_loadparm self._lp.load_default() Signed-off-by: Pavel Filipenský Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Aug 21 00:04:19 UTC 2024 on atb-devel-224 commit 578dfa576517b10d979c9aef539ac910b2f95381 Author: Martin Schwenke Date: Sat Jun 29 12:25:59 2024 +1000 ctdb-scripts: Avoid flapping NFS services at startup If an NFS service check is set to, say, unhealthy_after=2 then it will always switch from the (default startup) unhealthy state to healthy, even if there is a fatal problem. If all services/scripts appear OK then the node will become healthy. When the counter hits the limit it will return to unhealthy. This is misleading. Instead, never use the counter at startup, until the service becomes healthy. This stops services flapping unhealthy-healthy-unhealthy. A side-effect is that a service that starts in a broken state will never be restarted to try to fix the problem. This makes sense. The counting and restarting really exist to deal with problems that might occur under load. The first monitor events occur before public IPs are hosted, so there can be no load. If a service doesn't start reliably the first time then the admin probably wants to know about it. nfs_iterate_test() is updated to run an initial monitor event to mark the services as healthy. This initialises the counter so it can be used for the important part of the test. Passing the -i option avoids running the extra monitor event, so the first iteration will be the initial monitor event. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 18a29ed367278849889a846bb93f49afd0c045a8 Author: Martin Schwenke Date: Sat Jun 29 19:24:25 2024 +1000 ctdb-scripts: Make initial statistics output empty This makes initial failure to retrieve statistics less likely to result in a statistics change. To help with this, statistics retrieval stderr now goes to the log - only stdout goes to the file. This means that the test code for checking statistics changes needs to be redone to actually run the statistics command and check. As with rpcinfo output, this output needs to behave as deterministically in the test code as it done in the event script. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 032b7b49c9f50fa8e4e049d066e5f1ddb6295d89 Author: Martin Schwenke Date: Sun Jun 30 10:35:09 2024 +1000 ctdb-scripts: Only consider statistics on timeout Checking statistics is only really relevant to timeouts. That is,
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via a743a24d758 ctdb-doc: document nodes list configuration parameter via 6817eff833b ctdb-tests: add a nodestatus test that uses the nodes list command via 6d29c7f8194 ctdb-tests: add reloadnodes unit tests that use the nodes list command via 8a5b743c436 ctdb-tests: add USENODESCOMMAND directive to fake ctdb via cdb5646b885 ctdb-tests: add unit test coverage for listnodes with command via cfc09171355 ctdb-tools: update cli tool to optionally load nodes from command via ac926a506d5 ctdb-conf: add boolean arg for verbosity when loading config via a0e8304ccf2 ctdb-server: rename ctdb_load_nodes_file to ctdb_load_nodes via 7e7cb918066 ctdb-server: rename nodes_file field to nodes_source via dc65e7082d6 ctdb-server: use the new "nodes list" configuration option via 315890e845b ctdb-conf: add "nodes list" configuration option via bab51705280 ctdb-conf: add ctdb_read_nodes_cmd function from 46215ab1b34 wafsamba: Fix ABI symbol name generation https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a743a24d7588af15375f7d4cafc401523c5c0a32 Author: John Mulligan Date: Fri Aug 2 13:58:59 2024 -0400 ctdb-doc: document nodes list configuration parameter Add the initial documentation of the node list configuration parameter. Signed-off-by: John Mulligan Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Aug 6 01:50:12 UTC 2024 on atb-devel-224 commit 6817eff833b96d6a63a1468c73c81439fdb3368e Author: John Mulligan Date: Wed Jul 31 18:30:24 2024 -0400 ctdb-tests: add a nodestatus test that uses the nodes list command Signed-off-by: John Mulligan Reviewed-by: Martin Schwenke commit 6d29c7f81941a20432f759592e4fae4334a65eff Author: John Mulligan Date: Wed Jul 31 16:30:13 2024 -0400 ctdb-tests: add reloadnodes unit tests that use the nodes list command Signed-off-by: John Mulligan Reviewed-by: Martin Schwenke commit 8a5b743c436216f05926fabfec4a23be7f782b94 Author: John Mulligan Date: Wed Jul 31 16:29:44 2024 -0400 ctdb-tests: add USENODESCOMMAND directive to fake ctdb Add a single line USENODESCOMMAND directive to the fake ctdb in order to enable use of a nodes script instead of a nodes file. For simplicity the fake ctdb always uses `nodes.sh` in the CTDB_BASE. Signed-off-by: John Mulligan Reviewed-by: Martin Schwenke commit cdb5646b88589407720fef0ff7306fc6993018a3 Author: John Mulligan Date: Wed Jul 31 15:36:26 2024 -0400 ctdb-tests: add unit test coverage for listnodes with command Signed-off-by: John Mulligan Reviewed-by: Martin Schwenke commit cfc0917135545d309825f18dcc04e1b172183b36 Author: John Mulligan Date: Fri Jun 7 11:12:17 2024 -0400 ctdb-tools: update cli tool to optionally load nodes from command Similar to the recent changes to the ctdb server code, add the ability to load the nodes from a subprocess stdout. Signed-off-by: John Mulligan Reviewed-by: Martin Schwenke commit ac926a506d5d3d0cfb8caeb135fe496b284ef5f6 Author: John Mulligan Date: Thu Aug 1 14:25:38 2024 -0400 ctdb-conf: add boolean arg for verbosity when loading config In a future commit we will add support for loading the config file from the `ctdb` command line tool. Prior to this change the config file load func always called D_NOTICE that causes the command to emit new text and thus break all the tests that rely on the specific test output (not to mention something users could notice). This change plumbs a new `verbose` argument into some of the config file loading functions. Generally, all existing functions will have verbose set to true to match the existing behavior. Future callers of this function can set it to false in order to avoid emitting the extra text. Signed-off-by: John Mulligan Reviewed-by: Martin Schwenke commit a0e8304ccf2ef446dc92f701687438449c5a91d9 Author: John Mulligan Date: Thu Jun 6 13:53:43 2024 -0400 ctdb-server: rename ctdb_load_nodes_file to ctdb_load_nodes Rename ctdb_load_nodes_file to ctdb_load_nodes as it can now load nodes from more than a regular file. Signed-off-by: John Mulligan Reviewed-by: Martin Schwenke commit 7e7cb9180665eda8af2a485637cb1ef9be38f3dd Author: John Mulligan Date: Thu Jun 6 13:50:02 2024 -0400 ctdb-server: rename nodes_file field to nodes_source Rename the `struct ctdb_context` field nodes_file to nodes_source to better match that the field may indicate something other than a true file. Signed-off-by: John Mulligan Reviewed-by: Martin Schwenke commit dc65e7082d6027822f66
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ead5a3111f3 ctdb-daemon: Use ctdb_parse_node_address() in ctdbd via 181cc097ef2 ctdb-daemon: Use ctdb_read_nodes() in ctdbd via 5d2a864c0ba ctdb-protocol: Move ctdb_node_map_* to protocol_api.h via fe97d04f180 ctdb-tests: Use ctdb_read_nodes() in the fake ctdbd via 3d52258d8ad ctdb-tools: Use ctdb_read_nodes() in the ctdb tool via 45da2281aa4 ctdb-conf: Add a common node address handling module via 79c5f451c86 ctdb-protocol: Move definition of CTDB_PORT to protocol via 67e49d3e541 ctdb-build: Remove unused dependencies on ctdb-util from 0a532378322 s3:printing: Allow to run samba-bgqd as a standalone systemd service https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ead5a3111f3b3e0639b1dc7725a7c233f1ee9cae Author: Martin Schwenke Date: Mon Jul 8 17:57:27 2024 +1000 ctdb-daemon: Use ctdb_parse_node_address() in ctdbd While here, fix a trivial memory leak (ctdbd will exit anyway if this function fails). Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Jul 23 12:39:18 UTC 2024 on atb-devel-224 commit 181cc097ef2d36d5aaeffa3636ea4f198306bb78 Author: Martin Schwenke Date: Fri Jul 5 18:07:36 2024 +1000 ctdb-daemon: Use ctdb_read_nodes() in ctdbd ctdb_control_getnodesfile() calls ctdb_read_nodes(), which returns a struct ctdb_node_map rather than the old version, so update associated marshalling. While here modernise a debug message and wrap the function arguments. For ctdb_load_nodes_file() to use ctdb_read_nodes(), tweak convert_node_map_to_list() to also use the modern node map structure. Remove unused copy of ctdb_read_nodes_file(). Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S commit 5d2a864c0ba3e7a67a73548e2d13ea5919aa5fc7 Author: Martin Schwenke Date: Fri Jul 5 17:58:46 2024 +1000 ctdb-protocol: Move ctdb_node_map_* to protocol_api.h Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S commit fe97d04f18084c6ac76106fce28e55db4b72b8cc Author: Martin Schwenke Date: Fri Jul 5 17:45:44 2024 +1000 ctdb-tests: Use ctdb_read_nodes() in the fake ctdbd Remove unused copy of ctdb_read_nodes_file(). Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S commit 3d52258d8ad5dcef3f6d8b95bc289a6c11121a9c Author: Martin Schwenke Date: Fri Jul 5 17:37:26 2024 +1000 ctdb-tools: Use ctdb_read_nodes() in the ctdb tool Remove unused copy of ctdb_read_nodes_file(). Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S commit 45da2281aa4f391e23883d1f8453991caa3d1dff Author: Martin Schwenke Date: Fri Jul 5 17:34:09 2024 +1000 ctdb-conf: Add a common node address handling module These functions are intended to be used in ctdbd, the ctdb tool and fake_ctdbd, replacing the different copies in each place. ctdb_read_nodes() will replace ctdb_read_nodes_file(). The name change is intentional - in future the location may be something other than a simple filename. The static copies of ctdb_read_nodes_file() and node_map_add() are slightly sanitised versions of those in tools/ctdb.c, with a call to ctdb_parse_node_address(). A bit more care is taken in node_map_add() to avoid undefined behaviour if talloc_realloc() fails. ctdb_parse_node_address() will replace ctdb_parse_address(). There is an obvious argument change, since the ctdb context argument was unused. It can only fail on an invalid node address, so return a bool. This function might be changed later to allow the input address string to include an optional port. Where to put this module isn't entirely clear. It could go in common, so be part of ctdb-util. However, if it later needs ctdb-conf (e.g. to allow the node list location to be configurable) then there would be a direct cyclic dependency. This is configuration handling, so conf/ seems sane. However, I didn't want to put it into the ctdb-conf target, since some code might need to parse a nodes list but not need to parse ctdb.conf. Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S commit 79c5f451c86fc5e5dd77d631ebbb394070055ba1 Author: Martin Schwenke Date: Mon Jul 8 17:58:55 2024 +1000 ctdb-protocol: Move definition of CTDB_PORT to protocol Users of CTDB_PORT will all pick up the new definition. Signed-off-by: Martin Schwenke Reviewed-by: Anoop C S commit 67e49d3e541f17d5174e5562e260ca57cd6d88be Author: Martin Schwenke Date: Fri Jul 5 17:19:47 2024 +1000 ctdb-build: Remove unused dependencies on ctdb-util Si
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 056dd415dda ctdb-failover: omit "restrict" optimization keyword from 6ba69da8d37 ctdb/wscript: Remove long pending unsupported option https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 056dd415ddad4ebdb73acb531dd339a03ca8ce51 Author: Björn Baumbach Date: Tue Jul 2 18:04:40 2024 +0200 ctdb-failover: omit "restrict" optimization keyword Fails with some compilers with error: expected ';', ',' or ')' before 'lineptr' Signed-off-by: Björn Baumbach Reviewed-by: Volker Lendecke Reviewed-by: Douglas Bagnall Reviewed-by: Jo Sutton Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Jul 2 23:52:37 UTC 2024 on atb-devel-224 --- Summary of changes: ctdb/failover/statd_callout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/failover/statd_callout.c b/ctdb/failover/statd_callout.c index 9a85cad7fe2..2f703560b29 100644 --- a/ctdb/failover/statd_callout.c +++ b/ctdb/failover/statd_callout.c @@ -55,9 +55,9 @@ struct { }; } config; -static bool getline_strip(char **restrict lineptr, +static bool getline_strip(char **lineptr, size_t *n, - FILE *restrict stream) + FILE *stream) { bool was_null; int ret; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 03e9575e38d s3:smbd: Avoid compiler warning for unused label via e50a69334ea s4:dsdb: Remove unnecessary MIN() via 50c37d618f8 lib:krb5_wrap: Fix code spelling via 66928d858f3 s4:auth: Correct order of parameters in documentation via ec73e99792d s3:rpc_server: Fix code spelling via 239a8f277ca lib:crypto: Remove unused macro definitions via 939481329ee perftest:ndr_pack_performance: Remove obselete comment via 4844b1c34cb perftest:ndr_pack_performance: Remove unused import via 32cd94b1e4a s3:rpc_server: Update deprecated directives via a9ad964cf16 pyglue: Remove global variables used in only one place via c4728578def s4:dsdb: Use appropriate type for userAccountControl flags via 3dffd0fa677 s4:auth: Use appropriate type for userAccountControl flags via 8a456f373f7 s3:param: Check return value of strlower_m() (CID 1598446) via 9853bd69eb2 tests/krb5: Simplify code using dict.get() via 7ae89d8d3c7 tests/krb5: Fix type errors by giving ‘pwd_last_set’ an appropriate type from 60550fbe184 Fix starvation of pending writes in CTDB queues https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 03e9575e38d737e0972d4736a80949dcdb515c44 Author: Jo Sutton Date: Mon Jul 1 15:55:13 2024 +1200 s3:smbd: Avoid compiler warning for unused label If either of HAVE_FSTATFS and HAVE_LINUX_MAGIC_H are not defined, gcc produces the following error: ../../source3/smbd/open.c: In function ‘reopen_from_fsp’: ../../source3/smbd/open.c:1222:1: error: label ‘namebased_open’ defined but not used [-Werror=unused-label] 1222 | namebased_open: | ^~ Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Jul 2 04:44:56 UTC 2024 on atb-devel-224 commit e50a69334eaf6cadcf3ce93ab8b48e64c8940058 Author: Jo Sutton Date: Thu Jan 18 15:16:36 2024 +1300 s4:dsdb: Remove unnecessary MIN() Since we have ensured that val->length >= sizeof(hash->hash), MIN(val->length, sizeof(hash->hash)) will here always be equal to sizeof(hash->hash). Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke commit 50c37d618f8037e5b7f9e3e0efd9aa0baea394bf Author: Jo Sutton Date: Wed Jan 17 13:21:04 2024 +1300 lib:krb5_wrap: Fix code spelling Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke commit 66928d858f31cc08bd2cbe69bf34cab8ab5e Author: Jo Sutton Date: Wed Jan 17 12:45:15 2024 +1300 s4:auth: Correct order of parameters in documentation Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke commit ec73e99792d4b368d57d6d4d6f1e01b95e5c88e4 Author: Jo Sutton Date: Tue Jan 16 10:38:27 2024 +1300 s3:rpc_server: Fix code spelling Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke commit 239a8f277ca5b30baac2255a720d8d43d12bfc69 Author: Jo Sutton Date: Tue Dec 5 15:40:30 2023 +1300 lib:crypto: Remove unused macro definitions As we now require GnuTLS 3.6.13, we can rely on GnuTLS providing these macros. Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke commit 939481329ee06692ef832cfd374a994dabfbf8b6 Author: Jo Sutton Date: Mon Jan 8 17:22:39 2024 +1300 perftest:ndr_pack_performance: Remove obselete comment Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke commit 4844b1c34cbc362b6103a13f7a67c95ad52c26af Author: Jo Sutton Date: Mon Jan 8 17:22:21 2024 +1300 perftest:ndr_pack_performance: Remove unused import Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke commit 32cd94b1e4a8cf98087819c7edff71aae0adc5ec Author: Jo Sutton Date: Fri Dec 22 13:35:26 2023 +1300 s3:rpc_server: Update deprecated directives ‘api.prefix’ and ‘parse.error’ have both been supported since Bison 3.0. /data/samba/source3/rpc_server/mdssvc/es_parser.y:98.1-21: warning: deprecated directive: ‘%name-prefix "mdsyyl"’, use ‘%define api.prefix {mdsyyl}’ [-Wdeprecated] 98 | %name-prefix "mdsyyl" | ^ | %define api.prefix {mdsyyl} /data/samba/source3/rpc_server/mdssvc/es_parser.y:100.1-14: warning: deprecated directive: ‘%error-verbose’, use ‘%define parse.error verbose’ [-Wdeprecated] 100 | %error-verbose | ^~ | %define parse.error verbose /data/samba/source3/rpc_server/mdssvc/es_parser.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke commit a9ad964cf16c691a8cd97c1e7fa6416b66c85e95 Author: Jo Sutton Date: Tue Dec 12 17:38:02
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6d3cfb4b1c6 s4:torture: Initialize param arrays via f52e7fd3c02 s4:torture: Remove trailing spaces from gentest.c via b11cf72c1be s3:winbind: Fix integer type of len via aae8cab3f9b s3:smbd: Make sure struct security_ace is initialized via 321ee914a4b s3:libsmb: Check if we have a valid file descriptor via 57001527ae6 s4:torture: Initialize pointers via 1d38f6ee925 s4:torture: Initialize struct smb2_handle via b6d66e55adc s4:torture: Initialize struct netr_LogonSamLogonEx via d755bc43d8f s3:rpc_client: Initialize struct security_ace via 9ec0f8bd602 s4:torture: Make sure struct smb2_handle is initialized via 14786193632 s3:smbd: Make sure struct security_ace is initialized via df8d19e53b6 s3:smbd: Remove trailing spaces in posix_acls.c via 5eb58b16ca7 examples: Make sure the array is probably initialized via 384d948b8d8 winexe: Make sure specificError is initialized from 0ebabaedbc0 smbd: Fix cached dos attributes https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6d3cfb4b1c60bca966c21ee772f3b1ba5ac76371 Author: Andreas Schneider Date: Fri Jun 21 13:36:23 2024 +0200 s4:torture: Initialize param arrays "Error: UNINIT (CWE-457): samba-4.20.0rc2/source4/torture/gentest.c:2690: var_decl: Declaring variable ""parm"" without initializer. samba-4.20.0rc2/source4/torture/gentest.c:2711: uninit_use: Using uninitialized value ""parm[0]"". Field ""parm[0].out"" is uninitialized. 2709| } 2710| 2711|->GEN_COPY_PARM; 2712| GEN_SET_FNUM_SMB2(in.file.handle); 2713| GEN_CALL_SMB2(smb2_lock(tree, &parm[i]));" Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Jul 1 00:23:08 UTC 2024 on atb-devel-224 commit f52e7fd3c02592baebca8d493e37ba0a7bc6dd9d Author: Andreas Schneider Date: Fri Jun 21 13:37:46 2024 +0200 s4:torture: Remove trailing spaces from gentest.c Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke commit b11cf72c1be13b83fb9a3e8c852ba73ac3f7e9e2 Author: Andreas Schneider Date: Fri Jun 21 10:57:32 2024 +0200 s3:winbind: Fix integer type of len "Error: INTEGER_OVERFLOW (CWE-190): samba-4.20.0rc2/source3/winbindd/winbindd_cache.c:849: cast_overflow: Truncation due to cast operation on ""len"" from 32 to 8 bits. samba-4.20.0rc2/source3/winbindd/winbindd_cache.c:851: overflow_sink: ""len"", which might have overflowed, is passed to ""memcpy(centry->data + centry->ofs, s, len)"". [Note: The source code implementation of the function has been overridden by a builtin model.] 849| centry_put_uint8(centry, len); 850| centry_expand(centry, len); 851|->memcpy(centry->data + centry->ofs, s, len); 852| centry->ofs += len; 853| }" Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke commit aae8cab3f9be0189d6f76bf1a53a1d747b8ba2ff Author: Andreas Schneider Date: Fri Jun 21 10:49:53 2024 +0200 s3:smbd: Make sure struct security_ace is initialized "Error: UNINIT (CWE-457): samba-4.20.0rc2/source3/smbd/posix_acls.c:4706: var_decl: Declaring variable ""aces"" without initializer. samba-4.20.0rc2/source3/smbd/posix_acls.c:4748: uninit_use_in_call: Using uninitialized value ""*aces"". Field ""aces->object"" is uninitialized when calling ""make_sec_acl"". 4746| idx++; 4747| 4748|->new_dacl = make_sec_acl(ctx, 4749| NT4_ACL_REVISION, 4750| idx," Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke commit 321ee914a4b5232c2ff451352e2f5b5d0bf9a96c Author: Andreas Schneider Date: Fri Jun 21 10:48:01 2024 +0200 s3:libsmb: Check if we have a valid file descriptor "Error: REVERSE_NEGATIVE (CWE-191): samba-4.20.0rc2/source3/libsmb/pylibsmb.c:215: negative_sink_in_call: Passing ""t->shutdown_pipe[1]"" to a parameter that cannot be negative. samba-4.20.0rc2/source3/libsmb/pylibsmb.c:230: check_after_sink: You might be using variable ""t->shutdown_pipe[1]"" before verifying that it is >= 0. 228| t->shutdown_pipe[0] = -1; 229| } 230|->if (t->shutdown_pipe[1] != -1) { 231| close(t->shutdown_pipe[1]); 232| t->shutdown_pipe[1] =
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 415f9f07456 ctdb-failover: Split statd_callout add-client/del-client via 089aec2885f ctdb-doc: Drop unnecessary, broken attempt at rpc.statd stack trace via 707e0ef55b8 ctdb-scripts: Fail monitoring after 1 x NFS-Ganesha not running via 4766d4568bf ctdb-doc: Add example for NFS-Ganesha RPC checking via d96078e263e ctdb-scripts: Implement NFS statistics retrieval for NFS-Ganesha via 5b7d17d44d9 ctdb-scripts: Add service_stats_command variable to NFS checks from d86f9ff7fdd smbd: Simplify callers of notify_filter_string https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 415f9f07456e3fd24063e7508d8b2553df020c21 Author: Martin Schwenke Date: Fri May 10 11:42:26 2024 +1000 ctdb-failover: Split statd_callout add-client/del-client rpc.statd is single-threaded and runs its HA callout synchronously. If it is too slow then latency accumulates and rpc.statd's backlog grows. Running a pair of add-client/del-client events with the current code averages ~0.030s in my test environment. This mean that 1000 clients reclaiming locks after failover can easily cause 10s of latency. This could cause rpc.statd to become unresponsive, resulting in a time out for an rpcinfo-based health check of the status service. Split the add-client/del-client events out to a standalone statd_callout executable, written in C, to be used as the HA callout for rpc.statd. All other functions move to statd_callout_helper. Now, running a pair of add-client/del-client events in my test environment averages only ~0.002s. This seems less likely to cause latency problems. The standalone statd_callout executable needs to read a configuration file, which is generated by statd_callout_helper from the "startup" event. It also needs access to a list of currently assigned public IPs. For backward compatibility, during installation a symlink is created from $CTDB_BASE/statd-callout to the new statd_callout, which is installed in the helper directory. Testing this as part of the eventscript unit tests starts to become even more of a hack than it used to be. However, the dependency on stubs and the corresponding setup of fake state makes it hard to move this elsewhere. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Jun 25 04:24:57 UTC 2024 on atb-devel-224 commit 089aec2885fecce4fa202ccc402688c394774dc9 Author: Martin Schwenke Date: Mon Mar 4 14:29:41 2024 +1100 ctdb-doc: Drop unnecessary, broken attempt at rpc.statd stack trace There is a typo here, since there will be no process called "status". Instead of fixing it, drop this because rpc.statd isn't the focus of this monitoring check and when systemd is init rpc.statd isn't restarted with nfs-ganesha. It stays running, so a confusing stack trace for rpc.statd is always logged. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 707e0ef55b89e328cadd0f4ac3ad33a83039e287 Author: Martin Schwenke Date: Fri May 24 11:55:59 2024 +1000 ctdb-scripts: Fail monitoring after 1 x NFS-Ganesha not running If ganesha.nfsd is gone then a node can't provide an NFS service, so should be marked unhealthy. A later restart may bring it back to health. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 4766d4568bf45d74cbf8d41f9853d0afef3e4c45 Author: Martin Schwenke Date: Mon Mar 4 14:28:11 2024 +1100 ctdb-doc: Add example for NFS-Ganesha RPC checking This one does an rpcinfo check, along with statistics mitigation. It can be used in combination with the existing 20.nfs_ganesha.check. The equivalent kernel NFS file only restarts every 10 failures. This one can be a little more proactive given that false positives are less likely with the statistics mitigation. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit d96078e263ebc3119d646ddf154582351052c5b0 Author: Martin Schwenke Date: Mon Mar 4 13:52:10 2024 +1100 ctdb-scripts: Implement NFS statistics retrieval for NFS-Ganesha Simplicity is preferred here over absolute correctness. If the ganesha_stats command exits with an error or times out then no output is produced so, implicitly, the statistics do not change. Also, the statistics always change at startup. However, it is likely that the statistics change when NFS makes progress and do not change when NFS does not make progress. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 5b7d17d44d9abdf2f3e15b225bd53b
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 0159c48e897 ctdb-scripts: Do not de-duplicate the interfaces list from 7a5e7b82125 python: Fix NtVer check for site_dn_for_machine() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 0159c48e897a7c07c399767f5ffddbb11d80ab5d Author: Martin Schwenke Date: Thu Apr 18 14:13:11 2024 +1000 ctdb-scripts: Do not de-duplicate the interfaces list Using xargs with sort -u to de-duplicate this list was my idea and causes a couple of things to go wrong. The use of xargs causes double-quotes to be lost. The resulting $public_ifaces value also contains newlines. The newlines could be removed with an additional xargs at the end of the pipeline... but that would add an extra level of quote stripping. I have unsuccessfully tried to find an alternative, but still elegant, command pipeline that de-duplicates the list, while maintaining quoting. So, just drop the de-duplication. This might make interface_ifindex_exists_with_options() slightly less efficient. However, that function walks the whole list, only terminating early when a match is found on both interface and options, so at least it will be correct. Include an extra testcase. Signed-off-by: Martin Schwenke Reviewed-by: Andrew Bartlett Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Apr 18 09:08:34 UTC 2024 on atb-devel-224 --- Summary of changes: ctdb/config/events/legacy/50.samba.script | 1 - .../UNIT/eventscripts/50.samba.startup.012.sh | 25 ++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 ctdb/tests/UNIT/eventscripts/50.samba.startup.012.sh Changeset truncated at 500 lines: diff --git a/ctdb/config/events/legacy/50.samba.script b/ctdb/config/events/legacy/50.samba.script index 90de6a3f31b..c9d34cd2245 100755 --- a/ctdb/config/events/legacy/50.samba.script +++ b/ctdb/config/events/legacy/50.samba.script @@ -40,7 +40,6 @@ generate_smb_interfaces_config() if [ -n "$CTDB_SAMBA_INTERFACES_EXTRA" ]; then public_ifaces="$public_ifaces $CTDB_SAMBA_INTERFACES_EXTRA" fi - public_ifaces=$(echo "$public_ifaces" | xargs -n 1 | sort -u) cat < "$CTDB_SAMBA_INTERFACES_FILE" bind interfaces only = yes diff --git a/ctdb/tests/UNIT/eventscripts/50.samba.startup.012.sh b/ctdb/tests/UNIT/eventscripts/50.samba.startup.012.sh new file mode 100755 index 000..fb7627c5898 --- /dev/null +++ b/ctdb/tests/UNIT/eventscripts/50.samba.startup.012.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "startup, with interfaces list generation" + +setup + +interfaces_file="${CTDB_TEST_TMP_DIR}/interfaces.conf" + +setup_script_options <
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via cc7c12e5d5c lib: Remove an obsolete comment via 80cd127b20f smbd: Remove sconn->using_smb2 via 59d7850ffaf smbd: Add conn_using_smb2() via f1bb46ad4e8 smbd: Change protocol selection to not use "sconn->using_smb2" from 7e621b1b530 ctdb: Modernize a few DEBUGs https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit cc7c12e5d5c74812e089b7f4bc5b0c78553ccf24 Author: Volker Lendecke Date: Tue Mar 12 15:06:33 2024 +0100 lib: Remove an obsolete comment Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Apr 17 09:01:34 UTC 2024 on atb-devel-224 commit 80cd127b20f46bfece91316171958a054a78cb00 Author: Volker Lendecke Date: Tue Feb 13 13:05:42 2024 +0100 smbd: Remove sconn->using_smb2 We have the same information available via conn_using_smb2() Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 59d7850ffaf03ad00a9850683fab1b6e64be3e39 Author: Volker Lendecke Date: Tue Feb 13 12:28:06 2024 +0100 smbd: Add conn_using_smb2() Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit f1bb46ad4e8b0b43ead60c70a463709892fd1779 Author: Volker Lendecke Date: Tue Feb 13 12:56:17 2024 +0100 smbd: Change protocol selection to not use "sconn->using_smb2" To me this is pretty confusing, it seems to overload this struct element. Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke --- Summary of changes: lib/async_req/async_sock.c | 7 --- source3/smbd/close.c| 2 +- source3/smbd/conn.c | 6 ++ source3/smbd/conn_idle.c| 2 +- source3/smbd/dir.c | 4 ++-- source3/smbd/filename.c | 2 +- source3/smbd/globals.h | 1 - source3/smbd/open.c | 4 ++-- source3/smbd/proto.h| 1 + source3/smbd/smb1_process.c | 4 ++-- source3/smbd/smb2_negprot.c | 2 -- source3/smbd/smb2_nttrans.c | 2 +- source3/smbd/smb2_oplock.c | 4 ++-- source3/smbd/smb2_process.c | 27 ++- source3/smbd/smb2_service.c | 2 +- source3/smbd/smb2_trans2.c | 15 --- 16 files changed, 34 insertions(+), 51 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c index bdbefd162ac..795a2c63dba 100644 --- a/lib/async_req/async_sock.c +++ b/lib/async_req/async_sock.c @@ -144,13 +144,6 @@ struct tevent_req *async_connect_send( return tevent_req_post(req, ev); } - /* -* Note for historic reasons TEVENT_FD_WRITE is not enough -* to get notified for POLLERR or EPOLLHUP even if they -* come together with POLLOUT. That means we need to -* use TEVENT_FD_READ in addition until we have -* TEVENT_FD_ERROR. -*/ state->fde = tevent_add_fd(ev, state, fd, TEVENT_FD_ERROR|TEVENT_FD_WRITE, async_connect_connected, req); diff --git a/source3/smbd/close.c b/source3/smbd/close.c index bbca474a28a..987a0ed5183 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -1480,7 +1480,7 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, SMB_ASSERT(fsp->fsp_flags.is_fsa); - if (fsp->conn->sconn->using_smb2) { + if (conn_using_smb2(fsp->conn->sconn)) { notify_status = NT_STATUS_NOTIFY_CLEANUP; } else { notify_status = NT_STATUS_OK; diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index e6c1fa72dcb..b7a745a951e 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -84,6 +84,12 @@ enum protocol_types conn_protocol(struct smbd_server_connection *sconn) return PROTOCOL_COREPLUS; } +bool conn_using_smb2(struct smbd_server_connection *sconn) +{ + enum protocol_types proto = conn_protocol(sconn); + return (proto >= PROTOCOL_SMB2_02); +} + / Find first available connection slot, starting from a random position. The randomisation stops problems with the server dying and clients diff --git a/source3/smbd/conn_idle.c b/source3/smbd/conn_idle.c index 870b2b717df..6eebdd363b1 100644 --- a/source3/smbd/conn_idle.c +++ b/source3/smbd/conn_idle.c @@ -238,7 +238,7 @@ static void conn_force_tdis_done(struct tevent_req *req) return; } - if (conn->sconn->using_smb2) { + if (conn_using_smb2(conn->sconn)) { vuid = conn->vuid; } diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 49
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 7e621b1b530 ctdb: Modernize a few DEBUGs via 73e806c559d ctdb: Remove common/line.[ch] via ba8f8ef33cd ctdb: Use stdio's getline() in ctdb_connection_list_read() via 4de14e27231 lib: Use fdopen_keepfd() via b6f4acb9b46 rpc_server3: Use fdopen_keepfd() via 28335cdb5d7 lib: Add fdopen_keepfd() via 0baae61e423 lib: Give lib/util/util_file.c its own header file via f42c5802faf ctdb-scripts: Add options to generate smb.conf interfaces include file via 56eeb058d2d ctdb-scripts: Rename and relocate function get_all_interfaces() via ff3b92ffaed smbd-server: Process ip add/drop events for options:dynamic only via c60fe03ef7d lib-interface: Change API for interface 'options' via 3edeb2bdce4 lib-interface: Add parsing for interface 'options' via cfa846fa292 lib-interface: Add extra parameter 'options' to interface definition via 9fcb62cf22d param: Add additional key 'options' for interfaces via 916fabe7e83 smbd-server: Use MSG_SMB_IP_DROPPED via 644b50b05b2 messaging: Add new SMBD message via 4ef1eb92edc smbd-server: Handle ip drop event and close listening socket via bca01b501cb smbd-server: Open socket for additional ip address via 961104262c6 lib-interface: Add new API to validate interface info for given interface index via 6f18422aadc lib-addrchange: Change API to fill up if_index value from netlink msg via 02a99126abf smbd-server: Set event callback for interface change notification from 7532c798d13 docs: Document new tdbdump -x option https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 7e621b1b530f740bce8d2de084c0f710f1ddb437 Author: Volker Lendecke Date: Thu Feb 29 16:11:16 2024 +0100 ctdb: Modernize a few DEBUGs Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Apr 17 00:54:55 UTC 2024 on atb-devel-224 commit 73e806c559d8889026b2b14a8d22145bd1a2b430 Author: Volker Lendecke Date: Fri Mar 1 21:19:51 2024 +0100 ctdb: Remove common/line.[ch] This was an implementation of getline(3), use that instead. Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit ba8f8ef33cd99ea60fc2682727a5497995b5f569 Author: Volker Lendecke Date: Fri Mar 1 21:16:57 2024 +0100 ctdb: Use stdio's getline() in ctdb_connection_list_read() This is the only user of common/line.[ch], which can go next. Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 4de14e2723139b488e69251e500f022f50f983e1 Author: Volker Lendecke Date: Wed Apr 10 13:11:11 2024 +0200 lib: Use fdopen_keepfd() Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit b6f4acb9b46773d61aaea242b67af90d40bc4c9c Author: Volker Lendecke Date: Wed Apr 10 13:08:06 2024 +0200 rpc_server3: Use fdopen_keepfd() Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 28335cdb5d72c63d52c83fe00a67b8aa28558677 Author: Volker Lendecke Date: Wed Apr 10 13:07:56 2024 +0200 lib: Add fdopen_keepfd() Capture the dup/fdopen pattern Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 0baae61e4233bc812c65c3646b1acf15ef7bc22f Author: Volker Lendecke Date: Wed Apr 10 13:02:39 2024 +0200 lib: Give lib/util/util_file.c its own header file Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit f42c5802fafa61fe29a0b78c0247eb5a5c386c15 Author: Vinit Agnihotri Date: Tue Jan 30 01:50:20 2024 -0800 ctdb-scripts: Add options to generate smb.conf interfaces include file Signed-off-by: Vinit Agnihotri Reviewed-by: Martin Schwenke Reviewed-by: Andrew Bartlett commit 56eeb058d2d5fde17c461afe7fac2f0832993a8c Author: Vinit Agnihotri Date: Tue Jan 30 01:25:37 2024 -0800 ctdb-scripts: Rename and relocate function get_all_interfaces() get_all_interfaces() functions gets all names for all public interfaces. However name is misleading. Thus renamed it to get_public_ifaces() and moved it under functions. Signed-off-by: Vinit Agnihotri Reviewed-by: Martin Schwenke Reviewed-by: Andrew Bartlett commit ff3b92ffaed64e8ecb250f0ad160210f511a39e2 Author: Vinit Agnihotri Date: Tue Mar 5 03:03:25 2024 -0800 smbd-server: Process ip add/drop events for options:dynamic only Signed-off-by: Vinit Agnihotri Reviewed-by: Martin Schwenke Reviewed-by: Andrew Bartlett commit c60fe03ef7d09f98b2c91669e0ecbd880c72fa0e Author: Vinit Agnihotri Date: Tue Mar 5 02:32:23 2024 -0800 lib-interface: Change API for interface
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 8b9f464420b ctdb-daemon: Call setproctitle_init() from 3481bbfede5 smbd: Fix BZ15481 https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 8b9f464420b66cebaf00654cf8b19165b301b8b6 Author: Martin Schwenke Date: Tue Sep 19 17:47:36 2023 +1000 ctdb-daemon: Call setproctitle_init() Commit 19c82c19c009eefe975ae95c8b709fc93f5f4c39 changed the behaviour of prctl_set_comment() so it now calls setproctitle(3bsd) by default. In some Linux distributions (e.g. Rocky Linux 8.8), this results in messages like this spamming the logs: ctdbd: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor. Most Samba daemons seem to call setproctitle_init(), so do it here. In the longer term CTDB should also switch to using lib/util's process_set_title(), like the rest of Samba, for more flexible process names. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15479 Signed-off-by: Martin Schwenke Reviewed-by: Ralph Boehme Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Sep 21 00:46:50 UTC 2023 on atb-devel-224 --- Summary of changes: ctdb/server/ctdbd.c | 2 ++ 1 file changed, 2 insertions(+) Changeset truncated at 500 lines: diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index 10541cb21f1..a388bff1598 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -170,6 +170,8 @@ int main(int argc, const char *argv[]) const char *test_mode; bool ok; + setproctitle_init(argc, discard_const(argv), environ); + /* * Basic setup */ -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c7672779128 util: Avoid logging to multiple backends for stdout/stderr from 18f44f3ba46 selftest:ndrdump: adjust xattr_NTACL test for ACE coda https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c7672779128ff12eb7a5cb34052559e62adbd5cb Author: Martin Schwenke Date: Wed Jul 26 20:43:37 2023 +1000 util: Avoid logging to multiple backends for stdout/stderr Commit 83fe7a0316d3e5867a56cfdc51ec17f36ea03889 converted the stdout/stderr logging types to DEBUG_FILE to get a header when using DEBUG_SYSLOG_FORMAT_ALWAYS. However, this causes all configured backends to be invoked. When syslog is one of those backends then this is almost certainly not what is intended. Instead, call debug_file_log() directly in that special case and revert the parts of the above commit that convert to file logging. Most of the changes to debughdrclass() still seem necessary, since they handle the change of debug_syslog_format from a bool to an enum. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15460 Signed-off-by: Martin Schwenke Reviewed-by: Douglas Bagnall Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Aug 28 01:21:07 UTC 2023 on atb-devel-224 --- Summary of changes: lib/util/debug.c | 36 +--- 1 file changed, 13 insertions(+), 23 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/util/debug.c b/lib/util/debug.c index b83075cb239..0e13fa564e3 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -1559,25 +1559,10 @@ void check_log_size( void ) static void Debug1(const char *msg, size_t msg_len) { int old_errno = errno; - enum debug_logtype logtype = state.logtype; debug_count++; - if (state.settings.debug_syslog_format == DEBUG_SYSLOG_FORMAT_ALWAYS) { - switch(state.logtype) { - case DEBUG_STDOUT: - case DEBUG_STDERR: - case DEBUG_DEFAULT_STDOUT: - case DEBUG_DEFAULT_STDERR: - /* Behave the same as logging to a file */ - logtype = DEBUG_FILE; - break; - default: - break; - } - } - - switch(logtype) { + switch(state.logtype) { case DEBUG_CALLBACK: debug_callback_log(msg, msg_len, current_msg_level); break; @@ -1585,13 +1570,18 @@ static void Debug1(const char *msg, size_t msg_len) case DEBUG_STDERR: case DEBUG_DEFAULT_STDOUT: case DEBUG_DEFAULT_STDERR: - if (dbgc_config[DBGC_ALL].fd > 0) { - ssize_t ret; - do { - ret = write(dbgc_config[DBGC_ALL].fd, - msg, - msg_len); - } while (ret == -1 && errno == EINTR); + if (state.settings.debug_syslog_format == + DEBUG_SYSLOG_FORMAT_ALWAYS) { + debug_file_log(current_msg_level, msg, msg_len); + } else { + if (dbgc_config[DBGC_ALL].fd > 0) { + ssize_t ret; + do { + ret = write(dbgc_config[DBGC_ALL].fd, + msg, + msg_len); + } while (ret == -1 && errno == EINTR); + } } break; case DEBUG_FILE: -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 230f8db40f1 docs-xml: Fix script idmap backend documentation via 3f76b98037d docs-xml: Tweak autorid idmap backend documentation via 6989ec3873a docs-xml: Fix rid idmap backend documentation from 4da50463e1b smbd: don't leak the fsp if close_file_smb() fails https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 230f8db40f13cece42dbaf1053b4e32233e50282 Author: Martin Schwenke Date: Tue Jul 4 10:49:39 2023 +1000 docs-xml: Fix script idmap backend documentation This was clearly copied from the tdb2 backend and incompletely edited. Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Jul 10 23:47:12 UTC 2023 on atb-devel-224 commit 3f76b98037d70337b0aeb36566e7a18185e523fc Author: Martin Schwenke Date: Tue Jul 4 10:51:59 2023 +1000 docs-xml: Tweak autorid idmap backend documentation The name of the placeholder is misleading. It certainly isn't per domain, so we might as well indicate that it is per range. Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider commit 6989ec3873a099ddaccffe6a4ecc25d544aa5702 Author: Martin Schwenke Date: Tue Jul 4 10:55:19 2023 +1000 docs-xml: Fix rid idmap backend documentation The statement just above the example says the example demonstrates the use of the base_rid parameter. It doesn't, so fix this. Also fix a typo. Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider --- Summary of changes: docs-xml/manpages/idmap_autorid.8.xml | 2 +- docs-xml/manpages/idmap_rid.8.xml | 3 ++- docs-xml/manpages/idmap_script.8.xml | 11 +-- 3 files changed, 4 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/manpages/idmap_autorid.8.xml b/docs-xml/manpages/idmap_autorid.8.xml index 980718f0bd4..9fe73d5c473 100644 --- a/docs-xml/manpages/idmap_autorid.8.xml +++ b/docs-xml/manpages/idmap_autorid.8.xml @@ -59,7 +59,7 @@ - rangesize = numberofidsperdomain + rangesize = numberofidsperrange Defines the number of uids/gids available per domain range. The minimum needed value is 2000. diff --git a/docs-xml/manpages/idmap_rid.8.xml b/docs-xml/manpages/idmap_rid.8.xml index ade4b78d44d..de2f89d6ca2 100644 --- a/docs-xml/manpages/idmap_rid.8.xml +++ b/docs-xml/manpages/idmap_rid.8.xml @@ -28,7 +28,7 @@ - NOTE: The idmap_rid backend can NOT bet used as the default backend. + NOTE: The idmap_rid backend can NOT be used as the default backend. One usually needs to define a writeable default idmap range, using a backend like tdb or ldap that can create unix ids, in order to be able to map the BUILTIN sids @@ -108,6 +108,7 @@ idmap config TRUSTED : backend = rid idmap config TRUSTED : range= 5 - 9 + idmap config TRUSTED : base_rid = 50 diff --git a/docs-xml/manpages/idmap_script.8.xml b/docs-xml/manpages/idmap_script.8.xml index 5ed1390346d..332eb902c24 100644 --- a/docs-xml/manpages/idmap_script.8.xml +++ b/docs-xml/manpages/idmap_script.8.xml @@ -59,20 +59,11 @@ IDMAP SCRIPT - The tdb2 idmap backend supports an external program for performing id mappings + The script idmap backend supports an external program for performing id mappings through the &smb.conf; option idmap config * : script or its deprecated legacy form idmap : script. - - The mappings obtained by the script are then stored in the idmap tdb2 - database instead of mappings created by the incrementing id counters. - It is therefore important that the script covers the complete range of - SIDs that can be passed in for SID to Unix ID mapping, since otherwise - SIDs unmapped by the script might get mapped to IDs that had - previously been mapped by the script. - - The script should accept the following command line options. -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d2940694c6a ctdb-tests: Run ShellCheck on event-script unit test support scripts via b2026e92d68 ctdb-tests: Avoid ShellCheck warnings via a45a76fd19c ctdb-tests: Avoid ShellCheck warning SC2059 via 58a117d3d57 ctdb-tests: Avoid ShellCheck warnings SC2046, SC2005 via 1190c91090a ctdb-tests: Drop unreachable code via cbda1a78dc8 ctdb-tests: Reformat with "shfmt -w -p -i 0 -fn" via 7813c979edb ctdb-tests: Drop unused test code for tunables via 92f17474484 ctdb-tests: Avoid ShellCheck warning SC2086 via 37105addecc ctdb-scripts: Avoid ShellCheck warnings SC2317, SC2086 via aeb5b0adfa7 ctdb-tools: Avoid ShellCheck warning SC2317 from 6965e77268e s3:libads: re-initialize num_requests to 0 for cldap_ping_list retries https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d2940694c6a1d7a842d5d91792f36974846da4e0 Author: Martin Schwenke Date: Mon Jul 3 12:02:36 2023 +1000 ctdb-tests: Run ShellCheck on event-script unit test support scripts Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Jul 5 12:16:57 UTC 2023 on atb-devel-224 commit b2026e92d68c12e0b6169742954a706b6faa7bf8 Author: Martin Schwenke Date: Mon Jul 3 09:32:26 2023 +1000 ctdb-tests: Avoid ShellCheck warnings These are all trivial, so handle them in bulk. * Change code to avoid (approximately sorted by frequency): SC2004 $/${} is unnecessary on arithmetic variables. SC2086 Double quote to prevent globbing and word splitting. SC2162 read without -r will mangle backslashes. SC2254 Quote expansions in case patterns to match literally rather than as a glob. SC2154 (warning): is referenced but not assigned. SC3037 (warning): In POSIX sh, echo flags are undefined. SC2016 (info): Expressions don't expand in single quotes, use double quotes for that. SC2069 (warning): To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify). SC2124 (warning): Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. SC2166 (warning): Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. SC2223 (info): This default assignment may cause DoS due to globbing. Quote it. * Locally disable checks: SC2034 (warning): appears unused. Verify use (or export if used externally). SC2086 (info): Double quote to prevent globbing and word splitting. [once] SC2120 (warning): references arguments, but none are ever passed. SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). While touching reads for SC2162, switch unused variables to "_" instead of "_x", which seems to be preferred by ShellCheck. Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider commit a45a76fd19ce486049583e1e7435320be40f9ef9 Author: Martin Schwenke Date: Tue Jul 4 10:30:05 2023 +1000 ctdb-tests: Avoid ShellCheck warning SC2059 SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". Move the format string to the function and just parameterise the share type. Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider commit 58a117d3d57de416b946c91bf78107d507616e63 Author: Martin Schwenke Date: Mon Jul 3 11:54:15 2023 +1000 ctdb-tests: Avoid ShellCheck warnings SC2046, SC2005 In ./tests/UNIT/eventscripts/scripts/local.sh line 328: echo $(ctdb ifaces -X | awk -F'|' 'FNR > 1 {print $2}') ^-- SC2046 (warning): Quote this to prevent word splitting. ^-- SC2005 (style): Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. Use xargs to get output on 1 line. Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider commit 1190c91090a0b2ea718ebc5a48860d4362bf4c41 Author: Martin Schwenke Date: Mon Jul 3 11:42:56 2023 +1000 ctdb-tests: Drop unreachable code This generates ShellCheck warnings: In ./tests/UNIT/eventscripts/scripts/60.nfs.sh line 412: if [ -n "$service_check_cmd" ]; then ^^ SC2031 (info): service_check_cmd was modified in a subshell. That change might be lost. In ./tests/UNIT/eventscripts/scripts/60.nfs.sh line 413: if eval "$service_check_cmd"; then ^^ SC2031 (info): service_c
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via dde461868f7 ctdb-tests: Add tests for cluster mutex I/O timeout via 25d32ae97a6 ctdb-tests: Terminate event loop if lock is no longer held via 061315cc795 ctdb-mutex: Test the lock by locking a 2nd byte range via 97a1714ee94 ctdb-mutex: open() and fstat() when testing lock file via c07e81abf04 ctdb-mutex: Factor out function fcntl_lock_fd() via 9daf22a5c9d ctdb-mutex: Handle pings from lock checking child to parent via b5db2867913 ctdb-mutex: Do inode checks in a child process via 2ecdbcb22c6 ctdb-mutex: Rename wait_for_lost to lock_io_check via 7ab2e8f1278 ctdb-mutex: Rename recheck_time to recheck_interval via c396b615047 ctdb-mutex: Consistently use progname in error messages via a8da8810f14 ctdb-tests: Add tests for trivial FD monitoring via 8d04235f465 ctdb-common: Add trivial FD monitoring abstraction via f9467cdf3b5 ctdb-build: Link in backtrace support for ctdb_util_tests via 7a1c43fc745 ctdb-build: Separate test backtrace support into separate subsystem via b195e8c0d0c ctdb-build: Sort sources in ctdb-util and ctdb_unit_tests from 3efa56aa61d ctdb-daemon: Fix printing of tickle ACKs https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit dde461868f7bacf10b2aa141acd609ca0c965209 Author: Martin Schwenke Date: Fri Feb 25 19:44:52 2022 +1100 ctdb-tests: Add tests for cluster mutex I/O timeout Block the locker helper child by taking a lock on the 2nd byte of the lock file. This will cause a ping timeout if the process is blocked for long enough. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Jul 28 11:10:54 UTC 2022 on sn-devel-184 commit 25d32ae97a6d7d425eea6f2e9585a1596776493c Author: Martin Schwenke Date: Mon Feb 28 16:11:18 2022 +1100 ctdb-tests: Terminate event loop if lock is no longer held Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 061315cc795d8615fd94d4b23934ca1bf3aecebc Author: Martin Schwenke Date: Tue Feb 8 12:23:42 2022 +1100 ctdb-mutex: Test the lock by locking a 2nd byte range Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 97a1714ee9427ca22201ebcc5201817d59f17764 Author: Martin Schwenke Date: Tue Feb 8 12:15:26 2022 +1100 ctdb-mutex: open() and fstat() when testing lock file This makes a file descriptor available for other I/O. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit c07e81abf04c20fb591376efcaa9b738a60c1a58 Author: Martin Schwenke Date: Tue Feb 8 11:56:46 2022 +1100 ctdb-mutex: Factor out function fcntl_lock_fd() Allows blocking mode and start offset to be specified. Always locks a 1-byte range. Make the lock structure static to avoid initialising the whole structure each time. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 9daf22a5c9d4ccdd706de883141ed807cab4df92 Author: Martin Schwenke Date: Fri Jan 28 13:49:48 2022 +1100 ctdb-mutex: Handle pings from lock checking child to parent The ping timeout is specified by passing an extra argument to the mutex helper, representing the ping timeout in seconds. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit b5db2867913ba451285728844a1725c9ba5e56c0 Author: Martin Schwenke Date: Fri Jan 21 13:37:17 2022 +1100 ctdb-mutex: Do inode checks in a child process In future this will allow extra I/O tests and a timeout in the parent to (hopefully) release the lock if the child gets wedged. For simplicity, use tmon only to detect when either parent or child goes away. Plumbing a timeout for pings from child to parent will be done later. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 2ecdbcb22c69a94576c054761053971774c52099 Author: Martin Schwenke Date: Tue Feb 8 09:35:17 2022 +1100 ctdb-mutex: Rename wait_for_lost to lock_io_check This will be generalised to do more I/O-based checks. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 7ab2e8f127859a436ceb24e7c0a5653ae79b2de5 Author: Martin Schwenke Date: Wed Jan 19 12:09:07 2022 +1100 ctdb-mutex: Rename recheck_time to recheck_interval There will be more timeouts so clarify the intent of this one. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit c396b6150473f87b5767c0cdb3838fd08ebcb4dc Author: Martin Schwenke Date: Tue Mar 1 09:58:22 2022 +1100 ctdb-mutex: Consistently use progname in error messages To avoid error messages having ridiculously long paths, set progname to basename
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via a2590298b03 util: CID 1499409: Memory - corruptions (OVERLAPPING_COPY) from 521e1195640 autobuild: Rewrite the symbol checking https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a2590298b035404d507fac1ea0e11dcd88a939fa Author: Martin Schwenke Date: Fri Feb 18 12:02:50 2022 +1100 util: CID 1499409: Memory - corruptions (OVERLAPPING_COPY) This is quite bizarre: *** CID 1499409: Memory - corruptions (OVERLAPPING_COPY) /lib/util/debug.c: 1742 in dbghdrclass() 1736 sizeof(tvbuf.buf), 1737 "%ld seconds since the Epoch", (long)t); 1738} 1739} 1740 1741ensure_hostname(); >>> CID 1499409: Memory - corruptions (OVERLAPPING_COPY) >>> In the call to function "snprintf", the object pointed to by argument "state.hostname" may overlap with the object pointed to by argument "state.header_str". 1742state.hs_len = snprintf(state.header_str, 1743sizeof(state.header_str), 1744"%s %s %s[%u]: ", 1745tvbuf.buf, 1746state.hostname, 1747state.prog_name, Coverity doesn't explicitly say so but the only way this can happen is if state.hostname is not NUL-terminated within its declared length. ensure_hostname() and debug_set_hostname() ensure NUL-termination, but the caching effect of ensure_hostname() probably stops Coverity from being certain about anything. Try making Coverity happy by using a precision to limit the number of characters from hostname that can be used. Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider Reviewed-by: Andrew Bartlett Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Feb 22 00:17:12 UTC 2022 on sn-devel-184 --- Summary of changes: lib/util/debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/lib/util/debug.c b/lib/util/debug.c index 784357e9370..4143cb6058a 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -1741,8 +1741,9 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func) ensure_hostname(); state.hs_len = snprintf(state.header_str, sizeof(state.header_str), - "%s %s %s[%u]: ", + "%s %.*s %s[%u]: ", tvbuf.buf, + (int)(sizeof(state.hostname) - 1), state.hostname, state.prog_name, (unsigned int) getpid()); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via da2e1047f1f WHATSNEW: Document CTDB leader and cluster lock changes via f7de2132bb9 ctdb-doc: Remove documentation for recovery process via a940ad93706 ctdb-doc: Update example configuration migration script via 01313ea243e ctdb-tests: Improve test coverage for leader role yield and elections via 5d317781498 ctdb-tests: Support commenting out local daemons configuration options via 34d2ca0ae64 ctdb-config: Add configuration option [cluster] leader timeout via 1dfb266038f ctdb-config: [legacy] recmaster capability -> [cluster] leader capability via f5a39058f07 ctdb-config: [cluster] recovery lock -> [cluster] cluster lock via d752a92e115 ctdb-doc: Update documentation for leader and cluster lock via 73555e8248a ctdb-recoverd: Use race for cluster lock as election when lock is enabled via 938d64c8ff3 ctdb-protocol: Mark {GET,SET}_RECMASTER controls obsolete via 03ae158cffc ctdb-protocol: Drop marshalling for {GET,SET}_RECMASTER controls via a76374070d3 ctdb-daemon: Drop implementation of {GET,SET}_RECMASTER controls via 193b624d26a ctdb-protocol: Drop protocol client functions for recmaster controls via cda673ff6dc ctdb-client: Drop unused recmaster functions via 16efbca0036 ctdb-daemon: Drop unused old client recmaster functions via c68267b2a60 ctdb-recoverd: Drop calls to ctdb_ctrl_setrecmaster() via 58d7fcdf7c9 ctdb-recoverd: Drop recovery master verification via f02e0974857 ctdb-tools: recovery master -> leader via e60581d5b5e ctdb-tools: Use leader broadcast in get_leader() via 92fb68e9b8a ctdb-tools: Factor out get_leader() via 17ba15ccd88 ctdb-tools: Handle leader broadcasts in ctdb tool via ec90f36cc61 ctdb-tools: Print "UNKNOWN" when leader PNN is unknown via 01a8d1a4a40 ctdb-client: Factor out function ctdb_client_wait_func_timeout() via 403db5b5288 ctdb-tests: Factor out getting leader and waiting for leader change via 4786982cc80 ctdb-tests: Add leader broadcasts to fake_ctdbd via 756dfdfed9f ctdb-tests: Implement srvid_handler for dispatching messages via 958746f947d ctdb-recoverd: Simplify some stopped/banned checks to inactive checks via 358c59f51ab ctdb-recoverd: No longer take cluster lock during recovery via 36ffaaa691c ctdb-recoverd: Add and use function cluster_lock_enabled() via 5ee664ee17f ctdb-recoverd: Terminology change: recovery lock -> cluster lock via 0f2250f4f9f ctdb-recoverd: Take cluster lock when election completes via 011e880002b ctdb-recoverd: Factor out function cluster_lock_take() via 037abf86206 ctdb-tests: Avoid a race via ef7e3265f76 ctdb-tests: Setup cluster with expected arguments via b029ca4d513 ctdb-recoverd: Drop leader validation via 7e53fab0a36 ctdb-recoverd: Drop special case for elected-before-connected via ef4b8c13c07 ctdb-recoverd: Handle leader broadcast timeout via 5c7f6da0f0e ctdb-recoverd: Send leader broadcasts via 789a75abfa2 ctdb-recoverd: Process leader broadcasts via 3d3767a259b ctdb-protocol: Add CTDB_SRVID_LEADER via c2cfd9c21aa ctdb-recoverd: Add an explicit flag for election in progress via ac5a3ca063f ctdb-recoverd: Only start election if node can be leader via 7baadfe27ed ctdb-recoverd: Add and use function this_node_can_be_leader() via 94b546c268e ctdb-recoverd: Logging/comments: recovery master -> leader via dd79e9bd14d ctdb-recoverd: Rename recmaster field to leader via 2ee6763c7d9 ctdb-recoverd: Use rec->pnn everywhere via 4af3b10a378 ctdb-recoverd: Change argument to srvid_disable_and_reply() via b7c138ca99a ctdb-recoverd: Simplify arguments to ctdb_ban_node() via a5e0ddac626 ctdb-recoverd: Simplify arguments to verify_local_ip_allocation() via 67b51916408 ctdb-recoverd: Simplify arguments to do_recovery() via 57882beb16a ctdb-recoverd: Simplify arguments to some election functions via 9dbe7cc85e4 ctdb-recoverd: Add PNN to recovery daemon context via ff0140e4700 ctdb-recoverd: Use this_node_is_leader() in an extra context via c8721d01c65 ctdb-recoverd: Factor out and use function this_node_is_leader() from 57a32cebdd8 ctdb-recoverd: Pass SIGHUP to running helper https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit da2e1047f1fc9f0ac98490c79c21c427b47274d5 Author: Martin Schwenke Date: Fri Jan 14 13:39:34 2022 +1100 WHATSNEW: Document CTDB leader and cluster lock changes Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(mast
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 1719ef7893a ctdb-tests: Drop unused function ctdb_get_all_public_addresses() via 4e3676cb3c4 ctdb-tests: add a comment to the generated public_addresses file used by eventscript UNIT tests via 5426c104f50 ctdb-tests: Fix typo in ctdb stub comment matching via 530e8d4b9e4 ctdb-scripts: filter out comments in public_addresses file from 0a376b23dba s3: VFS: zfsacl: Ensure we use a pathref fd, not an io fd, for getting/setting ZFS ACLs. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1719ef7893ae5dc87e452c24bafd55db598464bc Author: Martin Schwenke Date: Tue Oct 12 12:27:51 2021 +1100 ctdb-tests: Drop unused function ctdb_get_all_public_addresses() Signed-off-by: Martin Schwenke Reviewed-by: Ralph Boehme Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Oct 12 23:24:18 UTC 2021 on sn-devel-184 commit 4e3676cb3c4d24cd4c287703d2cd812a2a8c36ff Author: Ralph Boehme Date: Fri Oct 8 05:58:37 2021 +0200 ctdb-tests: add a comment to the generated public_addresses file used by eventscript UNIT tests test stub code has been updated to handle this, so now let's put it to work. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14826 RN: Correctly ignore comments in CTDB public addresses file Signed-off-by: Ralph Boehme Reviewed-by: Martin Schwenke commit 5426c104f5090751c1ea02f0c0667d8d071a4a83 Author: Martin Schwenke Date: Tue Oct 12 12:19:27 2021 +1100 ctdb-tests: Fix typo in ctdb stub comment matching BUG: https://bugzilla.samba.org/show_bug.cgi?id=14826 Signed-off-by: Martin Schwenke Reviewed-by: Ralph Boehme commit 530e8d4b9e47601b88e20bcaefa2d502efcebe60 Author: Ralph Boehme Date: Wed Sep 8 16:53:12 2021 +0200 ctdb-scripts: filter out comments in public_addresses file Note that order of sed expressions matters: the expression to delete comment lines must come first as the second expression would transform # comment to comment BUG: https://bugzilla.samba.org/show_bug.cgi?id=14826 Signed-off-by: Ralph Boehme Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/config/events/legacy/10.interface.script | 3 ++- ctdb/config/functions | 3 +++ ctdb/tests/UNIT/eventscripts/scripts/local.sh | 11 +-- ctdb/tests/UNIT/eventscripts/stubs/ctdb | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/config/events/legacy/10.interface.script b/ctdb/config/events/legacy/10.interface.script index 72e0c101d47..d87f6c52c58 100755 --- a/ctdb/config/events/legacy/10.interface.script +++ b/ctdb/config/events/legacy/10.interface.script @@ -25,7 +25,8 @@ fi get_all_interfaces () { # Get all the interfaces listed in the public_addresses file -all_interfaces=$(sed -e 's/^[^\t ]*[\t ]*//' \ +all_interfaces=$(sed -e '/^#.*/d' \ +-e 's/^[^\t ]*[\t ]*//' \ -e 's/,/ /g' \ -e 's/[\t ]*$//' "$ctdb_public_addresses") diff --git a/ctdb/config/functions b/ctdb/config/functions index 2395d8d4dc8..a4e73ad0594 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -611,6 +611,9 @@ drop_all_public_ips () # _x is intentionally ignored # shellcheck disable=SC2034 while read _ip _x ; do + case "$_ip" in + \#*) continue ;; + esac drop_ip "$_ip" done <"${CTDB_BASE}/public_addresses" } diff --git a/ctdb/tests/UNIT/eventscripts/scripts/local.sh b/ctdb/tests/UNIT/eventscripts/scripts/local.sh index 0f78fcb3845..84a5fc9772f 100644 --- a/ctdb/tests/UNIT/eventscripts/scripts/local.sh +++ b/ctdb/tests/UNIT/eventscripts/scripts/local.sh @@ -282,6 +282,7 @@ setup_public_addresses () echo "Setting up public addresses in ${_f}" cat >"$_f" <
[SCM] Samba Website Repository - branch master updated
The branch, master has been updated via 6d4ce66 team: Add employer for Martin from bbd6860 NEWS[4.15.0rc7]: Samba 4.15.0rc7 Available for Download https://git.samba.org/?p=samba-web.git;a=shortlog;h=master - Log - commit 6d4ce66615cdabf667ea66b948a453c4699ff1cf Author: Martin Schwenke Date: Thu Sep 16 09:32:58 2021 +1000 team: Add employer for Martin Signed-off-by: Martin Schwenke --- Summary of changes: team/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/team/index.html b/team/index.html index aa2288a..117259f 100755 --- a/team/index.html +++ b/team/index.html @@ -87,7 +87,7 @@ mailing list and start contributing to the development of Samba. Garming Sam (http://catalyst.net.nz/what-we-offer/enterprise-solutions/samba";>Catalyst) mailto:c...@samba.org";>Christof Schmitt https://www.samba.org/~asn/";>Andreas Schneider (https://www.redhat.com/";>Red Hat) -https://meltin.net/martin/";>Martin Schwenke +https://meltin.net/martin/";>Martin Schwenke (https://www.ddn.com/";>DDN) mailto:ksee...@samba.org";>Karolin Seeger (https://www.sernet.de/en/";>SerNet) http://www.richardsharpe.com";>Richard Sharpe mailto:i...@samba.org";>Simo Sorce (https://www.redhat.com/";>Red Hat) -- Samba Website Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b724c1e6a66 utils: Avoid pylint warning via 319e27343d7 utils: Reformat lines that are longer than 80 columns via 98c7a38b711 utils: Tweak exception handling to stop flake8 complaining via 12d3e215a60 utils: Simplify log level logic, drop global variable via e323d16a9d1 utils: Inline defaults and help strings via af5aecced12 utils: Move argument processing into function and call from main() via e66637a079c utils: Reorder imports so that standard imports are first via bd0b2bb6ee9 utils: Clean up ctdb_etcd_lock using autopep8 via 939aed04982 utils: Use Python 3 from d961830cb59 examples: Make winreg.py sample work with python3 in current master https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b724c1e6a660eb6b9ceaf3c81d6dac0b0562206d Author: Martin Schwenke Date: Tue Apr 27 15:45:17 2021 +1000 utils: Avoid pylint warning pylint warns: Use lazy % formatting in logging functions Signed-off-by: Martin Schwenke Reviewed-by: David Disseldorp Reviewed-by: Jose A. Rivera Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Jul 20 05:29:18 UTC 2021 on sn-devel-184 commit 319e27343d7ee5f7f6045a19747ba85fb4bef768 Author: Martin Schwenke Date: Tue Apr 27 15:37:43 2021 +1000 utils: Reformat lines that are longer than 80 columns Signed-off-by: Martin Schwenke Reviewed-by: David Disseldorp Reviewed-by: Jose A. Rivera commit 98c7a38b711d38ac756ca7e34769eb277904f7d0 Author: Martin Schwenke Date: Tue Apr 27 14:56:20 2021 +1000 utils: Tweak exception handling to stop flake8 complaining Don't bother with "as e" to avoid warning about unused variable. Don't use bare "except:" (though pylint still complains about this version). Signed-off-by: Martin Schwenke Reviewed-by: David Disseldorp Reviewed-by: Jose A. Rivera commit 12d3e215a6096fc9862642b98dd8bca1421f2cae Author: Martin Schwenke Date: Wed May 26 11:18:04 2021 +1000 utils: Simplify log level logic, drop global variable Signed-off-by: Martin Schwenke Reviewed-by: David Disseldorp Reviewed-by: Jose A. Rivera commit e323d16a9d11c63640fca186c6f5a29360fb3c7b Author: Martin Schwenke Date: Tue Apr 27 14:50:15 2021 +1000 utils: Inline defaults and help strings Removes an unnecessary level of indirection: defaults and help strings are now where they are expected. Also removes some global variables. Signed-off-by: Martin Schwenke Reviewed-by: David Disseldorp Reviewed-by: Jose A. Rivera commit af5aecced12a8f6a9259602f8ddf3662fe6c1ba0 Author: Martin Schwenke Date: Wed May 26 10:57:07 2021 +1000 utils: Move argument processing into function and call from main() Removes the need for the global variables currently associated with this processing. Also removes unnecessarily double-handling the defaults, which are assigned to the global variables and set via add_argument(). Signed-off-by: Martin Schwenke Reviewed-by: David Disseldorp Reviewed-by: Jose A. Rivera commit e66637a079c070d29c685b6315e5427679dc778a Author: Martin Schwenke Date: Tue Apr 27 13:00:49 2021 +1000 utils: Reorder imports so that standard imports are first Avoids numerous pylint warnings. Signed-off-by: Martin Schwenke Reviewed-by: David Disseldorp Reviewed-by: Jose A. Rivera commit bd0b2bb6ee9d03a259e7d7e9f4397f4dbe3f1b91 Author: Martin Schwenke Date: Tue Apr 27 12:59:17 2021 +1000 utils: Clean up ctdb_etcd_lock using autopep8 Signed-off-by: Martin Schwenke Reviewed-by: David Disseldorp Reviewed-by: Jose A. Rivera commit 939aed0498269df3c1e012f3b68c314b583f25bd Author: Martin Schwenke Date: Tue Apr 27 15:46:14 2021 +1000 utils: Use Python 3 Due to the number of flake8 and pylint warnings it is unclear if the source has Python 3 incompatibilities. These will be cleaned up in subsequent commits. Signed-off-by: "L.P.H. van Belle" Reviewed-by: Martin Schwenke Reviewed-by: David Disseldorp Reviewed-by: Jose A. Rivera --- Summary of changes: ctdb/utils/etcd/ctdb_etcd_lock | 275 + 1 file changed, 140 insertions(+), 135 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/utils/etcd/ctdb_etcd_lock b/ctdb/utils/etcd/ctdb_etcd_lock index 000c6bb7208..5e722267cd3 100755 --- a/ctdb/utils/etcd/ctdb_etcd_lock +++ b/ctdb/utils/etcd/ctdb_etcd_lock @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # #This program is free software: you can redistribute it and/or mo
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6601b3ac544 bootstrap: Update distro list in README.md via 1c59f49aaed bootstrap: Cope with case changes in CentOS 8 repo names from 49256925996 libsmb: Remove unused ads_dns_query_* routines https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6601b3ac544244563a8cd3cdb5a4bc7da1b4a759 Author: Martin Schwenke Date: Fri Dec 11 15:57:37 2020 +1100 bootstrap: Update distro list in README.md Update examples to make them valid. Signed-off-by: Martin Schwenke Reviewed-by: Andrew Bartlett Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Dec 15 12:03:58 UTC 2020 on sn-devel-184 commit 1c59f49aaede8ec1662d4e49aef84fcd902a8a76 Author: Martin Schwenke Date: Wed Dec 9 00:03:47 2020 +1100 bootstrap: Cope with case changes in CentOS 8 repo names RN: Be more flexible with repository names in CentOS 8 test environments BUG: https://bugzilla.samba.org/show_bug.cgi?id=14594 Signed-off-by: Martin Schwenke Reviewed-by: Andrew Bartlett --- Summary of changes: .gitlab-ci.yml | 2 +- bootstrap/README.md| 12 ++-- bootstrap/config.py| 6 -- bootstrap/generated-dists/centos8/bootstrap.sh | 6 -- bootstrap/sha1sum.txt | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index accaced66a0..7a7582cb6db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,7 +32,7 @@ variables: # Set this to the contents of bootstrap/sha1sum.txt # which is generated by bootstrap/template.py --render # - SAMBA_CI_CONTAINER_TAG: 42ecbfbf716fa85ce251a955de72a92af26fc7b2 + SAMBA_CI_CONTAINER_TAG: c4c00eb35cae36d8d6e752ee01fd943432993721 # # We use the ubuntu1804 image as default as # it matches what we have on sn-devel-184. diff --git a/bootstrap/README.md b/bootstrap/README.md index d4f30955197..47ef1c67836 100644 --- a/bootstrap/README.md +++ b/bootstrap/README.md @@ -12,8 +12,8 @@ A pure python3 module with CLI to bootstrap Samba envs for multiple distribution ## Supported Distributions -deb: Debian 7|8|9|10, Ubuntu 1404|1604|1804 -rpm: CentOS 6|7, Fedora 28|29, openSUSE Leap 15.0|15.1 +deb: Debian 10, Ubuntu 1604|1804|2004 +rpm: CentOS 7|8, Fedora 32|33, openSUSE Leap 15.1|15.2 Easy to add more. @@ -86,14 +86,14 @@ With Vagrant: cd bootstrap/generated-dists/ vagrant up # start all - vagrant up debian9 # start one - vagrant ssh debian9 - vagrant destroy debian9 # destroy one + vagrant up debian10 # start one + vagrant ssh debian10 + vagrant destroy debian10 # destroy one vagrant destroy # destroy all Or a remote/cloud machine: - scp bootstrap/generated-dists/fedora30/bootstrap.sh USER@IP: + scp bootstrap/generated-dists/fedora33/bootstrap.sh USER@IP: ssh USER@IP sudo bash ./bootstrap.sh diff --git a/bootstrap/config.py b/bootstrap/config.py index 982ebae1cd1..8383aeb392d 100644 --- a/bootstrap/config.py +++ b/bootstrap/config.py @@ -235,8 +235,10 @@ yum install -y dnf-plugins-core yum install -y epel-release yum -v repolist all -yum config-manager --set-enabled PowerTools -y -yum config-manager --set-enabled Devel -y +yum config-manager --set-enabled PowerTools -y || \ +yum config-manager --set-enabled powertools -y +yum config-manager --set-enabled Devel -y || \ +yum config-manager --set-enabled devel -y yum update -y yum install -y \ diff --git a/bootstrap/generated-dists/centos8/bootstrap.sh b/bootstrap/generated-dists/centos8/bootstrap.sh index e5167a2b561..b9f2df67645 100755 --- a/bootstrap/generated-dists/centos8/bootstrap.sh +++ b/bootstrap/generated-dists/centos8/bootstrap.sh @@ -12,8 +12,10 @@ yum install -y dnf-plugins-core yum install -y epel-release yum -v repolist all -yum config-manager --set-enabled PowerTools -y -yum config-manager --set-enabled Devel -y +yum config-manager --set-enabled PowerTools -y || \ +yum config-manager --set-enabled powertools -y +yum config-manager --set-enabled Devel -y || \ +yum config-manager --set-enabled devel -y yum update -y yum install -y \ diff --git a/bootstrap/sha1sum.txt b/bootstrap/sha1sum.txt index 46493c16eb0..3e87c2ed1b0 100644 --- a/bootstrap/sha1sum.txt +++ b/bootstrap/sha1sum.txt @@ -1 +1 @@ -42ecbfbf716fa85ce251a955de72a92af26fc7b2 +c4c00eb35cae36d8d6e752ee01fd943432993721 -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6aa396b0cd1 ctdb-common: Avoid aliasing errors during code optimization from 9dfeb81d08c fuzz/oss-fuzz/build_samba: fetch fuzz seeds https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6aa396b0cd1f83f45cb76a4f3123d99135e8dd8c Author: Amitay Isaacs Date: Mon Jul 27 12:51:41 2020 +1000 ctdb-common: Avoid aliasing errors during code optimization When compiling with GCC 10.x and -O3 optimization, the IP checksum calculation code generates wrong checksum. The function uint16_checksum gets inlined during optimization and ip4pkt->tcp data gets wrongly aliased. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14537 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Oct 21 05:52:28 UTC 2020 on sn-devel-184 --- Summary of changes: ctdb/common/system_socket.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/system_socket.c b/ctdb/common/system_socket.c index af297f8608b..bb513508353 100644 --- a/ctdb/common/system_socket.c +++ b/ctdb/common/system_socket.c @@ -67,16 +67,19 @@ /* uint16 checksum for n bytes */ -static uint32_t uint16_checksum(uint16_t *data, size_t n) +static uint32_t uint16_checksum(uint8_t *data, size_t n) { uint32_t sum=0; + uint16_t value; + while (n>=2) { - sum += (uint32_t)ntohs(*data); - data++; + memcpy(&value, data, 2); + sum += (uint32_t)ntohs(value); + data += 2; n -= 2; } if (n == 1) { - sum += (uint32_t)ntohs(*(uint8_t *)data); + sum += (uint32_t)ntohs(*data); } return sum; } @@ -117,13 +120,13 @@ bool ctdb_sys_have_ip(ctdb_sock_addr *_addr) /* * simple TCP checksum - assumes data is multiple of 2 bytes long */ -static uint16_t ip_checksum(uint16_t *data, size_t n, struct ip *ip) +static uint16_t ip_checksum(uint8_t *data, size_t n, struct ip *ip) { uint32_t sum = uint16_checksum(data, n); uint16_t sum2; - sum += uint16_checksum((uint16_t *)&ip->ip_src, sizeof(ip->ip_src)); - sum += uint16_checksum((uint16_t *)&ip->ip_dst, sizeof(ip->ip_dst)); + sum += uint16_checksum((uint8_t *)&ip->ip_src, sizeof(ip->ip_src)); + sum += uint16_checksum((uint8_t *)&ip->ip_dst, sizeof(ip->ip_dst)); sum += ip->ip_p + n; sum = (sum & 0x) + (sum >> 16); sum = (sum & 0x) + (sum >> 16); @@ -135,22 +138,22 @@ static uint16_t ip_checksum(uint16_t *data, size_t n, struct ip *ip) return sum2; } -static uint16_t ip6_checksum(uint16_t *data, size_t n, struct ip6_hdr *ip6) +static uint16_t ip6_checksum(uint8_t *data, size_t n, struct ip6_hdr *ip6) { uint16_t phdr[3]; uint32_t sum = 0; uint16_t sum2; uint32_t len; - sum += uint16_checksum((uint16_t *)(void *)&ip6->ip6_src, 16); - sum += uint16_checksum((uint16_t *)(void *)&ip6->ip6_dst, 16); + sum += uint16_checksum((uint8_t *)&ip6->ip6_src, 16); + sum += uint16_checksum((uint8_t *)&ip6->ip6_dst, 16); len = htonl(n); phdr[0] = len & UINT16_MAX; phdr[1] = (len >> 16) & UINT16_MAX; /* ip6_nxt is only 8 bits, so fits comfortably into a uint16_t */ phdr[2] = htons(ip6->ip6_nxt); - sum += uint16_checksum(phdr, sizeof(phdr)); + sum += uint16_checksum((uint8_t *)phdr, sizeof(phdr)); sum += uint16_checksum(data, n); @@ -316,7 +319,7 @@ static int ip6_na_build(uint8_t *buffer, sizeof(struct nd_opt_hdr)); memcpy(ea, hwaddr, ETH_ALEN); - nd_na->nd_na_cksum = ip6_checksum((uint16_t *)nd_na, + nd_na->nd_na_cksum = ip6_checksum((uint8_t *)nd_na, ntohs(ip6->ip6_plen), ip6); @@ -556,7 +559,7 @@ static int tcp4_build(uint8_t *buf, ip4pkt->tcp.th_off = sizeof(ip4pkt->tcp)/sizeof(uint32_t); /* this makes it easier to spot in a sniffer */ ip4pkt->tcp.th_win = htons(1234); - ip4pkt->tcp.th_sum = ip_checksum((uint16_t *)&ip4pkt->tcp, + ip4pkt->tcp.th_sum = ip_checksum((uint8_t *)&ip4pkt->tcp, sizeof(ip4pkt->tcp), &ip4pkt->ip); @@ -609,7 +612,7 @@ static int tcp6_build(uint8_t *buf, ip6pkt->tcp.th_off
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via a6ff80cdc1b s3:ctdbd_conn: Fix the build on FreeBSD from 930695b04d2 fuzz_dcerpc_parse_binding: don't leak https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a6ff80cdc1b16f32716bc54c052e8fa8b149b4f9 Author: Martin Schwenke Date: Tue Oct 20 14:47:20 2020 +1100 s3:ctdbd_conn: Fix the build on FreeBSD Commit 6b9564c1084d8dc7319857fac984808571ef0eb9 broke the build on FreeBSD: [2321/3909] Compiling source3/smbd/process.c ../../source3/smbd/process.c:2797:10: error: use of undeclared identifier 'EREMOTEIO' return EREMOTEIO; ^ ../../source3/smbd/process.c:2833:14: error: use of undeclared identifier 'EREMOTEIO' if (ret == EREMOTEIO) { ^ 2 errors generated. Use one of the POSIX error codes instead. Signed-off-by: Martin Schwenke Reviewed-by: David Disseldorp Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Oct 20 07:22:08 UTC 2020 on sn-devel-184 --- Summary of changes: source3/smbd/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 4cf53720067..9e861554fa7 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -2794,7 +2794,7 @@ static int match_cluster_movable_ip(uint32_t total_ip_count, }; if (is_movable_ip && sockaddr_equal(&pub_ip.u.sa, &srv_ip.u.sa)) { - return EREMOTEIO; + return EADDRNOTAVAIL; } return 0; @@ -2830,7 +2830,7 @@ static NTSTATUS smbd_register_ips(struct smbXsrv_connection *xconn, ret = ctdbd_public_ip_foreach(cconn, match_cluster_movable_ip, srv); - if (ret == EREMOTEIO) { + if (ret == EADDRNOTAVAIL) { xconn->has_cluster_movable_ip = true; DBG_DEBUG("cluster movable IP on %s\n", smbXsrv_connection_dbg(xconn)); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via bbcab57955d WHATSNEW: Fix description of CTDB NAT gateway and LVS changes from db4b52b73e8 WHATSNEW: Document CTDB NAT gateway and LVS changes https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit bbcab57955d874cd9ef09c33e207d90693dce4d5 Author: Martin Schwenke Date: Sun Jul 26 06:50:22 2020 +1000 WHATSNEW: Fix description of CTDB NAT gateway and LVS changes Oops! Using parentheses makes it harder to get this wrong. Reported-by: Volker Lendecke Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sun Jul 26 13:01:09 UTC 2020 on sn-devel-184 --- Summary of changes: WHATSNEW.txt | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/WHATSNEW.txt b/WHATSNEW.txt index b278192e41d..f76aa4e79a0 100644 --- a/WHATSNEW.txt +++ b/WHATSNEW.txt @@ -34,10 +34,11 @@ CTDB CHANGES * The NAT gateway and LVS features now uses the term "leader" to refer to the main node in a group through which traffic is routed and "follower" for other members of a group. The command for - determining the leader has changed to "ctdb natgw master" from - "ctdb natgw leader". The "slave-only" configuration element has - changed to "follower-only" from "slave-only". Identical changes - were made for LVS. + determining the leader has changed to "ctdb natgw leader" (from + "ctdb natgw master"). The configuration keyword for indicating that + a node can not be the leader of a group has changed to + "follower-only" (from "slave-only"). Identical changes were made + for LVS. REMOVED FEATURES -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 5ce6133a751 ctdb-recoverd: Simplify calculation of new flags via 3654e416770 ctdb-recoverd: Correctly find nodemap entry for pnn via 9475ab04416 ctdb-recoverd: Do not retrieve nodemap from recovery master via 0c6a7db3ba8 ctdb-recoverd: Flatten update_flags_on_all_nodes() via a88c10c5a9a ctdb-recoverd: Move ctdb_ctrl_modflags() to ctdb_recoverd.c via b1e631ff929 ctdb-recoverd: Improve a call to update_flags_on_all_nodes() via 915d24ac12d ctdb-recoverd: Use update_flags_on_all_nodes() via f681c0e9477 ctdb-recoverd: Introduce some local variables to improve readability via cb3a3147b7a ctdb-recoverd: Change update_flags_on_all_nodes() to take rec argument via 6982fcb3e6c ctdb-recoverd: Drop unused nodemap argument from update_flags_on_all_nodes() from 484a764e832 ctdb-tests: Improve test portability/quality https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 5ce6133a75107abdcb9fcfd93bc7594812dc5055 Author: Martin Schwenke Date: Tue Jul 14 14:29:09 2020 +1000 ctdb-recoverd: Simplify calculation of new flags Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Jul 24 06:03:23 UTC 2020 on sn-devel-184 commit 3654e416770cc7521dcc3c15976daeba37023304 Author: Martin Schwenke Date: Tue Jul 14 14:22:15 2020 +1000 ctdb-recoverd: Correctly find nodemap entry for pnn Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 9475ab044161e687b9ced3a477746393565b49b1 Author: Martin Schwenke Date: Tue May 5 23:49:05 2020 +1000 ctdb-recoverd: Do not retrieve nodemap from recovery master It is already in rec->nodemap. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 0c6a7db3ba84b8355359b0a8c52690b234bb866d Author: Martin Schwenke Date: Fri Sep 28 10:46:17 2018 +1000 ctdb-recoverd: Flatten update_flags_on_all_nodes() The logic currently in ctdb_ctrl_modflags() will be optimised so that it no longer matches the pattern for a control function. So, remove this function and squash its functionality into the only caller. Although there are some superficial changes, the behaviour is unchanged. Flattening the 2 functions produces some seriously weird logic for setting the new flags, to the point where using ctdb_ctrl_modflags() for this purpose now looks very strange. The weirdness will be cleaned up in a subsequent commit. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit a88c10c5a9afcf0a3dcadef07dd95af498bfa47a Author: Martin Schwenke Date: Tue May 5 23:37:57 2020 +1000 ctdb-recoverd: Move ctdb_ctrl_modflags() to ctdb_recoverd.c This file is the only user of this function. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit b1e631ff929fd87392a80895d1c8d265d9df42dc Author: Martin Schwenke Date: Tue Jul 14 14:43:04 2020 +1000 ctdb-recoverd: Improve a call to update_flags_on_all_nodes() This should take a PNN, not an array index. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 915d24ac12d27c21649d9e64d201d9df9d583129 Author: Martin Schwenke Date: Sat Jun 15 07:20:19 2019 +1000 ctdb-recoverd: Use update_flags_on_all_nodes() This is clearer than using the MODFLAGS control directly. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit f681c0e947741151f8fb95d88edddfd732166dc1 Author: Martin Schwenke Date: Sat Jun 15 07:19:26 2019 +1000 ctdb-recoverd: Introduce some local variables to improve readability Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit cb3a3147b7a3a29d7806733791e1fa6ba2e46680 Author: Martin Schwenke Date: Tue May 5 23:45:15 2020 +1000 ctdb-recoverd: Change update_flags_on_all_nodes() to take rec argument This makes fields such as recmaster and nodemap easily available if required. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 6982fcb3e6c940d0047aac3b6bfbc9dfdc8d7214 Author: Martin Schwenke Date: Thu Jan 18 20:25:07 2018 +1100 ctdb-recoverd: Drop unused nodemap argument from update_flags_on_all_nodes() An unused argument needlessly extends the length of function calls. A subsequent change will allow rec->nodemap to be used if necessary. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- Summary of changes: ctdb/include/ctdb_client.h | 5 --- ctdb/server/ctdb_client.c | 65 --- ctdb/server/ctdb_recoverd.c
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 484a764e832 ctdb-tests: Improve test portability/quality via f4c2c77ff72 ctdb-tests: Improve test quality via c6c81ea2879 ctdb-tests: Improve test portability via 244eaad76a8 ctdb-tests: Improve test quality via 760c3039b07 ctdb-tests: Improve test portability via 41ff58338a0 ctdb-tests: Drop uses of "onnode any ..." in testcases via ce3de398947 ctdb-tests: Don't bother shutting down daemons in ctdb_init() via 37c26a9590b ctdb-tests: Separate custom cluster startup from test initialisation via a766136df45 ctdb-tests: Do not trigger ctdb_test_error() from ctdb_init() via a369bedf8c5 ctdb-tests: Make unit.sh pass shellcheck via be3065ea958 ctdb-tests: Make integration.bash pass shellcheck via d6673528050 ctdb-tests: Use "#!/usr/bin/env bash" for improved portability via 8b24cae6303 ctdb-tests: Update preamble for INTEGRATION tests via 0f201dd67a0 ctdb-tests: Drop unreachable line via 29a3fce28f3 ctdb-tests: Redirect stderr too when checking for shellcheck via 1565446508f ctdb-tests: Show hung script debugging output via 70c38d404b4 ctdb-tests: Enable SOCKET_WRAPPER_DIR_ALLOW_ORIG via 066c205e5fb ctdb-build: Don't build/install tests in top-level build by default via 3ff8765d04c ctdb-tests: Stop cat command failure from causing test failure from 6436c74ebf6 Revert "ctdb-build: Don't build/install tests in top-level build by default" https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 484a764e832bcfcaf15a1c6f157643bd0e0df5d1 Author: Martin Schwenke Date: Fri Mar 6 05:10:05 2020 +1100 ctdb-tests: Improve test portability/quality Avoid use of non-portable md5sum by constructing database names using index. Improve indentation, use more modern commands, code improvements (shellcheck). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Jul 22 09:14:35 UTC 2020 on sn-devel-184 commit f4c2c77ff726dd7d28a7d8c3cd815c802a8a6cfa Author: Martin Schwenke Date: Thu Mar 5 21:53:33 2020 +1100 ctdb-tests: Improve test quality Simplify code, use more modern commands, code improvements (shellcheck). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit c6c81ea287924c2924aebc6dc0cdea1dc4322ae2 Author: Martin Schwenke Date: Thu Mar 5 21:48:59 2020 +1100 ctdb-tests: Improve test portability "wc -l" on some platforms (e.g. FreeBSD) contains leading spaces, so strip them. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 244eaad76a83f13399c3fffbde4783ecb1bc9f85 Author: Martin Schwenke Date: Thu Mar 5 20:42:01 2020 +1100 ctdb-tests: Improve test quality Select test node with IPs instead of using a fixed node. Remove unnecessary code, use more modern commands, code improvements (shellcheck). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 760c3039b0752204090b493132ad32bad4140064 Author: Martin Schwenke Date: Thu Mar 5 20:21:26 2020 +1100 ctdb-tests: Improve test portability "wc -l" on some platforms (e.g. FreeBSD) contains leading spaces and stops "$num from being a number. Create a more portable solution and put it in a function instead of repeating the logic. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 41ff58338a0b36dfccc19579c8edfa5939cd5978 Author: Martin Schwenke Date: Tue Dec 10 11:33:02 2019 +1100 ctdb-tests: Drop uses of "onnode any ..." in testcases It would be nice to get rid of "onnode any". There's no use making tests nondeterministic. If covering different cases matters then they should be explicitly handled. In most places "any" is replaced by "$test_node". In some cases, where $test_node is not set, a fixed node that is already used elsewhere can be reused. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit ce3de3989470d186ce73e6e74aa7f16111e2a6fa Author: Martin Schwenke Date: Tue Dec 10 14:47:23 2019 +1100 ctdb-tests: Don't bother shutting down daemons in ctdb_init() They'll never be up here... Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 37c26a9590b2d6712b38cf249538b512c6f6b546 Author: Martin Schwenke Date: Tue Dec 10 14:44:45 2019 +1100 ctdb-tests: Separate custom cluster startup from test initialisation Separate cluster startup from test initialisation for tests that start the cluster with customised configu
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6436c74ebf6 Revert "ctdb-build: Don't build/install tests in top-level build by default" via bdd89d52761 Revert "ctdb-tests: Enable SOCKET_WRAPPER_DIR_ALLOW_ORIG" via 6a3372e8958 Revert "ctdb-tests: Show hung script debugging output" via e4b1cdc7090 Revert "ctdb-tests: Redirect stderr too when checking for shellcheck" via a694c07126e Revert "ctdb-tests: Drop unreachable line" via 4438e44f880 Revert "ctdb-tests: Update preamble for INTEGRATION tests" via 271ad95e235 Revert "ctdb-tests: Use "#!/usr/bin/env bash" for improved portability" via 60d999ad941 Revert "ctdb-tests: Make integration.bash pass shellcheck" via 548f2021df6 Revert "ctdb-tests: Make unit.sh pass shellcheck" via da654f97951 Revert "ctdb-tests: Do not trigger ctdb_test_error() from ctdb_init()" via e11526ad542 Revert "ctdb-tests: Separate custom cluster startup from test initialisation" via 941a2d0a3b7 Revert "ctdb-tests: Don't bother shutting down daemons in ctdb_init()" via c9dfdeaddc9 Revert "ctdb-tests: Drop uses of "onnode any ..." in testcases" via 635d5cfa31a Revert "ctdb-tests: Improve test portability" via c83ece42e5b Revert "ctdb-tests: Improve test quality" via cf3b1fb3900 Revert "ctdb-tests: Improve test portability" via 979a6c8c5fe Revert "ctdb-tests: Improve test quality" via d035b69b535 Revert "ctdb-tests: Improve test portability/quality" via 5948a57920c Revert "ctdb-tests: Stop cat command failure from causing test failure" from 5707781ccf6 ctdb-tests: Stop cat command failure from causing test failure https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6436c74ebf6adcbf21abf76567c7b87e61abfaf0 Author: Martin Schwenke Date: Wed Jul 22 14:43:43 2020 +1000 Revert "ctdb-build: Don't build/install tests in top-level build by default" Fix missing Reviewed-by: tag. This reverts commit 91c36c16c8516359380a00ee3d2229422b048d9f. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Jul 22 06:29:43 UTC 2020 on sn-devel-184 commit bdd89d52761ea4c1ad22d5ca1252f84544ee2622 Author: Martin Schwenke Date: Wed Jul 22 14:43:40 2020 +1000 Revert "ctdb-tests: Enable SOCKET_WRAPPER_DIR_ALLOW_ORIG" Fix missing Reviewed-by: tag. This reverts commit 9694ba6fe4d073c653f49080127ee9efa21a8e9e. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 6a3372e8958bf268c1a229076c3b5273e03fb655 Author: Martin Schwenke Date: Wed Jul 22 14:43:36 2020 +1000 Revert "ctdb-tests: Show hung script debugging output" Fix missing Reviewed-by: tag. This reverts commit c78de201f84f9fae9916af9592d42cbc71f805c5. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit e4b1cdc7090212c8b2f37b9ba8303439348e00b8 Author: Martin Schwenke Date: Wed Jul 22 14:43:31 2020 +1000 Revert "ctdb-tests: Redirect stderr too when checking for shellcheck" Fix missing Reviewed-by: tag. This reverts commit 847aa0e367c721944650aa34d67f8073461ae272. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit a694c07126e0dacb3bd30502e83264ffef98e0c0 Author: Martin Schwenke Date: Wed Jul 22 14:43:28 2020 +1000 Revert "ctdb-tests: Drop unreachable line" Fix missing Reviewed-by: tag. This reverts commit a55dd6f17b6d65db77bcd4f5a011e9aef64729e5. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 4438e44f880249164bb33d783f9a773f44ba1a99 Author: Martin Schwenke Date: Wed Jul 22 14:43:24 2020 +1000 Revert "ctdb-tests: Update preamble for INTEGRATION tests" Fix missing Reviewed-by: tag. This reverts commit 65f56505e29c01d5891e5bc1050b6c37b8cbdee7. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 271ad95e2359b1c4fc6d73c0c8e941bafb85c97c Author: Martin Schwenke Date: Wed Jul 22 14:43:21 2020 +1000 Revert "ctdb-tests: Use "#!/usr/bin/env bash" for improved portability" Fix missing Reviewed-by: tag. This reverts commit 9a7cabd342d0aed450ed3305931702a7351f814a. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 60d999ad94155da080982c18ab51af187c7d85f2 Author: Martin Schwenke Date: Wed Jul 22 14:43:18 2020 +1000 Revert "ctdb-tests: Make integration.bash pass shellchec
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ddac6b2eb4a util: Reallocate larger buffer if getpwuid_r() returns ERANGE via 847208cd8ac util: Fix build on FreeBSD by avoiding NSS_BUFLEN_PASSWD via 922bce26689 util: Simplify input validation from 7e36b1ec2e6 s3:libads: remove unused "GSSAPI" support https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ddac6b2eb4adaec8fc5e25ca07387d2b9417764c Author: Martin Schwenke Date: Fri Jun 5 22:05:42 2020 +1000 util: Reallocate larger buffer if getpwuid_r() returns ERANGE Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Jun 9 21:07:24 UTC 2020 on sn-devel-184 commit 847208cd8ac68c4c7d1dae63767820db1c69292b Author: Martin Schwenke Date: Fri Jun 5 21:52:23 2020 +1000 util: Fix build on FreeBSD by avoiding NSS_BUFLEN_PASSWD NSS_BUFLEN_PASSWD is not defined on FreeBSD. Use sysconf(_SC_GETPW_R_SIZE_MAX) instead, as per POSIX. Use a dynamically allocated buffer instead of trying to cram all of the logic into the declarations. This will come in useful later anyway. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke commit 922bce2668994dd2a5988c17060f977e9bb0c229 Author: Martin Schwenke Date: Tue Jun 9 11:52:50 2020 +1000 util: Simplify input validation It appears that snprintf(3) is being used for input validation. However, this seems like overkill because it causes szPath to be copied an extra time. The mostly likely protections being sought here, according to https://cwe.mitre.org/data/definitions/20.html, look to be DoS attacks involving CPU and memory usage. A simpler check that uses strnlen(3) can mitigate against both of these and is simpler. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke --- Summary of changes: lib/util/util_paths.c | 47 ++- 1 file changed, 38 insertions(+), 9 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/util/util_paths.c b/lib/util/util_paths.c index c0ee5c32c30..72cc0aab8de 100644 --- a/lib/util/util_paths.c +++ b/lib/util/util_paths.c @@ -68,25 +68,54 @@ static char *get_user_home_dir(TALLOC_CTX *mem_ctx) { struct passwd pwd = {0}; struct passwd *pwdbuf = NULL; - char buf[NSS_BUFLEN_PASSWD] = {0}; + char *buf = NULL; + char *out = NULL; + long int initlen; + size_t len; int rc; - rc = getpwuid_r(getuid(), &pwd, buf, NSS_BUFLEN_PASSWD, &pwdbuf); + initlen = sysconf(_SC_GETPW_R_SIZE_MAX); + if (initlen == -1) { + len = 1024; + } else { + len = (size_t)initlen; + } + buf = talloc_size(mem_ctx, len); + if (buf == NULL) { + return NULL; + } + + rc = getpwuid_r(getuid(), &pwd, buf, len, &pwdbuf); + while (rc == ERANGE) { + size_t newlen = 2 * len; + if (newlen < len) { + /* Overflow */ + goto done; + } + len = newlen; + buf = talloc_realloc_size(mem_ctx, buf, len); + if (buf == NULL) { + goto done; + } + rc = getpwuid_r(getuid(), &pwd, buf, len, &pwdbuf); + } if (rc != 0 || pwdbuf == NULL ) { - int len_written; const char *szPath = getenv("HOME"); if (szPath == NULL) { - return NULL; + goto done; } - len_written = snprintf(buf, sizeof(buf), "%s", szPath); - if (len_written >= sizeof(buf) || len_written < 0) { - /* Output was truncated or an error. */ + len = strnlen(szPath, PATH_MAX); + if (len >= PATH_MAX) { return NULL; } - return talloc_strdup(mem_ctx, buf); + out = talloc_strdup(mem_ctx, szPath); + goto done; } - return talloc_strdup(mem_ctx, pwd.pw_dir); + out = talloc_strdup(mem_ctx, pwd.pw_dir); +done: + TALLOC_FREE(buf); + return out; } char *path_expand_tilde(TALLOC_CTX *mem_ctx, const char *d) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6e419dda718 ctdb: increase TasksMax limit, the systemd default is just 512 from 393da520e43 s3: libsmbclient: Finish unifing bad iconv behavior across CORE NT1 SMB2 protocols. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6e419dda718cdb931f1d7d30926ed418a169415f Author: Ralph Boehme Date: Tue May 12 15:30:05 2020 +0200 ctdb: increase TasksMax limit, the systemd default is just 512 In 2015 systemd introduced a TasksMax which limits the number of processes in a unit: https://lists.freedesktop.org/archives/systemd-devel/2015-November/035006.html The default of 512 may be too low in certain situations leading to vfork() failing with errno=EAGAIN when trying to spawn lock-helper processes. With the default for LockProcessesPerDB being 200 the increased TasksMax limit should cover the problematic scenario. Additional background: the failing vfork()s have been seen on production clusters and were tracked down to being logged in the context of ctdb calling tdb_repack(). Links: https://github.com/systemd/systemd/commit/9ded9cd14cc03c67291b10a5c42ce5094ba0912f https://www.suse.com/support/kb/doc/?id=15901 https://success.docker.com/article/how-to-reserve-resource-temporarily-unavailable-errors-due-to-tasksmax-setting https://www.percona.com/blog/2019/01/02/tasksmax-another-setting-that-can-cause-mysql-error-messages/ Signed-off-by: Ralph Boehme Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed May 13 13:30:12 UTC 2020 on sn-devel-184 --- Summary of changes: ctdb/config/ctdb.service | 1 + 1 file changed, 1 insertion(+) Changeset truncated at 500 lines: diff --git a/ctdb/config/ctdb.service b/ctdb/config/ctdb.service index fd81c38e26d..dbe35281f56 100644 --- a/ctdb/config/ctdb.service +++ b/ctdb/config/ctdb.service @@ -8,6 +8,7 @@ ConditionFileNotEmpty=/etc/ctdb/nodes Type=forking LimitCORE=infinity LimitNOFILE=1048576 +TasksMax=4096 PIDFile=/run/ctdb/ctdbd.pid ExecStart=/usr/sbin/ctdbd_wrapper start ExecStop=/usr/sbin/ctdbd_wrapper stop -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via fdfc480a563 ctdb-scripts: Update nfs-ganesha-callout from 54a35604984 provision: Remove final code for the LDAP backend https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit fdfc480a5637ae363f88ee917037f24b0fd79a2f Author: Renaud Fortier Date: Tue Apr 21 11:47:01 2020 + ctdb-scripts: Update nfs-ganesha-callout On debian buster, this variable doesn't exist anymore. Look at this PR as a reference: https://github.com/gluster/storhaug/pull/30 Signed-off-by: Renaud Fortier Reviewed-by: Martin Schwenke Reviewed-by: Andrew Bartlett Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Apr 23 08:07:51 UTC 2020 on sn-devel-184 --- Summary of changes: ctdb/doc/examples/nfs-ganesha-callout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/ctdb/doc/examples/nfs-ganesha-callout b/ctdb/doc/examples/nfs-ganesha-callout index f06b300c5b7..7c7b07413ab 100755 --- a/ctdb/doc/examples/nfs-ganesha-callout +++ b/ctdb/doc/examples/nfs-ganesha-callout @@ -297,7 +297,7 @@ nfs_startup () basic_start "nfs" _f="${procfs}/sys/net/ipv4/tcp_tw_recycle" - if [ "$_f" ] ; then + if [ -f "$_f" ] ; then echo 1 >"$_f" fi } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b7fb6100b4c util: Fix signed/unsigned integer comparison from 1ebec7056bd s3: smbd: Refuse open in create_file_unixpath() with only SEC_FLAG_SYSTEM_SECURITY set. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b7fb6100b4c5697078caef2679dd3219c9f93b2a Author: Martin Schwenke Date: Tue Mar 17 16:05:20 2020 +1100 util: Fix signed/unsigned integer comparison Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Apr 22 01:48:03 UTC 2020 on sn-devel-184 --- Summary of changes: lib/util/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/lib/util/debug.c b/lib/util/debug.c index d7449c5c690..0b203cd45a3 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -189,7 +189,7 @@ static int debug_level_to_priority(int level) }; int priority; - if( level >= ARRAY_SIZE(priority_map) || level < 0) + if (level < 0 || (size_t)level >= ARRAY_SIZE(priority_map)) priority = LOG_DEBUG; else priority = priority_map[level]; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ad4b53f2d95 ctdb: Fix a memleak from 72a57d377e4 s4: torture: SMB2. Fix smb2.winattr to actually read the SD from the server and check it. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ad4b53f2d95de3d3609f3a23d96602f3dd516705 Author: Volker Lendecke Date: Thu Apr 16 14:38:34 2020 +0200 ctdb: Fix a memleak Bug: https://bugzilla.samba.org/show_bug.cgi?id=14348 Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Apr 17 08:32:35 UTC 2020 on sn-devel-184 --- Summary of changes: ctdb/server/ctdb_recoverd.c | 1 + 1 file changed, 1 insertion(+) Changeset truncated at 500 lines: diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index ee083e92fb1..3f5d43c1e87 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -2078,6 +2078,7 @@ static int verify_local_ip_allocation(struct ctdb_context *ctdb, /* Return early if disabled... */ if (ctdb_config.failover_disabled || ctdb_op_is_disabled(rec->takeover_run)) { + talloc_free(mem_ctx); return 0; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 130c26b43ff dbwrap: fix possible memleak and false result check. via f34582af1d6 dbwrap: fix comment in code leading to wrong function parameter via 2bdb5a75788 ctdbd_conn: possible memleak in ctdbd_db_attach via 95fc8bd44a2 ctdbd_conn: possible memleak in ctdbd_dbpath via 6e146c855ac ctdbd_conn: possible memleak in ctdbd_working from 9b1e96197e0 script/autobuild.py: allow write_system_info commands to fail https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 130c26b43ffbb577438006e4e4acfb0e88199c64 Author: Swen Schillig Date: Mon Mar 30 12:54:00 2020 +0200 dbwrap: fix possible memleak and false result check. A cstatus != 0 or a data.dsize != sizeof(uint32_t) does not guarantee to have no received data referenced by data.dptr. Therefore, make sure data.dptr is free'd. Reusing the same data structure as data input and data output parameter can lead to wrong results, especially when the output parameters value is used to detect errors. Create the additional local variable outdata to prevent this issue. Signed-off-by: Swen Schillig Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Apr 2 11:26:32 UTC 2020 on sn-devel-184 commit f34582af1d61e7c6e28226e7a5e9c1de45eac56b Author: Swen Schillig Date: Mon Mar 30 12:44:59 2020 +0200 dbwrap: fix comment in code leading to wrong function parameter Signed-off-by: Swen Schillig Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 2bdb5a75788936e75c31235f4855e7096b9af68c Author: Swen Schillig Date: Mon Mar 30 12:34:12 2020 +0200 ctdbd_conn: possible memleak in ctdbd_db_attach A cstatus != 0 or a data.dsize != sizeof(uint32_t) does not guarantee to have no received data referenced by data.dptr. Therefore, make sure data.dptr is free'd. Signed-off-by: Swen Schillig Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 95fc8bd44a2ba942a6052fe8abaf6a4dceca8b3d Author: Swen Schillig Date: Mon Mar 30 12:29:38 2020 +0200 ctdbd_conn: possible memleak in ctdbd_dbpath A cstatus != 0 does not guarantee to have no received data referenced by rdata.dptr. Therefore, make sure rdata.dptr is free'd. Signed-off-by: Swen Schillig Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 6e146c855ac87fd78c873789b37227970b2fed96 Author: Swen Schillig Date: Mon Mar 30 12:22:46 2020 +0200 ctdbd_conn: possible memleak in ctdbd_working A cstatus != 0 does not guarantee to have no received data referenced by outdata.dptr. Therefore, make sure outdata.dptr is free'd. Signed-off-by: Swen Schillig Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke --- Summary of changes: source3/lib/ctdbd_conn.c | 9 + source3/lib/dbwrap/dbwrap_ctdb.c | 11 +++ 2 files changed, 12 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index db6ad9404d8..e968ec5e491 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -242,7 +242,7 @@ static int get_cluster_vnn(struct ctdbd_connection *conn, uint32_t *vnn) static bool ctdbd_working(struct ctdbd_connection *conn, uint32_t vnn) { int32_t cstatus=-1; - TDB_DATA outdata; + TDB_DATA outdata = {0}; struct ctdb_node_map_old *m; bool ok = false; uint32_t i; @@ -256,7 +256,7 @@ static bool ctdbd_working(struct ctdbd_connection *conn, uint32_t vnn) } if ((cstatus != 0) || (outdata.dptr == NULL)) { DEBUG(2, ("Received invalid ctdb data\n")); - return false; + goto fail; } m = (struct ctdb_node_map_old *)outdata.dptr; @@ -834,7 +834,7 @@ char *ctdbd_dbpath(struct ctdbd_connection *conn, if ((ret != 0) || cstatus != 0) { DEBUG(0, (__location__ " ctdb_control for getdbpath failed: %s\n", strerror(ret))); - return NULL; + TALLOC_FREE(rdata.dptr); } return (char *)rdata.dptr; @@ -847,7 +847,7 @@ int ctdbd_db_attach(struct ctdbd_connection *conn, const char *name, uint32_t *db_id, bool persistent) { int ret; - TDB_DATA data; + TDB_DATA data = {0}; int32_t cstatus; data = string_term_tdb_data(name); @@ -865,6 +865,7 @@ int ctdbd_db_attach(struct ctdbd_connection *conn, if (cstatus != 0 || data.dsize != sizeof(uint32_t)) { DEBUG(0,(_
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 716f52f68b2 ctdb-recoverd: Avoid dereferencing NULL rec->nodemap via 147afe77de3 ctdb-daemon: Don't allow attach from recovery if recovery is not active via 052f1bdb9cf ctdb-daemon: Remove more unused old client database functions via 3a66d181b6f ctdb-recovery: Remove old code for creating missing databases via 76a8174279f ctdb-recovery: Create database on nodes where it is missing via e6e63f8fb81 ctdb-recovery: Fetch database name from all nodes where it is attached via 1bdfeb3fdc0 ctdb-recovery: Pass db structure for each database recovery via c6f74e590f6 ctdb-recovery: GET_DBMAP from all nodes via 4c0b9c36050 ctdb-recovery: Replace use of ctdb_dbid_map with local db_list via 7e5a8a4884e ctdb-daemon: Respect CTDB_CTRL_FLAG_ATTACH_RECOVERY when attaching databases via 98e3d0db2bc ctdb-recovery: Use CTDB_CTRL_FLAG_ATTACH_RECOVERY to attach during recovery via 17ed0425904 ctdb-protocol: Add control flag CTDB_CTRL_FLAG_ATTACH_RECOVERY via fc23cd1b9cd ctdb-daemon: Remove unused old client database functions via c6c89495fbe ctdb-daemon: Fix database attach deferral logic via 1c56d6413f8 ctdb-recovery: Refactor banning a node into separate computation via c6a0ff1bed0 ctdb-recovery: Don't trust nodemap obtained from local node via 6e2f8756f1b ctdb-recovery: Consolidate node state via 072ff4d12b8 ctdb-recovery: Fetched vnnmap is never used, so don't fetch it from 1114b02a72c s3: libsmbclient.h: add missing time.h include https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 716f52f68b248ae7cfd66479b3fc678c4a0d8b38 Author: Martin Schwenke Date: Sun Mar 22 13:46:46 2020 +1100 ctdb-recoverd: Avoid dereferencing NULL rec->nodemap Inside the nested event loop in ctdb_ctrl_getnodemap(), various asynchronous handlers may dereference rec->nodemap, which will be NULL. One example is lost_reclock_handler(), which causes rec->nodemap to be unconditionally dereferenced in list_of_nodes() via this call chain: list_of_nodes() list_of_active_nodes() set_recovery_mode() force_election() lost_reclock_handler() Instead of attempting to trace all of the cases, just avoid leaving rec->nodemap set to NULL. Attempting to use an old value is generally harmless, especially since it will be the same as the new value in most cases. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14324 Reported-by: Volker Lendecke Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Mar 24 01:22:45 UTC 2020 on sn-devel-184 commit 147afe77de372ddb9c180228d6fe1b04cca4610f Author: Martin Schwenke Date: Tue Feb 25 17:32:56 2020 +1100 ctdb-daemon: Don't allow attach from recovery if recovery is not active Neither the recovery daemon nor the recovery helper should attach databases outside of the recovery process. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 052f1bdb9cf78f53f584edd32f81ae8e01e8e86e Author: Martin Schwenke Date: Tue Feb 25 06:20:32 2020 +1100 ctdb-daemon: Remove more unused old client database functions BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 3a66d181b6f6199fca362fcb0aa06513645b589d Author: Martin Schwenke Date: Mon Feb 24 19:51:19 2020 +1100 ctdb-recovery: Remove old code for creating missing databases BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 76a8174279f42486b36cc41d5831d4e6613f172e Author: Martin Schwenke Date: Mon Feb 24 11:31:33 2020 +1100 ctdb-recovery: Create database on nodes where it is missing BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit e6e63f8fb8194634135bf34cda18f6cc8ff69a7c Author: Martin Schwenke Date: Mon Feb 24 10:26:34 2020 +1100 ctdb-recovery: Fetch database name from all nodes where it is attached BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 1bdfeb3fdc06947a607957ab3d114f97bad5d7d7 Author: Martin Schwenke Date: Fri Feb 21 16:51:10 2020 +1100 ctdb-recovery: Pass db structure for each database recovery Instead of db_id and db_flags. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294 Signed-off-by: Martin Schwenke
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 319c93f0c6a ctdb-tcp: Do not stop outbound connection in ctdb_tcp_node_connect() via 3c8747fe294 ctdb-tcp: Factor out function ctdb_tcp_start_outgoing() via 2c73dbafba5 ctdb-tcp: add ctdb_tcp_stop_incoming() via 1e2a967ff41 ctdb-tcp: rename ctdb_tcp_stop_connection() to ctdb_tcp_stop_outgoing() via ea37ecdcd59 ctdb-tcp: Remove redundant restart in ctdb_tcp_tnode_cb() via b83ef98c746 ctdb-tcp: always call node_dead() upcall in ctdb_tcp_tnode_cb() via 0ff1b78fc2f ctdb-tcp: move free of inbound queue to TCP restart via 15762a34559 ctdb-daemon: more logical whitespace, debug modernisation via 6a4fa0785fc ctdb-daemon: ensure restart() callback is called in half-connected state from 808d6c0c533 selftest: Add test for rpcclient LSA lookup calls https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 319c93f0c6a949545229b616dfbd4f51baf11171 Author: Martin Schwenke Date: Fri Mar 6 16:11:23 2020 +1100 ctdb-tcp: Do not stop outbound connection in ctdb_tcp_node_connect() The only place the outgoing connection needs to be stopped is when there is a timeout when waiting for the connection to become writable. Add a new function ctdb_tcp_node_connect_timeout() to handle this case. All of the other cases are attempts to establish a new outgoing connection (initial attempt, retry after an error or disconnect, ...) so drop stopping the connection in those cases. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295 Signed-off-by: Amitay Isaacs Signed-off-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Mar 12 05:29:20 UTC 2020 on sn-devel-184 commit 3c8747fe29486a4f95308b335a5e3ec1807f62cb Author: Martin Schwenke Date: Fri Mar 6 15:59:32 2020 +1100 ctdb-tcp: Factor out function ctdb_tcp_start_outgoing() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295 Signed-off-by: Amitay Isaacs Signed-off-by: Martin Schwenke commit 2c73dbafba50b28e72a8ec7b4382fae42fca6d17 Author: Ralph Boehme Date: Sat Feb 29 11:54:51 2020 +0100 ctdb-tcp: add ctdb_tcp_stop_incoming() No change in behaviour. This makes the code self-documenting. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295 Signed-off-by: Ralph Boehme Signed-off-by: Martin Schwenke commit 1e2a967ff41cc29c3a0d7f61a46937c68fdb90ba Author: Ralph Boehme Date: Fri Feb 28 11:36:00 2020 +0100 ctdb-tcp: rename ctdb_tcp_stop_connection() to ctdb_tcp_stop_outgoing() No change in behaviour. This makes the code self-documenting. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295 Signed-off-by: Ralph Boehme Reviewed-by: Martin Schwenke commit ea37ecdcd5960311f54a7a5510b88a654da23daa Author: Ralph Boehme Date: Sat Feb 29 12:28:20 2020 +0100 ctdb-tcp: Remove redundant restart in ctdb_tcp_tnode_cb() The node dead upcall has already restarted the outgoing connection. There's no need to repeat it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295 Signed-off-by: Ralph Boehme Signed-off-by: Martin Schwenke commit b83ef98c7466b2a81968555de83fb977bb6ca9f0 Author: Ralph Boehme Date: Sat Feb 29 12:13:12 2020 +0100 ctdb-tcp: always call node_dead() upcall in ctdb_tcp_tnode_cb() ctdb_tcp_tnode_cb() is called when we receive data on the outgoing connection. This can happen when we get an EOF on the connection because the other side as closed. In this case data will be NULL. It would also be called if we received data from the peer. In this case data will not be NULL. The latter case is a fatal error though and we already call ctdb_tcp_stop_connection() for this case as well, which means even though the node is not fully connected anymore, by not calling the node_dead() upcall NODE_FLAGS_DISCONNECTED will not be set. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295 Signed-off-by: Ralph Boehme Reviewed-by: Martin Schwenke commit 0ff1b78fc2f0491f9e11131d0040bdaba8873770 Author: Noel Power Date: Sat Feb 29 15:49:28 2020 + ctdb-tcp: move free of inbound queue to TCP restart Since commit 77deaadca8e8dbc3c92ea16893099c72f6dc874e, a nodeA which had previously accepted a connection from nodeB (where nodeB dies e.g. as as result of fencing) when nodeB attempts to connect again after restarting is always rejected with ctdb_listen_event: Incoming queue active, rejecting connection from w.x.y.z messages. Consolidate dead node handling in the TCP restart handling. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295 Signed-off-by: Noel
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via be90ab01bb4 ctdb-docs: Improve recovery lock documentation from bb22be08b07 s3: tests: Add samba3.blackbox.force-close-share https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit be90ab01bb46ed38ab6c2dd737c66a9537c04327 Author: Martin Schwenke Date: Tue Feb 18 18:32:21 2020 +1100 ctdb-docs: Improve recovery lock documentation Signed-off-by: Martin Schwenke Reviewed-by: Christof Schmitt Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Mar 9 02:27:18 UTC 2020 on sn-devel-184 --- Summary of changes: ctdb/doc/ctdb.7.xml | 33 +++-- 1 file changed, 27 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/doc/ctdb.7.xml b/ctdb/doc/ctdb.7.xml index 09fb4ed7d8f..2079ed713e3 100644 --- a/ctdb/doc/ctdb.7.xml +++ b/ctdb/doc/ctdb.7.xml @@ -112,12 +112,33 @@ The recovery lock can also be implemented using an arbitrary - cluster mutex call-out by using an exclamation point ('!') as - the first character of recovery lock. - For example, a value of !/usr/local/bin/myhelper - recovery would run the given helper with the specified - arguments. See the source code relating to cluster mutexes for - clues about writing call-outs. + cluster mutex helper (or call-out). This is indicated by using + an exclamation point ('!') as the first character of the + recovery lock parameter. For example, a + value of !/usr/local/bin/myhelper recovery + would run the given helper with the specified arguments. The + helper will continue to run as long as it holds its mutex. See + ctdb/doc/cluster_mutex_helper.txt in the + source tree, and related code, for clues about writing helpers. + + + + When a file is specified for the recovery + lock parameter (i.e. no leading '!') the file lock + is implemented by a default helper + (/usr/local/libexec/ctdb/ctdb_mutex_fcntl_helper). + This helper has arguments as follows: + + + +ctdb_mutex_fcntl_helper FILE RECHECK-INTERVAL + + + ctdb_mutex_fcntl_helper will take a lock on + FILE and then check every RECHECK-INTERVAL seconds to ensure + that FILE still exists and that its inode number is unchanged + from when the lock was taken. The default value for + RECHECK-INTERVAL is 5. -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c2dba1f53b2 ctdb: add tail logs option to local_daemons.sh from a3fc18f679e dsdb: Rewrite comment to remove refernece to LDAP backends https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c2dba1f53b28b4f71ebe62a034e2201b89d9592b Author: Ralph Boehme Date: Fri Feb 28 13:02:43 2020 +0100 ctdb: add tail logs option to local_daemons.sh Signed-off-by: Ralph Boehme Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sat Feb 29 08:02:50 UTC 2020 on sn-devel-184 --- Summary of changes: ctdb/tests/local_daemons.sh | 18 ++ 1 file changed, 18 insertions(+) Changeset truncated at 500 lines: diff --git a/ctdb/tests/local_daemons.sh b/ctdb/tests/local_daemons.sh index a67055a9337..6724cdb3b71 100755 --- a/ctdb/tests/local_daemons.sh +++ b/ctdb/tests/local_daemons.sh @@ -438,6 +438,22 @@ local_daemons_print_log () } +local_daemons_tail_log () +{ + if [ $# -ne 1 ] || [ "$1" = "-h" ] ; then + local_daemons_generic_usage "tail-log" + fi + + _nodes="$1" + shift + + onnode_common + + # shellcheck disable=SC2016 + # $CTDB_BASE must only be expanded under onnode, not in top-level shell + tail -f $(onnode -q "$_nodes" 'echo ${CTDB_BASE}/log.ctdb') +} + usage () { cat < for daemon configuration @@ -475,5 +492,6 @@ stop) local_daemons_stop "$@" ;; onnode) local_daemons_onnode "$@" ;; print-socket) local_daemons_print_socket "$@" ;; print-log) local_daemons_print_log "$@" ;; +tail-log) local_daemons_tail_log "$@" ;; *) usage ;; esac -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 959235fffb8 ctdb-docs: Move CTDB_SERVICE_NMB to new 48.netbios section via 512fa29cce9 ctdb-scripts: Change CTDB_SERVICE_NMB default value to 'nmb' via 26e1556819f ctdb-scripts: add new 48.netbios script for starting nmbd from f7fe6fa5505 lib/util/fault.c: Unify printing of the stack trace with the INTERNAL ERROR string https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 959235fffb8f1ae625b2bbed2538027a9c2f5901 Author: Anoop C S Date: Tue Feb 25 18:08:35 2020 +0530 ctdb-docs: Move CTDB_SERVICE_NMB to new 48.netbios section Signed-off-by: Anoop C S Reviewed-by: Guenther Deschner Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Feb 27 07:34:53 UTC 2020 on sn-devel-184 commit 512fa29cce9b7c2ab7ce625149eff7e7f2fd7eb7 Author: Anoop C S Date: Wed Feb 26 11:10:46 2020 +0530 ctdb-scripts: Change CTDB_SERVICE_NMB default value to 'nmb' Till now 50.samba script was based on RHEL versions <=6 where we didn't have separate start up script for nmb and smbd used to start nmbd when required. Now that nmbd has its own start up script named "nmb" it is reasonable to have "nmb" as default value for CTDB_SERVICE_NMB inside new 48.netbios ctdb script. Signed-off-by: Anoop C S Reviewed-by: Guenther Deschner Reviewed-by: Martin Schwenke commit 26e1556819fd061efaac88875980771d1ebeb727 Author: Günther Deschner Date: Tue Feb 25 15:04:41 2020 +0100 ctdb-scripts: add new 48.netbios script for starting nmbd This change basically moves out nmbd references from 50.samba script to a new 48.netbios script. Accordingly ctdb test scripts are tweaked to cope with newly added script. Signed-off-by: Guenther Deschner Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/config/events/legacy/48.netbios.script| 64 ++ ctdb/config/events/legacy/50.samba.script | 19 --- ctdb/doc/ctdb-script.options.5.xml | 39 - ctdb/doc/examples/config_migrate.sh| 3 +- shutdown.011.sh => 48.netbios.shutdown.011.sh} | 1 - ...ba.startup.011.sh => 48.netbios.startup.011.sh} | 1 - .../UNIT/eventscripts/50.samba.shutdown.011.sh | 1 - .../UNIT/eventscripts/50.samba.startup.011.sh | 1 - ctdb/tests/UNIT/eventscripts/scripts/48.netbios.sh | 21 +++ ctdb/tests/UNIT/eventscripts/scripts/50.samba.sh | 4 +- 10 files changed, 115 insertions(+), 39 deletions(-) create mode 100755 ctdb/config/events/legacy/48.netbios.script copy ctdb/tests/UNIT/eventscripts/{50.samba.shutdown.011.sh => 48.netbios.shutdown.011.sh} (91%) copy ctdb/tests/UNIT/eventscripts/{50.samba.startup.011.sh => 48.netbios.startup.011.sh} (91%) create mode 100644 ctdb/tests/UNIT/eventscripts/scripts/48.netbios.sh Changeset truncated at 500 lines: diff --git a/ctdb/config/events/legacy/48.netbios.script b/ctdb/config/events/legacy/48.netbios.script new file mode 100755 index 000..d2cbf983b6a --- /dev/null +++ b/ctdb/config/events/legacy/48.netbios.script @@ -0,0 +1,64 @@ +#!/bin/sh +# ctdb event script for Netbios Name Services + +[ -n "$CTDB_BASE" ] || \ +CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD") + +. "${CTDB_BASE}/functions" + +detect_init_style + +case $CTDB_INIT_STYLE in + suse) + CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmb} + ;; + debian) + CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmbd} + ;; + *) + # Use redhat style as default: + CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmb} + ;; +esac + +service_name="netbios" + +load_script_options + +ctdb_setup_state_dir "service" "$service_name" + +service_start () +{ +# make sure nmbd is not already started +service "$CTDB_SERVICE_NMB" stop > /dev/null 2>&1 +killall -0 -q nmbd && { + sleep 1 + # make absolutely sure nmbd is dead + killall -q -9 nmbd +} + +# start Samba nmbd service. Start it reniced, as under very heavy load +# the number of smbd processes will mean that it leaves few cycles +# for anything else +nice_service "$CTDB_SERVICE_NMB" start || die "Failed to start nmbd" +} + +service_stop () +{ +service "$CTDB_SERVICE_NMB" stop +} + +### + +case "$1" in +startup) + service_start + ;; + +shutdown) + service_stop + ;; + +esac + +exit 0 diff --git a/ctdb/config/events/legacy/50.
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 8441471d5dc autobuild: samba-ctdb does not need an AD DC via cfb8e4de8f2 autobuild: Split a long line via d4af16a16ca selftest: Run a clustered test via dc0150801ca selftest:clusteredmember: Build a unclist for every share via ebf67b6da7d autobuild: Run a simple test for clustered samba via 602f27d6a23 autobuild: Avoid clusteredmember in normal environments via 5ff7e2f213d selftest:Samba3: add a clusteredmember environment via bb85a710e2b selftest: Split up a long line via 822604a112c selftest: net command needs to think it is root in clustered case via c779dfe70f8 selftest: Allow passing fork_and_exec()'s child_cleanup via 154d7c8eaf7 selftest: Convert Samba3::check_or_start() to named parameters via ff5dd4bb4fa selftest: Parameterize clean up in the child process via 586189ab698 selftest: Fix an uninitialised variable warning. via 4cd28d736ac selftest: Fix a warning message via 2a54c03af74 selftest: Add "share_dir" as an argument to Samba3::provision() via 7598b9069d3 selftest: Allow "netbios name" to be overriden in Samba3::provision() via b36376fcf67 lib: Remove unneded #include malloc.h via 158bf58cf16 torture4: Align integer types via b058c6d3ed1 torture4: Use strlcpy() with size check instead of snprintf() via c9c0e69d17f smbd: Fix a typo via 2a5002d9688 lib: Fix rotating nonstandard debug class log files from 9ee1320049c s3: DFS: Remove is_msdfs_link_internal() - no longer used. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 8441471d5dca8657d8bb40e83096a4965818eb5c Author: Volker Lendecke Date: Fri Feb 14 17:20:22 2020 +0100 autobuild: samba-ctdb does not need an AD DC Speed up the build a bit Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Feb 19 11:28:56 UTC 2020 on sn-devel-184 commit cfb8e4de8f2532cb0cf6bbe947727f0a2d1cfeb2 Author: Volker Lendecke Date: Fri Feb 14 17:19:46 2020 +0100 autobuild: Split a long line Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit d4af16a16ca7d5a5de1f30991adc2ed2fd9a92c6 Author: Martin Schwenke Date: Fri Feb 14 16:58:51 2020 +0100 selftest: Run a clustered test Signed-off-by: Volker Lendecke Signed-off-by: Martin Schwenke commit dc0150801caef3a8080329ad69d8e10fd66e27df Author: Martin Schwenke Date: Tue Feb 4 19:44:11 2020 +1100 selftest:clusteredmember: Build a unclist for every share This is fairly cheap and it is simple to do. This allows the Python code to be able to specify a unclist quite simply. The level of coupling doesn't seem worse than anything else in the selftest/autobuild code. There may be cleverer ways of doing this (e.g. a wrapper in testprogs/blackbox/clusteredmember_smbtorture or similar) but cleverer code isn't necessarily better code... and they'll probably involve code duplication. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke commit ebf67b6da7d5dc31bc1546cde4ef0dca14151aad Author: Volker Lendecke Date: Tue Oct 16 13:56:14 2018 +0200 autobuild: Run a simple test for clustered samba Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 602f27d6a2326aa71b91cbf1eaae16d8a8fc4d52 Author: Volker Lendecke Date: Tue Jan 28 10:18:37 2020 +0100 autobuild: Avoid clusteredmember in normal environments Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 5ff7e2f213df6e754ffca014f7997a2faae61c7c Author: Michael Adam Date: Tue Jul 12 13:12:24 2016 +0200 selftest:Samba3: add a clusteredmember environment Allow running tests against a CTDB setup, thereby covering the dbrwap_ctdb->ctdb stack in real SMB tests. Sets up a 3 node cluster. Signed-off-by: Michael Adam Signed-off-by: Volker Lendecke Signed-off-by: Martin Schwenke commit bb85a710e2bb0509deafd27293c6064c4a382819 Author: Volker Lendecke Date: Wed Aug 22 17:24:38 2018 +0200 selftest: Split up a long line We'll add another argument soon Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit 822604a112cc769320c813548f96769589d19b6c Author: Martin Schwenke Date: Fri Jan 17 09:42:19 2020 +1100 selftest: net command needs to think it is root in clustered case So just run it "as root" all the time. Something similar is already done for other things in Samba3::provision(), such as running smbpasswd in Samba3::createuser(). Signed-off-by:
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ea754bfdec9 ctdb-tests: Enable job control when keeping stdin open via 2380b13bf81 ctdb-tests: Don't close stdin when starting local daemons via cf460bd9c4a ctdb-daemon: Shut down if interactive and stdin is closed via d79e2dcfc84 ctdb-daemon: Only stop monitoring if it has been initialised from 0ad6a243b25 lib:util: Log mkdir error on correct debug levels https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ea754bfdec9d537c500036d4d521bd41d34c0835 Author: Martin Schwenke Date: Tue Jan 14 10:58:15 2020 +1100 ctdb-tests: Enable job control when keeping stdin open POSIX says: If job control is disabled (see set, -m), the standard input for an asynchronous list, before any explicit redirections are performed, shall be considered to be assigned to a file that has the same properties as /dev/null. This shall not happen if job control is enabled. In all cases, explicit redirection of standard input shall override this activity. ctdbd is backgrounded at startup, so the above causes stdin to be redirected from /dev/null. Enable job control to work around this. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Jan 28 11:24:35 UTC 2020 on sn-devel-184 commit 2380b13bf81f0705d036a0b43c65e823dd0e3624 Author: Martin Schwenke Date: Mon Jan 13 21:04:24 2020 +1100 ctdb-tests: Don't close stdin when starting local daemons Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit cf460bd9c4ae1e0de871a6c4980a2c365e82550a Author: Martin Schwenke Date: Mon Jan 13 21:04:54 2020 +1100 ctdb-daemon: Shut down if interactive and stdin is closed This allows a test environment to simply close its end of a pipe to cleanly shutdown ctdbd. Like in smbd, this is only done if stdin is a pipe or a socket. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit d79e2dcfc84d937db3c6eb3d17520aaf6e7bba4c Author: Martin Schwenke Date: Mon Jan 13 21:13:32 2020 +1100 ctdb-daemon: Only stop monitoring if it has been initialised This avoids a crash if ctdb_shutdown_sequence() is called before monitoring is initialised. Switch to using TALLOC_FREE() while touching this function. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- Summary of changes: ctdb/server/ctdb_daemon.c | 59 + ctdb/server/ctdb_monitor.c | 8 -- ctdb/tests/local_daemons.sh | 4 +-- 3 files changed, 67 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index cc688b07e9c..c4ab2dbc3d3 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -1389,6 +1389,56 @@ static void ctdb_set_my_pnn(struct ctdb_context *ctdb) D_NOTICE("PNN is %u\n", ctdb->pnn); } +static void stdin_handler(struct tevent_context *ev, + struct tevent_fd *fde, + uint16_t flags, + void *private_data) +{ + struct ctdb_context *ctdb = talloc_get_type_abort( + private_data, struct ctdb_context); + ssize_t nread; + char c; + + nread = read(STDIN_FILENO, &c, 1); + if (nread != 1) { + D_ERR("stdin closed, exiting\n"); + talloc_free(fde); + ctdb_shutdown_sequence(ctdb, EPIPE); + } +} + +static int setup_stdin_handler(struct ctdb_context *ctdb) +{ + struct tevent_fd *fde; + struct stat st; + int ret; + + ret = fstat(STDIN_FILENO, &st); + if (ret != 0) { + /* Problem with stdin, ignore... */ + DBG_INFO("Can't fstat() stdin\n"); + return 0; + } + + if (!S_ISFIFO(st.st_mode)) { + DBG_INFO("Not a pipe...\n"); + return 0; + } + + fde = tevent_add_fd(ctdb->ev, + ctdb, + STDIN_FILENO, + TEVENT_FD_READ, + stdin_handler, + ctdb); + if (fde == NULL) { + return ENOMEM; + } + + DBG_INFO("Set up stdin handler\n"); + return 0; +} + /* start the protocol going as a daemon */ @@ -1448,6 +1498,15 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork) ctdb_set_child_logging(ctdb); } + /* Exit if stdin is closed */ + if (!do_fork)
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 558bd7c83d0 util: Add detection of libunwind from 5ff83809a2b s3: lib: dbwrap_ctdb: Ensure value_valid is set when creating empty record https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 558bd7c83d08523a9e88414195d9703df38e9af2 Author: Martin Schwenke Date: Tue Oct 1 13:52:38 2019 +1000 util: Add detection of libunwind The current detection doesn't seem to work, so libunwind doesn't seem to be used. Signed-off-by: Martin Schwenke Signed-off-by: Amitay Isaacs Reviewed-by: Volker Lendecke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Jan 21 08:12:17 UTC 2020 on sn-devel-184 --- Summary of changes: lib/util/wscript_build | 2 +- lib/util/wscript_configure | 11 ++- 2 files changed, 11 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/util/wscript_build b/lib/util/wscript_build index 3a80b93b2c7..a827eea3ed9 100644 --- a/lib/util/wscript_build +++ b/lib/util/wscript_build @@ -82,7 +82,7 @@ bld.SAMBA_SUBSYSTEM('samba-util-core', become_daemon.c mkdir_p.c''', deps='''time-basic samba-debug socket-blocking talloc tevent execinfo pthread strv tini''', -public_deps='systemd systemd-daemon sys_rw', +public_deps='systemd systemd-daemon sys_rw LIBUNWIND', local_include=False) bld.SAMBA_LIBRARY('iov_buf', diff --git a/lib/util/wscript_configure b/lib/util/wscript_configure index 93853511575..4f57184f515 100644 --- a/lib/util/wscript_configure +++ b/lib/util/wscript_configure @@ -8,7 +8,16 @@ if Options.options.disable_fault_handling: # backtrace could be in libexecinfo or in libc conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc=True, headers='execinfo.h') -conf.CHECK_HEADERS('execinfo.h libunwind.h') +conf.CHECK_HEADERS('execinfo.h') + +conf.SET_TARGET_TYPE('LIBUNWIND', 'EMPTY') +if conf.check_cfg(package='libunwind-generic', + args='--cflags --libs', + msg='Checking for libunwind', + uselib_store='LIBUNWIND', + mandatory=False): +if conf.CHECK_HEADERS('libunwind.h'): +conf.SET_TARGET_TYPE('LIBUNWIND', 'SYSLIB') conf.CHECK_STRUCTURE_MEMBER('struct statvfs', 'f_frsize', define='HAVE_FRSIZE', headers='sys/statvfs.h') -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via bb2296f68a3 build: Fix the build without system gssapi headers from a5e3db5b512 lib: spelling fix https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit bb2296f68a36a3b85a5702062a5e488f9d6616dc Author: Volker Lendecke Date: Mon Dec 9 13:49:47 2019 +0100 build: Fix the build without system gssapi headers source4/heimdal/lib/gssapi/gssapi/gssapi_krb5.h and gssapi_spnego.h have an #include which they need to find via the -I paths Signed-off-by: Volker Lendecke Reviewed-by: Richard Sharpe Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Dec 10 00:29:55 UTC 2019 on sn-devel-184 --- Summary of changes: buildtools/wafsamba/samba3.py | 1 + 1 file changed, 1 insertion(+) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/samba3.py b/buildtools/wafsamba/samba3.py index 3bb2c521a2c..7b42075d1ab 100644 --- a/buildtools/wafsamba/samba3.py +++ b/buildtools/wafsamba/samba3.py @@ -40,6 +40,7 @@ def s3_fix_kwargs(bld, kwargs): extra_includes += [ '../source4/heimdal/lib/com_err', '../source4/heimdal/lib/krb5', '../source4/heimdal/lib/gssapi', +'../source4/heimdal/lib/gssapi/gssapi', '../source4/heimdal_build/include', '../bin/default/source4/heimdal/lib/asn1' ] -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 963a639101f ctdb-tests: Add tests for cmdline_add() api via e469d6c1191 ctdb-common: Add api to add new section/commands to cmdline via 977a6f7fad8 ctdb-common: Change cmdline implementation to support multiple sections via 7a008c6b74e ctdb-tests: Update cmdline tests for section name via b2b24c91fae ctdb-common: Add section to group commands in cmdline via 29948d7b1eb ctdb-common: Generate usage message from cmdline_parse() from 0361a26e395 libcli:auth Check return code of netlogon_creds_aes_encrypt() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 963a639101f4c55467e33667a698fffb350a931f Author: Amitay Isaacs Date: Mon Nov 11 18:32:49 2019 +1100 ctdb-tests: Add tests for cmdline_add() api Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Nov 14 12:03:46 UTC 2019 on sn-devel-184 commit e469d6c1191ab9fa78e1ced6d7aa7b37dce7c5a9 Author: Amitay Isaacs Date: Mon Nov 11 17:32:50 2019 +1100 ctdb-common: Add api to add new section/commands to cmdline Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 977a6f7fad8d2985e8e898bd8dc7d3d376164e9d Author: Amitay Isaacs Date: Mon Nov 11 17:29:26 2019 +1100 ctdb-common: Change cmdline implementation to support multiple sections Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 7a008c6b74e559a3e677257be3ea57a5821e3e9c Author: Amitay Isaacs Date: Mon Nov 11 17:05:53 2019 +1100 ctdb-tests: Update cmdline tests for section name Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit b2b24c91fae30edf797ed30e3c45c259aee00853 Author: Amitay Isaacs Date: Mon Nov 11 17:01:43 2019 +1100 ctdb-common: Add section to group commands in cmdline Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 29948d7b1eb1337c7e3d91dc53bb3e1e42de6dd3 Author: Amitay Isaacs Date: Mon Jul 9 15:37:52 2018 +1000 ctdb-common: Generate usage message from cmdline_parse() If any of the option parsing or command parsing fails, generate usage message. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/common/cmdline.c | 168 ++ ctdb/common/cmdline.h | 15 +++ ctdb/common/conf_tool.c | 7 +- ctdb/common/path_tool.c | 7 +- ctdb/event/event_tool.c | 1 + ctdb/tests/UNIT/cunit/cmdline_test_001.sh | 42 +++- ctdb/tests/src/cmdline_test.c | 161 +--- ctdb/tests/src/db_test_tool.c | 1 + 8 files changed, 339 insertions(+), 63 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c index f3768c068fe..fc4cb22f066 100644 --- a/ctdb/common/cmdline.c +++ b/ctdb/common/cmdline.c @@ -29,10 +29,16 @@ #define CMDLINE_MAX_LEN80 +struct cmdline_section { + const char *name; + struct cmdline_command *commands; +}; + struct cmdline_context { const char *prog; struct poptOption *options; - struct cmdline_command *commands; + struct cmdline_section *section; + int num_sections; int max_len; poptContext pc; int argc, arg0; @@ -206,15 +212,51 @@ static bool cmdline_commands_check(struct cmdline_command *commands, static int cmdline_context_destructor(struct cmdline_context *cmdline); +static int cmdline_section_add(struct cmdline_context *cmdline, + const char *name, + struct cmdline_command *commands) +{ + struct cmdline_section *section; + size_t max_len = 0; + bool ok; + + ok = cmdline_commands_check(commands, &max_len); + if (!ok) { + return EINVAL; + } + + section = talloc_realloc(cmdline, +cmdline->section, +struct cmdline_section, +cmdline->num_sections + 1); + if (section == NULL) { + return ENOMEM; + } + + section[cmdline->num_sections] = (struct cmdline_section) { + .name = name, + .commands = commands, + }; + + if (max_len > cmdline->max_len) { + cmdline->max_len = max_len; + } + + cmdline->section = section; + cmdline->num_sections += 1; + + return 0; +} + int cmdline_init(TALLOC_CTX *mem_ctx, const char *prog, struct poptOption *options,
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 816205027a1 ctdb-ib: Fix build errors for infiniband transport from 86e418f992e build: Refuse to build if ADDITIONAL_LDFLAGS or ADDITIONAL_CFLAGS do not work https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 816205027a12d16b5de7c1fd78b4bed468a94fbb Author: Amitay Isaacs Date: Tue Nov 12 14:14:53 2019 +1100 ctdb-ib: Fix build errors for infiniband transport Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Nov 13 13:31:10 UTC 2019 on sn-devel-184 --- Summary of changes: ctdb/ib/ibwrapper.c | 1 - ctdb/ib/ibwrapper_test.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/ib/ibwrapper.c b/ctdb/ib/ibwrapper.c index 5ca3b946f00..cf4efa579e2 100644 --- a/ctdb/ib/ibwrapper.c +++ b/ctdb/ib/ibwrapper.c @@ -32,7 +32,6 @@ #include "common/logging.h" -#include #include #include diff --git a/ctdb/ib/ibwrapper_test.c b/ctdb/ib/ibwrapper_test.c index 5eb3209b68c..77a5323fbf1 100644 --- a/ctdb/ib/ibwrapper_test.c +++ b/ctdb/ib/ibwrapper_test.c @@ -551,7 +551,7 @@ int main(int argc, char *argv[]) memset(tcx, 0, sizeof(struct ibwtest_ctx)); tcx->nsec = 0; tcx->nmsg = 1000; - DEBUGLEVEL = 0; + debuglevel_set(0); /* here is the only case we can't avoid using global... */ testctx = tcx; @@ -590,7 +590,7 @@ int main(int argc, char *argv[]) tcx->maxsize = (unsigned int)atoi(optarg); break; case 'd': - DEBUGLEVEL = atoi(optarg); + debuglevel_set(atoi(optarg)); break; default: fprintf(stderr, "ERROR: unknown option -%c\n", (char)op); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f37b913348e smbd: Save 520 bytes of writable memory from every smbd via 0559701478d smbd: Remove an unused #define from mangle_hash2.c via ccc486ca118 smbd: Mark #else/#endif with the if-#define from aa376682180 ctdb-tests: Add -l option to set number of local daemons https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f37b913348e921afee3e578ff0f14b731157eb03 Author: Volker Lendecke Date: Mon Oct 21 14:38:47 2019 +0200 smbd: Save 520 bytes of writable memory from every smbd Move what can be const from the "data" to the "text" segment Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Oct 23 02:37:12 UTC 2019 on sn-devel-184 commit 0559701478d42e969c8c779d765163271ca9141e Author: Volker Lendecke Date: Mon Oct 21 14:37:04 2019 +0200 smbd: Remove an unused #define from mangle_hash2.c Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke commit ccc486ca1184962df57e380954747f1593317bb5 Author: Volker Lendecke Date: Tue Oct 22 08:30:01 2019 +0200 smbd: Mark #else/#endif with the if-#define Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke --- Summary of changes: source3/smbd/mangle_hash2.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c index ac1f4b0f4fb..92319495f2a 100644 --- a/source3/smbd/mangle_hash2.c +++ b/source3/smbd/mangle_hash2.c @@ -89,11 +89,6 @@ #define FLAG_POSSIBLE3 64 #define FLAG_POSSIBLE4 128 -/* by default have a max of 4096 entries in the cache. */ -#ifndef MANGLE_CACHE_SIZE -#define MANGLE_CACHE_SIZE 4096 -#endif - #define FNV1_PRIME 0x01000193 /*the following number is a fnv1 of the string: i...@samba.org 2002 */ #define FNV1_INIT 0xa6b93095 @@ -190,7 +185,7 @@ static void init_tables(void) #endif } -#else +#else /* DYNAMIC_MANGLE_TABLES */ /* * These tables were initialized by a single run of the above @@ -200,7 +195,7 @@ static void init_tables(void) * initializers, but I'll leave it in: less surprise. */ -static uint8_t char_flags[256] = { +static const uint8_t char_flags[256] = { 0x80, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, @@ -235,7 +230,7 @@ static uint8_t char_flags[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static uint8_t base_reverse[256] = { +static const uint8_t base_reverse[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -270,7 +265,7 @@ static uint8_t base_reverse[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -#endif +#endif /* DYNAMIC_MANGLE_TABLES */ /* hash a string of the specified length. The string does not need to be @@ -438,7 +433,7 @@ static bool is_mangled(const char *name, const struct share_params *parm) get larger when converted from UNIX to DOS formats) */ -static char force_shortname_chars[] = " +,[];="; +static const char force_shortname_chars[] = " +,[];="; static bool is_8_3(const char *name, bool check_case, bool allow_wildcards, const struct share_params *p) { -- Samba Shared Repository
[SCM] Samba Website Repository - branch master updated
The branch, master has been updated via 1933dc1 lists: Generalise description of "samba" list from a9613c0 Add Samba 4.11.0. https://git.samba.org/?p=samba-web.git;a=shortlog;h=master - Log - commit 1933dc1094ba226def685b4d92a0cfd1df789ba2 Author: Martin Schwenke Date: Sun Sep 29 08:19:31 2019 +1000 lists: Generalise description of "samba" list Signed-off-by: Martin Schwenke --- Summary of changes: archives.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/archives.html b/archives.html index 3e980aa..8ed212e 100755 --- a/archives.html +++ b/archives.html @@ -25,7 +25,7 @@ https://lists.samba.org/archive/samba/";>samba - The Samba SMB fileserver + General questions regarding Samba https://lists.samba.org/archive/samba-announce/";>samba-announce -- Samba Website Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 3bd68261eca ctdb-eventscripts: Remove non-posix -v option to mkdir via 4a7fc97daff ctdb-eventscripts: Fix the regression in 01.reclock.script from 1006f7abe89 docs: Deprecate "lanman auth = yes" https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 3bd68261eca398895c419284db6515fd6f393f0f Author: Amitay Isaacs Date: Wed Jul 31 12:13:52 2019 +1000 ctdb-eventscripts: Remove non-posix -v option to mkdir Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Sep 6 11:11:02 UTC 2019 on sn-devel-184 commit 4a7fc97daff69b8cba9c4e2da6a8e1399d6b1107 Author: Amitay Isaacs Date: Wed Jul 31 12:12:14 2019 +1000 ctdb-eventscripts: Fix the regression in 01.reclock.script Commit ea7708d8c7fa674111ccea58b3cd0757765c702a simplified 01.reclock.script and removed include of functions file which is required for setting CTDB_HELPER_BINDIR and for die() function. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/config/events/legacy/01.reclock.script| 4 +++- ctdb/tests/eventscripts/01.reclock.init.003.sh | 12 +--- 2 files changed, 4 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/config/events/legacy/01.reclock.script b/ctdb/config/events/legacy/01.reclock.script index 29822e1d48c..ab0f2f6a32b 100755 --- a/ctdb/config/events/legacy/01.reclock.script +++ b/ctdb/config/events/legacy/01.reclock.script @@ -4,6 +4,8 @@ [ -n "$CTDB_BASE" ] || \ CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD") +. "${CTDB_BASE}/functions" + case "$1" in init) recovery_lock=$("${CTDB_HELPER_BINDIR}/ctdb-config" \ @@ -27,6 +29,6 @@ init) esac d=$(dirname "$recovery_lock") - mkdir -vp "$d" + mkdir -p "$d" ;; esac diff --git a/ctdb/tests/eventscripts/01.reclock.init.003.sh b/ctdb/tests/eventscripts/01.reclock.init.003.sh index 85f1f3c6f80..a8b6abdf5b5 100755 --- a/ctdb/tests/eventscripts/01.reclock.init.003.sh +++ b/ctdb/tests/eventscripts/01.reclock.init.003.sh @@ -12,17 +12,7 @@ dir=$(dirname "$CTDB_RECOVERY_LOCK") required_result 1 "" unit_test test -d "$dir" -# FreeBSD mkdir -v just prints the filename. Filter the rest of the -# message from other platforms, including any exotic quotes around the -# filename. -result_filter () -{ - sed \ - -e 's|^\(mkdir: created directory \)[[:punct:]]||' \ - -e 's|[[:punct:]]$||' -} - -ok "$dir" +ok_null simple_test # Ensure directory exists after -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 085e179dcb6 ctdb-tests: fix mem leak in ltdb_fetch from 76709153561 pthreadpool: Remove wrong comment. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 085e179dcb6a06f664d5447a2bee287f0a3698f4 Author: Swen Schillig Date: Mon Aug 19 14:52:13 2019 +0200 ctdb-tests: fix mem leak in ltdb_fetch Direct leak of 256 byte(s) in 8 object(s) allocated from: #0 0x7f11b90d9c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08) #1 0x7f11b8f395df in tdb_alloc_read ../../../lib/tdb/common/io.c:696 #2 0x7f11b8f290ee in _tdb_fetch ../../../lib/tdb/common/tdb.c:274 #3 0x7f11b8f29379 in tdb_fetch ../../../lib/tdb/common/tdb.c:283 #4 0x473ecc in ltdb_fetch ../../tests/src/fake_ctdbd.c:904 #5 0x478b40 in ltdb_transaction_update ../../tests/src/fake_ctdbd.c:993 #6 0x41fef2 in ctdb_rec_buffer_traverse ../../protocol/protocol_types.c:1656 #7 0x48108b in ltdb_transaction ../../tests/src/fake_ctdbd.c:1026 #8 0x48108b in control_trans3_commit ../../tests/src/fake_ctdbd.c:2878 #9 0x48108b in client_process_control ../../tests/src/fake_ctdbd.c:4147 #10 0x48108b in client_process_packet ../../tests/src/fake_ctdbd.c:3839 #11 0x4847f5 in client_read_handler ../../tests/src/fake_ctdbd.c:3806 #12 0x44f620 in comm_read_done ../../common/comm.c:208 #13 0x7f11b8f94fe8 in _tevent_req_notify_callback ../../../lib/tevent/tevent_req.c:141 #14 0x7f11b8f951fd in tevent_req_finish ../../../lib/tevent/tevent_req.c:193 #15 0x7f11b8f95265 in _tevent_req_done ../../../lib/tevent/tevent_req.c:199 #16 0x44e876 in pkt_read_handler ../../common/pkt_read.c:133 #17 0x44f315 in comm_fd_handler ../../common/comm.c:412 #18 0x7f11b8f92896 in tevent_common_invoke_fd_handler ../../../lib/tevent/tevent_fd.c:138 #19 0x7f11b8fa6937 in epoll_event_loop ../../../lib/tevent/tevent_epoll.c:736 #20 0x7f11b8fa6937 in epoll_event_loop_once ../../../lib/tevent/tevent_epoll.c:937 #21 0x7f11b8f9f53e in std_event_loop_once ../../../lib/tevent/tevent_standard.c:110 #22 0x7f11b8f90f34 in _tevent_loop_once ../../../lib/tevent/tevent.c:772 #23 0x7f11b8f955f1 in tevent_req_poll ../../../lib/tevent/tevent_req.c:300 #24 0x485a04 in start_server ../../tests/src/fake_ctdbd.c:4450 #25 0x485a04 in main ../../tests/src/fake_ctdbd.c:4544 #26 0x7f11b8c60412 in __libc_start_main (/lib64/libc.so.6+0x24412) Signed-off-by: Swen Schillig Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Aug 26 10:19:30 UTC 2019 on sn-devel-184 --- Summary of changes: ctdb/tests/src/fake_ctdbd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/ctdb/tests/src/fake_ctdbd.c b/ctdb/tests/src/fake_ctdbd.c index 6736d5dcdd0..146b7da344c 100644 --- a/ctdb/tests/src/fake_ctdbd.c +++ b/ctdb/tests/src/fake_ctdbd.c @@ -927,8 +927,10 @@ static int ltdb_fetch(struct database *db, TDB_DATA key, data->dptr = talloc_memdup(mem_ctx, rec.dptr + ctdb_ltdb_header_len(header), data->dsize); + + free(rec.dptr); + if (data->dptr == NULL) { - free(rec.dptr); return ENOMEM; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 71ad473ba80 ctdb-tests: Clear deleted record via recovery instead of vacuuming via 45b9e02f8f6 ctdb-tests: Wait for child process when killing cluster mutex helper via ca4df060807 ctdb-tests: Strengthen volatile DB traverse test via 5d655ac6f2f ctdb-recoverd: Only check for LMASTER nodes in the VNN map via 53daeb2f878 ctdb-tests: Don't retrieve the VNN map from target node for notlmaster via bff1a3a548a ctdb-tests: Handle special cases first and return via bb59073515e ctdb-tests: Inline handling of recovered and notlmaster statuses via 9b09a87326a ctdb-tests: Drop unused node statuses frozen/unfrozen via 52227d19735 ctdb-tests: Reformat node_has_status() from c3f96981755 lib:crypto: Do not build AES-CMAC if we use GnuTLS that supports it https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 71ad473ba805abe23bbe6c1a1290612e448e73f3 Author: Martin Schwenke Date: Tue Aug 13 14:45:33 2019 +1000 ctdb-tests: Clear deleted record via recovery instead of vacuuming This test has been flapping because sometimes the record is not vacuumed within the expected time period, perhaps even because the check for the record can interfere with vacuuming. However, instead of waiting for vacuuming the record can be cleared by doing a recovery. This should be much more reliable. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 RN: Fix flapping CTDB tests Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Aug 21 13:06:57 UTC 2019 on sn-devel-184 commit 45b9e02f8f67cba9885e95a0c0af73373d39bafd Author: Martin Schwenke Date: Wed Aug 7 16:58:37 2019 +1000 ctdb-tests: Wait for child process when killing cluster mutex helper The following test sometimes fails: == Running "cluster_mutex_test lock-unlock-lock-unlock ./tests/var/cluster_mutex.lockfile" -- Output (Exit status: 134): -- LOCK UNLOCK CONTENTION NOLOCK cluster_mutex_test: ../../tests/src/cluster_mutex_test.c:307: test_lock_unlock_lock_unlock: Assertion `dl2->mh != NULL' failed. -- Required output (Exit status: 0): -- LOCK UNLOCK LOCK UNLOCK FAILED == TEST FAILED: tests/cunit/cluster_mutex_001.sh (status 1) (duration: 0s) == This is due to a race in the test. For the first UNLOCK a signal is sent to the cluster mutex handler but the test tries to retake the lock before that process is scheduled and the signal is processed. Therefore, the fcntl() lock is still held and contention is seen. After unlocking, tests need to wait until the child has gone, so build this into ctdb_kill(). This is one of the only places where the PID is accessible. Outside of testing, on a real system, nothing will never try to (re)take the lock so quickly. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit ca4df06080709adf0cbebc95b0a70b4090dad5ba Author: Martin Schwenke Date: Mon Jul 29 17:22:50 2019 +1000 ctdb-tests: Strengthen volatile DB traverse test Check the record count more often, from multiple nodes. Add a case with multiple records. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 5d655ac6f2ff82f8f1c89b06870d600a1a3c7a8a Author: Martin Schwenke Date: Wed Aug 21 14:35:09 2019 +1000 ctdb-recoverd: Only check for LMASTER nodes in the VNN map BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 53daeb2f878af1634a26e05cb86d87e2faf20173 Author: Martin Schwenke Date: Mon Jul 29 16:45:07 2019 +1000 ctdb-tests: Don't retrieve the VNN map from target node for notlmaster Use the VNN map from the node running node_has_status(). This means that wait_until_node_has_status 1 notlmaster 10 0 will run "ctdb status" on node 0 and check (for up to 10 seconds) if node 1 is in the VNN map. If the LMASTER capability has been dropped on node 1 then the above will wait for the VNN map to be updated on node 0
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 73c850eda42 ctdb-tcp: Mark node as disconnected if incoming connection goes away via 8c98c10f242 ctdb-tcp: Only mark a node connected if both directions are up via 7f4854d9643 ctdb-tcp: Create outbound queue when the connection becomes writable via d80d9edb4dc ctdb-tcp: Use TALLOC_FREE() via c68b6f96f26 ctdb-tcp: Move incoming fd and queue into struct ctdb_tcp_node via c06620169fc ctdb-tcp: Rename fd -> out_fd via 3acb8e9d1c8 ctdb-daemon: Add function ctdb_ip_to_node() from 5cb539d8ade s3: VFS: vfs_default. Convert underlying system call to renameat(). https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 73c850eda4209b688a169aeeb20c453b738cbb35 Author: Martin Schwenke Date: Tue Aug 13 17:08:43 2019 +1000 ctdb-tcp: Mark node as disconnected if incoming connection goes away To make it easy to pass the node data to the upcall, the private data for ctdb_tcp_read_cb() needs to be changed from tnode to node. RN: Avoid marking a node as connected before it can receive packets BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Aug 16 22:50:35 UTC 2019 on sn-devel-184 commit 8c98c10f242bc722beffc711e85c0e4f2e74cd57 Author: Martin Schwenke Date: Fri Aug 9 15:33:05 2019 +1000 ctdb-tcp: Only mark a node connected if both directions are up Nodes are currently marked as up if the outgoing connection is established. However, if the incoming connection is not yet established then this node could send a request where the replying node can not queue its reply. Wait until both directions are up before marking a node as connected. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 7f4854d9643a096a6d8a354fcd27b7c6ed24a75e Author: Martin Schwenke Date: Thu Aug 15 15:57:31 2019 +1000 ctdb-tcp: Create outbound queue when the connection becomes writable Since commit ddd97553f0a8bfaada178ec4a7460d76fa21f079 ctdb_queue_send() doesn't queue a packet if the connection isn't yet established (i.e. when fd == -1). So, don't bother creating the outbound queue during initialisation but create it when the connection becomes writable. Now the presence of the queue indicates that the outbound connection is up. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit d80d9edb4dc107b15a35a39e5c966a3eaed6453a Author: Martin Schwenke Date: Thu Aug 15 15:45:16 2019 +1000 ctdb-tcp: Use TALLOC_FREE() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit c68b6f96f26664459187ab2fbd56767fb31767e0 Author: Martin Schwenke Date: Fri Aug 9 15:29:36 2019 +1000 ctdb-tcp: Move incoming fd and queue into struct ctdb_tcp_node This makes it easy to track both incoming and outgoing connectivity states. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit c06620169fc178ea6db2631f03edf008285d8cf2 Author: Martin Schwenke Date: Fri Aug 9 15:06:34 2019 +1000 ctdb-tcp: Rename fd -> out_fd in_fd is coming soon. Fix coding style violations in the affected and adjacent lines. Modernise some debug macros and make them more consistent (e.g. drop logging of errno when strerror(errno) is already logged. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 3acb8e9d1c854b577d6be282257269df83055d31 Author: Martin Schwenke Date: Thu Aug 8 16:20:44 2019 +1000 ctdb-daemon: Add function ctdb_ip_to_node() This is the core logic from ctdb_ip_to_pnn(), so re-implement that that function using ctdb_ip_to_node(). Something similar (ctdb_ip_to_nodeid()) was recently removed in commit 010c1d77cd7e192b1fff39b7b91fccbdbbf4a786 because it wasn't required. Now there is a use case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14084 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- Summary of changes: ctdb/include/ctdb_private.h | 2 + ctdb/server/ctdb_server.c | 24 +++-- ctdb/tcp/ctdb_tcp.h | 16 ++-- ctdb/tcp/tcp_connect.c | 208 +--- ctdb/tcp/tcp_init.c | 21 +++-- ctdb/tcp/tcp_io.c
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ea7708d8c7f ctdb-scripts: Simplify 01.reclock.script via 38898775e6f ctdb-scripts: Drop monitoring of recovery lock via 5701f4aecaf ctdb-tests: Add some 01.reclock.script init event tests via ecef4411302 ctdb-tests: Fix 01.reclock.script tests for non-default lock via 2bd316d01d3 ctdb-tests: Add tests for cluster mutex lost handling via 41cd44724e2 ctdb-mutex: Add support for exiting if the lock file disappears via af8de1bcfd4 ctdb-mutex: Add an intermediate asynchronous computation for waiting via fae8e438f01 ctdb-mutex: Change parent checking to use an asynchronous computation via 2f768a090e0 ctdb-mutex: Exit immediately if the lock isn't taken via d716be19ea1 ctdb-tests: Add test to confirm need for cluster mutex lock file rechecking via adcf313c49c ctdb-tests: Add cluster mutex tests via 2b6f1a8ee64 ctdb-mutex: Drop dependency on ctdb_set_helper via 76ab0a2b82d ctdb-mutex: Drop unneeded assignment via 98169241ef7 ctdb-mutex: Update to use modern debug macro via c276723dd89 ctdb-tests: Set LANG=C for consistency of command output via 6fe963c3f72 ctdb-recoverd: Periodically log recovery master of incomplete cluster via f2559ef8ce0 ctdb-recoverd: Log the master at the end of elections via 6b7b1e80800 ctdb-tests: Add tests for empty values in config file via efd0c45a8b1 ctdb-common: Fix empty value handling in conf via 242ea955e67 ctdb-tests: Use required_error instead of required_result from 1f923e067db s3:rpc_server: Only dump passwords in developer builds https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ea7708d8c7fa674111ccea58b3cd0757765c702a Author: Martin Schwenke Date: Mon Jul 8 16:35:57 2019 +1000 ctdb-scripts: Simplify 01.reclock.script The "init" event is only run once so don't bother caching the configured value of the recovery lock. Add some extra error checking. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Jul 26 04:52:04 UTC 2019 on sn-devel-184 commit 38898775e6f1fb25171c920f2d8bcce24ec51476 Author: Martin Schwenke Date: Mon Jul 8 13:30:06 2019 +1000 ctdb-scripts: Drop monitoring of recovery lock The fcntl helper now does a more meaningful check. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 5701f4aecafcd4efeba5bc12ace5da3101ea49d9 Author: Martin Schwenke Date: Mon Jul 8 16:37:41 2019 +1000 ctdb-tests: Add some 01.reclock.script init event tests Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit ecef4411302113b0513db30169a8481a0a521316 Author: Martin Schwenke Date: Mon Jul 8 16:17:27 2019 +1000 ctdb-tests: Fix 01.reclock.script tests for non-default lock These tests currently do not do what is expected. They test the default case. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 2bd316d01d3ddf733787eba6092f5880b7feb65a Author: Martin Schwenke Date: Fri Jul 19 13:41:30 2019 +1000 ctdb-tests: Add tests for cluster mutex lost handling Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 41cd44724e2d035d006645407ed623600d0ec6d8 Author: Martin Schwenke Date: Thu Jun 27 16:14:26 2019 +1000 ctdb-mutex: Add support for exiting if the lock file disappears If the lock file is inaccessible or the inode number changes then the lock is lost, so exit. This allows the recovery daemon to trigger an election. The ensuing recovery will re-take the lock. By default the lock file is checked every 60 seconds. A lot can happen in 60 seconds but being more aggressive and accessing the lock too often could result in a performance issue for the cluster filesystem. An new optional 2nd argument is added, which is the lock file re-check time in seconds. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit af8de1bcfd4cfb2b2517b5badcc9ab564276fb92 Author: Martin Schwenke Date: Thu Jun 27 14:13:50 2019 +1000 ctdb-mutex: Add an intermediate asynchronous computation for waiting This will allow more conditions to be waited on via additional sub-requests. At the moment this just completes when the parent wait completes. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit fae8e438f019e7c1d20582f167b3adeac781ddbe Author: Martin Schwenke Date: Thu Jun 27 13:45:01 2019 +1000 ctdb-mutex: Change parent checking to use an asynchronous computation Put the checking for the process being immediately re-parented into the computation too. This w
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 04c0e5212d5 ctdb/build: fix ctdb_mutex_ceph_rados_helper builds from ae9fb93393b s4 lib socket: Ensure address string owned by parent struct https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 04c0e5212d53e8018f631927bd7d07edd724b77c Author: David Disseldorp Date: Thu Apr 18 20:14:31 2019 +0200 ctdb/build: fix ctdb_mutex_ceph_rados_helper builds 2b5dbb352553699afce62dca4964eb0bd64477f8 fixed builds with an explicit --with-libcephfs but broke builds against system Ceph libraries. This change handles both cases. Signed-off-by: David Disseldorp Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu May 9 04:24:56 UTC 2019 on sn-devel-184 --- Summary of changes: ctdb/wscript | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/ctdb/wscript b/ctdb/wscript index eccc5e76f48..614e042bd70 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -680,10 +680,13 @@ def build(bld): destname='README') if bld.env.HAVE_LIBRADOS: +rados_inc = ' include' +if bld.CONFIG_GET('CPPPATH_RADOS') is not None: +rados_inc = bld.CONFIG_GET('CPPPATH_RADOS') + rados_inc bld.SAMBA_BINARY('ctdb_mutex_ceph_rados_helper', source='utils/ceph/ctdb_mutex_ceph_rados_helper.c', deps='talloc tevent rados ceph-common', -includes=bld.CONFIG_GET('CPPPATH_RADOS'), +includes=rados_inc, install_path='${CTDB_HELPER_BINDIR}') sed_expr1 = 's|/usr/local/var/lib/ctdb|%s|g' % (bld.env.CTDB_VARDIR) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 43cacaad571 ctdb: Fix a typo via bb1e32297ef ctdb: Slightly simplify ctdb_ltdb_lock_fetch_requeue from b7028c42462 torture: Add test for talloc size accounting in memcache https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 43cacaad5715d481327064b0602c93f93954561d Author: Volker Lendecke Date: Thu Apr 4 16:33:22 2019 +0200 ctdb: Fix a typo Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sat Apr 6 11:51:55 UTC 2019 on sn-devel-144 commit bb1e32297efb8a24cfce945c2e474fb16e1bbea7 Author: Volker Lendecke Date: Fri Jan 18 16:50:22 2019 +0100 ctdb: Slightly simplify ctdb_ltdb_lock_fetch_requeue Reduce indentation with an early return Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/server/ctdb_ltdb_server.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c index 2d1daafb157..91064d19b73 100644 --- a/ctdb/server/ctdb_ltdb_server.c +++ b/ctdb/server/ctdb_ltdb_server.c @@ -373,14 +373,17 @@ int ctdb_ltdb_lock_fetch_requeue(struct ctdb_db_context *ctdb_db, ret = ctdb_ltdb_lock_requeue(ctdb_db, key, hdr, recv_pkt, recv_context, ignore_generation); - if (ret == 0) { - ret = ctdb_ltdb_fetch(ctdb_db, key, header, hdr, data); - if (ret != 0) { - int uret; - uret = ctdb_ltdb_unlock(ctdb_db, key); - if (uret != 0) { - DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", uret)); - } + if (ret != 0) { + return ret; + } + + ret = ctdb_ltdb_fetch(ctdb_db, key, header, hdr, data); + if (ret != 0) { + int uret; + uret = ctdb_ltdb_unlock(ctdb_db, key); + if (uret != 0) { + DBG_ERR("ctdb_ltdb_unlock() failed with error %d\n", + uret); } } return ret; @@ -388,7 +391,7 @@ int ctdb_ltdb_lock_fetch_requeue(struct ctdb_db_context *ctdb_db, /* - paraoid check to see if the db is empty + paranoid check to see if the db is empty */ static void ctdb_check_db_empty(struct ctdb_db_context *ctdb_db) { -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f1a1c300e19 ctdb-scripts: Do not "correct" number of nfsd threads when it is 0 via a2bd4085896 ctdb-scripts: Update statd-callout to try several configuration files via 0d67ea5fcca ctdb-scripts: Allow load_system_config() to take multiple alternatives via 95283bdf2e9 ctdb-scripts: Default to using systemd services in NFS call-out via 2833ddcfcb7 ctdb-tests: Update NFS test infrastructure to support systemd services via a8fafd377ff ctdb-scripts: Add systemd services to NFS call-out via 708c04071af ctdb-scripts: Start NFS quota service if defined via 42103b56869 ctdb-scripts: Stop/start mount/rquotad/status via NFS call-out via 8de0a339b55 ctdb-scripts: Factor out nfs_load_config() via e72c3c800a5 ctdb-scripts: Add test variable CTDB_NFS_DISTRO_STYLE via 9981353ab79 ctdb-scripts: Rename variable nfslock_service to nfs_lock_service via d7e187c1a70 ctdb-scripts: Reindent some functions prior to making changes from 865b7b0c7d2 libcli: permit larger values of DataLength in SMB2_ENCRYPTION_CAPABILITIES of negotiate response https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f1a1c300e192d43f5c9faf9450ffbf16341a2661 Author: Martin Schwenke Date: Tue Mar 26 14:15:33 2019 +1100 ctdb-scripts: Do not "correct" number of nfsd threads when it is 0 While 0 may indicate that all threads have exited after being stuck, it may also indicate that nfsd should not be running due to being shut down. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sun Mar 31 11:47:44 UTC 2019 on sn-devel-144 commit a2bd4085896804ee2da811e17f18c78a5bf4e658 Author: Martin Schwenke Date: Wed Mar 20 21:22:43 2019 +1100 ctdb-scripts: Update statd-callout to try several configuration files The alternative seems to be to try something via CTDB_NFS_CALLOUT. That would be complicated and seems like overkill for something this simple. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 0d67ea5fcca766734ecc73ad6b0139f7c13a15c5 Author: Martin Schwenke Date: Wed Mar 20 21:19:49 2019 +1100 ctdb-scripts: Allow load_system_config() to take multiple alternatives The situation for NFS config has got more complicated and is probably broken in statd-callout on Debian-like systems at the moment. Allow several alternative configuration names to be tried. Stop after the first that is found and loaded. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 95283bdf2e9ceff2e35af494c79345cfe25c2cf8 Author: Martin Schwenke Date: Tue Mar 26 15:05:58 2019 +1100 ctdb-scripts: Default to using systemd services in NFS call-out BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 2833ddcfcb780497264e0f412a9ad6e26a9bc657 Author: Martin Schwenke Date: Tue Mar 26 15:07:43 2019 +1100 ctdb-tests: Update NFS test infrastructure to support systemd services The tests are written around the default of sysvinit-redhat. Add support for systemd-redhat. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit a8fafd377ff0cb07ab161e437c5fe024704345eb Author: Martin Schwenke Date: Wed Mar 20 17:45:10 2019 +1100 ctdb-scripts: Add systemd services to NFS call-out At least Red Hat and Debian appear to use (a variant of?) the upstream systemd units for NFS, so adding support for these services is relatively easy. Distributions using Sys-V init can patch the call-out to use the relevant Sys-V init services. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 708c04071af8d6ddc3bf2bddbde4d5847f440c0e Author: Martin Schwenke Date: Thu Mar 21 15:30:00 2019 +1100 ctdb-scripts: Start NFS quota service if defined BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 42103b568698d8087d27f0848b402ccb7cfac86b Author: Martin Schwenke Date: Wed Mar 20 17:35:44 2019 +1100 ctdb-scripts: Stop/start mount/rquotad/status via NFS call-out When an NFS check restarts a failed service by hand then systemd will be unable to stop or start this service again because (at least) the PID file will be wro
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 92a90524373 ctdb-tests: Add test for ctdb_io.c via fa8e69ac953 ctdb: buffer write beyond limits from cbf23f2b0fb selftest: Confirm new and old SDDL strings differ after a samba-tool dsacl set https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 92a90524373a0348c1912d5019254dd18c07e207 Author: Christof Schmitt Date: Tue Feb 19 13:59:05 2019 -0700 ctdb-tests: Add test for ctdb_io.c BUG: https://bugzilla.samba.org/show_bug.cgi?id=13791 Signed-off-by: Christof Schmitt Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Feb 22 03:51:37 CET 2019 on sn-devel-144 commit fa8e69ac9538980c441b7fbefe0979027ecc8eac Author: Swen Schillig Date: Fri Feb 15 14:34:05 2019 +0100 ctdb: buffer write beyond limits In order to calculate the number of bytes correctly which are to be read into the buffer, the buffer.offset must be taken into account. This patch fixes a regression introduced by 382705f495dd. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13791 Signed-off-by: Swen Schillig Reviewed-by: Christof Schmitt Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/common/ctdb_io.c | 13 +- .../cunit/{pkt_read_001.sh => ctdb_io_test_001.sh} | 3 +- ctdb/tests/src/ctdb_io_test.c | 196 + ctdb/wscript | 6 + 4 files changed, 216 insertions(+), 2 deletions(-) copy ctdb/tests/cunit/{pkt_read_001.sh => ctdb_io_test_001.sh} (51%) create mode 100644 ctdb/tests/src/ctdb_io_test.c Changeset truncated at 500 lines: diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index d86540762ea..c16eb7f67b7 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -164,6 +164,7 @@ static void queue_io_read(struct ctdb_queue *queue) { int num_ready = 0; uint32_t pkt_size = 0; + uint32_t start_offset; ssize_t nread; uint8_t *data; @@ -226,7 +227,17 @@ buffer_shift: } data_read: - num_ready = MIN(num_ready, queue->buffer.size - queue->buffer.length); + start_offset = queue->buffer.length + queue->buffer.offset; + if (start_offset < queue->buffer.length) { + DBG_ERR("Buffer overflow\n"); + goto failed; + } + if (start_offset > queue->buffer.size) { + DBG_ERR("Buffer overflow\n"); + goto failed; + } + + num_ready = MIN(num_ready, queue->buffer.size - start_offset); if (num_ready > 0) { nread = sys_read(queue->fd, diff --git a/ctdb/tests/cunit/pkt_read_001.sh b/ctdb/tests/cunit/ctdb_io_test_001.sh similarity index 51% copy from ctdb/tests/cunit/pkt_read_001.sh copy to ctdb/tests/cunit/ctdb_io_test_001.sh index c951f39bdee..15842ea8e17 100755 --- a/ctdb/tests/cunit/pkt_read_001.sh +++ b/ctdb/tests/cunit/ctdb_io_test_001.sh @@ -4,4 +4,5 @@ ok_null -unit_test pkt_read_test +unit_test ctdb_io_test 1 +unit_test ctdb_io_test 2 diff --git a/ctdb/tests/src/ctdb_io_test.c b/ctdb/tests/src/ctdb_io_test.c new file mode 100644 index 000..5a2f81538a1 --- /dev/null +++ b/ctdb/tests/src/ctdb_io_test.c @@ -0,0 +1,196 @@ +/* + ctdb_io tests + + Copyright (C) Christof Schmitt 2019 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. +*/ + +#include "replace.h" +#include "system/filesys.h" + +#include + +#include "common/ctdb_io.c" + +void ctdb_set_error(struct ctdb_context *ctdb, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vprintf(fmt, ap); + assert(false); +} + +static void test_setup(ctdb_queue_cb_fn_t cb, + int *pfd, + struct ctdb_context **pctdb) +{ + int pipefd[2], ret; + struct ctdb_context *ctdb; + struct ctdb_queue *queue; + + ret = pipe(pipefd); + assert(ret == 0); + + ctdb = talloc_zero(NULL, struct ctdb_context); + assert(ctdb != NULL); + + ctdb-&
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via a0bad13 ldb_ldif: avoid strlen(NULL) from ce518f3 ldb_ldif: be less horribly efficient in debugging https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a0bad1364a9403afc5f457bf71a1eae48ab7b54e Author: Douglas Bagnall Date: Fri Oct 19 10:21:21 2018 +1300 ldb_ldif: avoid strlen(NULL) Signed-off-by: Douglas Bagnall Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Oct 19 03:43:58 CEST 2018 on sn-devel-144 --- Summary of changes: lib/ldb/common/ldb_ldif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/lib/ldb/common/ldb_ldif.c b/lib/ldb/common/ldb_ldif.c index ec1859b..e694678 100644 --- a/lib/ldb/common/ldb_ldif.c +++ b/lib/ldb/common/ldb_ldif.c @@ -313,7 +313,7 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb, for (i=0;inum_elements;i++) { const struct ldb_schema_attribute *a; - size_t namelen = strlen(msg->elements[i].name); + size_t namelen; if (msg->elements[i].name == NULL) { ldb_debug(ldb, LDB_DEBUG_ERROR, @@ -322,6 +322,7 @@ static int ldb_ldif_write_trace(struct ldb_context *ldb, return -1; } + namelen = strlen(msg->elements[i].name); a = ldb_schema_attribute_by_name(ldb, msg->elements[i].name); if (ldif->changetype == LDB_CHANGETYPE_MODIFY) { -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b6efa15 heimdal-build: Avoid using python str.format() from cf7e771 Fix pdb_samba_dsdb build on Ubuntu 16.04 with -O3 -Werror=strict-overflow https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b6efa1507c38d316e8cf05025b47a555ca0d0d0a Author: Amitay Isaacs Date: Wed Sep 19 18:31:34 2018 +1000 heimdal-build: Avoid using python str.format() In python 2.6, the format fields need to be numbered explicitly. This causes the build to fail on RHEL6/Centos6 with following error: File "/home/amitay/samba.git/source4/heimdal_build/wscript_build", line 87, in HEIMDAL_ASN1 os.path.join(bld.path.abspath(), option_file))) ValueError: zero length field name in format To use str.format() in HEIMDAL_ASN1(), "--option-file='{}'" needs to be "--options-file='{0}'" Or this fix which avoids str.format() completely. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Sep 21 03:06:44 CEST 2018 on sn-devel-144 --- Summary of changes: source4/heimdal_build/wscript_build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build index a0572e4..45938b8 100644 --- a/source4/heimdal_build/wscript_build +++ b/source4/heimdal_build/wscript_build @@ -82,9 +82,8 @@ def HEIMDAL_ASN1(name, source, t.env.ASN1OPTIONS = options t.env.BLDBIN = os.path.normpath(os.path.join(bld.srcnode.abspath(bld.env), '..')) if option_file is not None: -t.env.OPTION_FILE = "--option-file='{}'".format( -os.path.normpath( -os.path.join(bld.path.abspath(), option_file))) +t.env.OPTION_FILE = "--option-file='%s'" % \ +os.path.normpath(os.path.join(bld.path.abspath(), option_file)) cfile = out_files[0][0:-2] + '.c' hfile = out_files[1][0:-3] + '.h' -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d0d1eaf gitlab-ci: Correct the ctdb tasks from 486022e ctdb-recoverd: Set recovery lock handle at start of attempt https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d0d1eafae9a9232b4a9314d854d56b98098e7f8e Author: Martin Schwenke Date: Tue Sep 18 11:48:17 2018 +1000 gitlab-ci: Correct the ctdb tasks They're swapped. Signed-off-by: Martin Schwenke Reviewed-by: Andrew Bartlett Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Sep 18 10:33:57 CEST 2018 on sn-devel-144 --- Summary of changes: .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9aa9fb2..90dd321 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,12 +85,12 @@ build_samba_static: build_ctdb: <<: *shared_template script: -- python script/autobuild.py samba-ctdb --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase +- python script/autobuild.py ctdb --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase build_samba_ctdb: <<: *shared_template script: -- python script/autobuild.py ctdb --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase +- python script/autobuild.py samba-ctdb --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase build_others: <<: *shared_template -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 486022e ctdb-recoverd: Set recovery lock handle at start of attempt via b1dc568 ctdb-recoverd: Handle cancellation when releasing recovery lock via a755d06 ctdb-recoverd: Return early when the recovery lock is not held via c522167 ctdb-recoverd: Store recovery lock handle via a53b264 ctdb-recoverd: Use talloc() to allocate recovery lock handle via af22f03 ctdb-recoverd: Rename hold_reclock_state to ctdb_recovery_lock_handle via c516e58 ctdb-recoverd: Re-check master on failure to take recovery lock via 59fc016 ctdb-recoverd: Clean up taking of recovery lock via e789d0d ctdb-cluster-mutex: Block signals around fork via 5a6b139 ctdb-cluster-mutex: Reset SIGTERM handler in cluster mutex child from 0cb3413 s4/librpc: Fix py2 dependecies leaking into py3 libraries https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 486022ef8f43251258f255ffa15f1a01bc6aa2b7 Author: Martin Schwenke Date: Mon Sep 3 13:30:57 2018 +1000 ctdb-recoverd: Set recovery lock handle at start of attempt This allows the attempt to be cancelled if an election is lost and an unlock is done before the attempt is completed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Sep 18 02:18:30 CEST 2018 on sn-devel-144 commit b1dc5687844e90b0e3c39cb46a1116c86118fbf4 Author: Martin Schwenke Date: Mon Sep 3 13:01:19 2018 +1000 ctdb-recoverd: Handle cancellation when releasing recovery lock If the recovery lock is in the process of being taken then free the cluster mutex handle but leave the recovery lock handle in place. This allows ctdb_recovery_lock() to fail. Note that this isn't yet live because rec->recovery_lock_handle is still only set at the completion of the attempt to take the lock. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit a755d060c13b65dfb6d73979aaf111c489882bfb Author: Martin Schwenke Date: Tue Sep 11 15:05:19 2018 +1000 ctdb-recoverd: Return early when the recovery lock is not held This makes upcoming changes simpler. Update to modern debug macro while touching relevant line. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit c52216740bd81b68876de06e104822bbbca86df9 Author: Martin Schwenke Date: Mon Sep 3 12:39:32 2018 +1000 ctdb-recoverd: Store recovery lock handle ... not just cluster mutex handle. This makes the recovery lock handle long-lived and with allow the releasing code to cancel an in-progress attempt to take the recovery lock. The cluster mutex handle is now allocated off the recovery lock handle. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit a53b264aee7d620ee8ecf9114b0014c5bb678484 Author: Martin Schwenke Date: Mon Sep 3 11:43:44 2018 +1000 ctdb-recoverd: Use talloc() to allocate recovery lock handle At the moment this is still local and is freed after the mutex is successfully taken. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit af22f03dbe9040f5f743eb85bb50d411269bbab4 Author: Martin Schwenke Date: Mon Sep 3 11:30:06 2018 +1000 ctdb-recoverd: Rename hold_reclock_state to ctdb_recovery_lock_handle This will be a longer lived structure. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit c516e58ce92c420dc993bd9b7f1433641bd764bd Author: Martin Schwenke Date: Sun Sep 9 08:30:50 2018 +1000 ctdb-recoverd: Re-check master on failure to take recovery lock If the master changed while trying to take the lock then fail gracefully. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 59fc01646c7d65ba90b0a1a34c3795ff842351c5 Author: Martin Schwenke Date: Sun Sep 9 08:27:46 2018 +1000 ctdb-recoverd: Clean up taking of recovery lock No functional changes, just coding style cleanups and debug message tweaks. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13617 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit e789d0da57fc3fc6d22bfa00577a2e65034ca27a Author: Martin Schwenke Date: Wed Sep 12 17:51:47 2018 +1000 ctdb-cluster-mutex: Block
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 93d72bc wafsamba: Only use $DESTDIR in INSTALL_DIR() if it is set from f84e372 dbwrap_ctdb: return correct record count for a persistent db read-only traverse https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 93d72bcfb0dea3d7734771bbb550c45d642955c9 Author: Martin Schwenke Date: Thu Sep 13 10:54:48 2018 +1000 wafsamba: Only use $DESTDIR in INSTALL_DIR() if it is set Otherwise the leading '/' is stripped and directories are created relative to the current directory. This fixes a regression introduced in recent commit 26ea0f58daace4adef7c5bb17f19476083bf3b7b. Reported-by: Ralph Böhme Signed-off-by: Martin Schwenke Reviewed-by: Alexander Bokovoy Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Sep 13 09:37:23 CEST 2018 on sn-devel-144 --- Summary of changes: buildtools/wafsamba/wafsamba.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index dbcfe12..36bc6c3 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -897,8 +897,9 @@ def INSTALL_DIR(bld, path, chmod=0o755, env=None): if not path: return [] -destpath = os.path.join(Options.options.destdir, -bld.EXPAND_VARIABLES(path).lstrip(os.sep)) +destpath = bld.EXPAND_VARIABLES(path) +if Options.options.destdir: +destpath = os.path.join(Options.options.destdir, destpath.lstrip(os.sep)) if bld.is_install > 0: if not os.path.isdir(destpath): -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e52abc8 ctdb-doc: Remove PIDFILE option from ctdbd_wrapper man page from cc30805 samba_dnsupdate: honor 'dns zone scavenging' option, only update if needed https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e52abc8a44de6791dceb6f43af1db472a3d9ec37 Author: Ralph Wuerthner Date: Tue Sep 11 10:00:52 2018 +0200 ctdb-doc: Remove PIDFILE option from ctdbd_wrapper man page BUG: https://bugzilla.samba.org/show_bug.cgi?id=13610 Signed-off-by: Ralph Wuerthner Reviewed-by: Martin Schwenke Reviewed-by: Ralph Böhme Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Sep 12 21:50:57 CEST 2018 on sn-devel-144 --- Summary of changes: ctdb/doc/ctdbd_wrapper.1.xml | 6 -- 1 file changed, 6 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/doc/ctdbd_wrapper.1.xml b/ctdb/doc/ctdbd_wrapper.1.xml index a1b92e3..2c68c47 100644 --- a/ctdb/doc/ctdbd_wrapper.1.xml +++ b/ctdb/doc/ctdbd_wrapper.1.xml @@ -20,7 +20,6 @@ ctdbd_wrapper - PIDFILE start stop @@ -35,11 +34,6 @@ - PIDFILE specifies the location of the - file containing the PID of the main CTDB daemon. - - - See ctdb 7 for an overview of CTDB. -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c4c6ca5 wafsamba: Support clang as C compiler from bc62182 ctdb-tests: Check result of write() in ARP and TCP tests https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c4c6ca5e0c06d616c995d6c6ff803b74caec513a Author: Andreas Schneider Date: Wed Sep 5 11:05:25 2018 +0200 wafsamba: Support clang as C compiler Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Sep 6 12:06:05 CEST 2018 on sn-devel-144 --- Summary of changes: buildtools/wafsamba/generic_cc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/generic_cc.py b/buildtools/wafsamba/generic_cc.py index 93a43ea..f6f8b18 100644 --- a/buildtools/wafsamba/generic_cc.py +++ b/buildtools/wafsamba/generic_cc.py @@ -9,7 +9,8 @@ from waflib.Configure import conftest from waflib.Tools.compiler_c import c_compiler -c_compiler['default'] = ['gcc', 'generic_cc'] +c_compiler['default'] = ['gcc', 'generic_cc', 'clang'] +c_compiler['freebsd'] = ['clang', 'generic_cc', 'gcc'] c_compiler['hpux'] = ['gcc', 'generic_cc'] @conftest -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c6b95c3 ctdb: remove queue destructor as it isn't needed anymore via d76c7b2 Minor, really small, documentation fix. from eb4161d selftest: offline backup restore target https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c6b95c3672505924e9d5754457d6125f44406f4c Author: Swen Schillig Date: Mon Mar 12 11:00:55 2018 +0100 ctdb: remove queue destructor as it isn't needed anymore After commit e097b7f8ff1a9992de1d11474dac4969e30cd679 Author: David Disseldorp Date: Sun Jul 31 03:14:54 2011 +0200 io: Make queue_io_read() safe for reentry the destructor has no purpose anymore, therfore, remove it. Signed-off-by: Swen Schillig Reviewed-by: Martin Schwenke Reviewed-by: David Disseldorp Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Aug 6 11:37:32 CEST 2018 on sn-devel-144 commit d76c7b204e30a38747679ccd2597dd3a2b8bd394 Author: Richard Sharpe Date: Thu Feb 1 19:31:46 2018 -0800 Minor, really small, documentation fix. Signed-off-by: Richard Sharpe Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/common/ctdb_io.c | 13 - lib/tevent/tevent.h | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index c694124..da444ac 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -65,7 +65,6 @@ struct ctdb_queue { size_t alignment; void *private_data; ctdb_queue_cb_fn_t callback; - bool *destroyed; const char *name; uint32_t buffer_size; }; @@ -411,17 +410,6 @@ int ctdb_queue_set_fd(struct ctdb_queue *queue, int fd) return 0; } -/* If someone sets up this pointer, they want to know if the queue is freed */ -static int queue_destructor(struct ctdb_queue *queue) -{ - TALLOC_FREE(queue->buffer.data); - queue->buffer.length = 0; - queue->buffer.size = 0; - if (queue->destroyed != NULL) - *queue->destroyed = true; - return 0; -} - /* setup a packet queue on a socket */ @@ -454,7 +442,6 @@ struct ctdb_queue *ctdb_queue_setup(struct ctdb_context *ctdb, return NULL; } } - talloc_set_destructor(queue, queue_destructor); queue->buffer_size = ctdb->tunable.queue_buffer_size; /* In client code, ctdb->tunable is not initialized. diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h index aa6fe0d..664604a 100644 --- a/lib/tevent/tevent.h +++ b/lib/tevent/tevent.h @@ -1187,7 +1187,7 @@ void _tevent_req_oom(struct tevent_req *req, #endif /** - * @brief Finish a request before the caller had the change to set the callback. + * @brief Finish a request before the caller had a chance to set the callback. * * An implementation of an async request might find that it can either finish * the request without waiting for an external event, or it can not even start -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 4fcbaae ctdb-doc: Provide an example script for migrating old configuration from 8025467 s3:libads: Add net ads keep-account test https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 4fcbaae57b129deaacfab0a226cefca99aa78256 Author: Martin Schwenke Date: Thu Jul 12 20:10:35 2018 +1000 ctdb-doc: Provide an example script for migrating old configuration Include an example ctdbd.conf-style file for testing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13550 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Jul 30 14:30:06 CEST 2018 on sn-devel-144 --- Summary of changes: ctdb/doc/examples/config_migrate.sh | 688 ctdb/doc/examples/config_migrate.test_input | 45 ++ 2 files changed, 733 insertions(+) create mode 100755 ctdb/doc/examples/config_migrate.sh create mode 100644 ctdb/doc/examples/config_migrate.test_input Changeset truncated at 500 lines: diff --git a/ctdb/doc/examples/config_migrate.sh b/ctdb/doc/examples/config_migrate.sh new file mode 100755 index 000..8eefd03 --- /dev/null +++ b/ctdb/doc/examples/config_migrate.sh @@ -0,0 +1,688 @@ +#!/bin/sh + +# config_migrate.sh - migrate old ctdbd.conf file to new configuration files +# +# Input files are old-style CTDB configuration files, including: +# +# /etc/ctdb/ctdbd.conf +# /usr/local/etc/ctdb/ctdbd.conf +# /etc/sysconfig/ctdb +# /etc/defaults/ctdb +# +# These files are sourced by this script. They used to be sourced by +# ctdbd_wrapper, so this should not be too surprising. +# +# By default, the output directory is the given configuration +# directory. An alternate output directory can be specified if this +# isn't desired. +# +# The output directory will contain the following if non-empty: +# +# * ctdb.conf (may be empty) +# * script.options +# * ctdb.tunables +# * ctdb.sysconfig - consider installing as /etc/sysconfig/ctdb, +#/etc/default/ctdb, or similar +# * commands.sh- consider running commands in this files +# * README.warn- warnings about removed/invalid configuration options + +usage () +{ + cat <] [-o ] ... +EOF +exit 1 +} + +config_dir="" +out_dir="" +force=false + +while getopts "d:fho:?" opt ; do + case "$opt" in + d) config_dir="$OPTARG" ;; + f) force=true ;; + o) out_dir="$OPTARG" ;; + \?|h) usage ;; + esac +done +shift $((OPTIND - 1)) + +if [ $# -lt 1 ] ; then + usage +fi + +if [ -z "$config_dir" ] ; then + echo "Assuming \"/etc/ctdb\" as ctdb configuration directory" + echo "If that's not correct, please specify config dir with -d" + echo + config_dir="/etc/ctdb" +else + echo "Using \"$config_dir\" as ctdb configuration directory" + echo +fi + +if [ -z "$out_dir" ] ; then + echo "No output directory specified, using \"$config_dir\"" + echo + out_dir="$config_dir" +fi + + + +# +# Output file handling +# + +out_file_check_and_create () +{ + _out_file="$1" + + if [ -f "$_out_file" ] ; then + if ! $force ; then + echo "Not overwriting existing file: ${_out_file}" >&2 + return 1 + fi + mv -v "$_out_file" "${_out_file}.convertsave" + fi + + touch "$_out_file" + + return 0 +} + +out_file_remove_if_empty () +{ + _out_file="$1" + + if [ ! -s "$_out_file" ] ; then + rm "$_out_file" + fi +} + + + +# +# Option/tunable/service conversion and validity checking +# +# This is basically the data that drives most of the rest of the +# script +# + +# Convert a ctdbd.conf opt+val into a ctdb.conf section+opt +# +# If opt is matched and val is empty then output is printed, allowing +# this function to be reused to check if opt is valid. +get_ctdb_conf_option () +{ + _opt="$1" + _val="$2" + + awk -v opt="${_opt}" -v val="${_val}" \ + '$3 == opt { if (!$4 || !val || val ==$4) { print $1, $2 } }' </dev/null +} + + + +# +# Utilities +# + +# List all options starting with "CTDB_" set in given configuration files +list_options () +{ +
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via a44e698 ctdb-docs: Replace obsolete reference to CTDB_DEBUG_HUNG_SCRIPT option via be43e08 ctdb-common: Fix the TCP packet length check via 3047202 ctdb-tests: Strip all spaces from od output via 6f5ed2b ctdb-tests: Fix a typo via 65cc36f ctdb-tests: Use errcode to translate ETIMEDOUT via 22c3078 ctdb-tests: Replace md5sum with posix cksum via 07844c2 ctdb-tests: Use portable wc -c instead of stat -c "%s" via 96d5c7d ctdb-scripts: date "+%N" is non-portable via 68542db ctdb-tests: Simplify pattern matching for ctime output via 4152e98 ctdb-tests: Do not try to match pstree output in eventd tests via 3bf753e ctdb-common: Add fd argument to ctdb_connection_list_read() via c9b42d2 ctdb-protocol: Avoid fgets in ctdb_connection_list_read via c7041b0 ctdb-common: Add line based I/O via 0273171 ctdb-tests: Porting tests should ignore unsupported features via 23952c9 ctdb-tests: Use sigcode to match signals via b0028dd ctdb-tests: Add signal code matching utility via b7dbe9f ctdb-tests: Add ps output filter for freebsd via e1236a8 ctdb-client: Switch to ETIMEDOUT instead of ETIME via b886a95 ctdb-daemon: Switch to using ETIMEDOUT instead of ETIME via c8756ec ctdb-event: Switch to ETIMEDOUT instead of ETIME via a42a723 ctdb-common: Switch to ETIMEDOUT from ETIME via e8a1b3d ctdb-tests: Add required_error() to match on error codes via af8c31e ctdb-tests: Add errno matching utility via f13824b ctdb-tests: Switch some test stubs to use /bin/sh via 2f2c35a ctdb-tests: Improve portability by not using mktemp --tmpdir option via 896c77d ctdb-tests: Avoid use of non-portable getopt in stubs via 56ffca3 ctdb-tests: Avoid use of non-portable getopt in run_tests.sh via 4a39bc4 ctdb-tools: Avoid use of non-portable getopt in onnode via dd9d8a2 ctdb-tests: Improve portability by not using /bin/bash directly via 73298ac ctdb-tools: Improve portability by not using /bin/bash directly from 2ba5fb2 autobuild: Test with and without building bundled popt https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a44e6987b1e469ae202777cd575fd81c19e1ac6c Author: Martin Schwenke Date: Thu Jul 12 17:38:38 2018 +1000 ctdb-docs: Replace obsolete reference to CTDB_DEBUG_HUNG_SCRIPT option BUG: https://bugzilla.samba.org/show_bug.cgi?id=13546 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sat Jul 28 07:26:24 CEST 2018 on sn-devel-144 commit be43e08072ebce937ed0a02cd8d9d1c6072b178d Author: Amitay Isaacs Date: Thu Jul 26 14:51:44 2018 +1000 ctdb-common: Fix the TCP packet length check BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 3047202ce733d1a767fbc83c7021cb83bb83e0e1 Author: Amitay Isaacs Date: Thu Jul 19 17:41:55 2018 +1000 ctdb-tests: Strip all spaces from od output On freebsd, there are trailing spaces in od output. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 6f5ed2b8b829e01fc675537e47095868ff8b5aa2 Author: Amitay Isaacs Date: Thu Jul 19 17:41:07 2018 +1000 ctdb-tests: Fix a typo BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 65cc36f24d8a92c749dbc3700802e1d83a9ceb9f Author: Amitay Isaacs Date: Thu Jul 19 17:40:40 2018 +1000 ctdb-tests: Use errcode to translate ETIMEDOUT BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 22c3078c8b10c88f8aff22caa7c92a06f387f17d Author: Amitay Isaacs Date: Thu Jul 19 16:10:15 2018 +1000 ctdb-tests: Replace md5sum with posix cksum BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 07844c2ec9583362594241e607d81aaead8f1a99 Author: Amitay Isaacs Date: Thu Jul 19 15:27:51 2018 +1000 ctdb-tests: Use portable wc -c instead of stat -c "%s" BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 96d5c7de82f795e33e9998e0fe94ddcb50e7421d Author: Amitay Isaacs Date: Thu Jul 19 14:43:09 2018 +1000 ctdb-scripts: date "+%N" is non-portable BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520 Signed-off-by: Amitay Isaacs
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via a30ac85 ctdb-tests: Avoid segfault by initializing logging via b2d75c0 ctdb-common: Fix CID 437606 from f033645 selftest: Use a longer self.account_lockout_duration and self.lockout_observation_window https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a30ac853ff9bca023c53ad98775eabb23156c566 Author: Amitay Isaacs Date: Thu Jul 5 13:40:33 2018 +1000 ctdb-tests: Avoid segfault by initializing logging This is in addition to af697008531. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Jul 5 15:22:16 CEST 2018 on sn-devel-144 commit b2d75c0108f6edc7234bfa23a82b2c6c228a836f Author: Amitay Isaacs Date: Wed Jul 4 17:45:45 2018 +1000 ctdb-common: Fix CID 437606 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/common/conf.c | 10 +- ctdb/tests/src/ctdb_takeover_tests.c | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/conf.c b/ctdb/common/conf.c index 3c1369e..74af7f8 100644 --- a/ctdb/common/conf.c +++ b/ctdb/common/conf.c @@ -1014,11 +1014,6 @@ static int conf_load_internal(struct conf_context *conf) int ret; bool ok; - fp = fopen(conf->filename, "r"); - if (fp == NULL) { - return errno; - } - state = (struct conf_load_state) { .conf = conf, .mode = (conf->reload ? CONF_MODE_RELOAD : CONF_MODE_LOAD), @@ -1029,6 +1024,11 @@ static int conf_load_internal(struct conf_context *conf) return ret; } + fp = fopen(conf->filename, "r"); + if (fp == NULL) { + return errno; + } + ok = tini_parse(fp, false, conf_load_section, diff --git a/ctdb/tests/src/ctdb_takeover_tests.c b/ctdb/tests/src/ctdb_takeover_tests.c index a0e2f0f..aec23c0 100644 --- a/ctdb/tests/src/ctdb_takeover_tests.c +++ b/ctdb/tests/src/ctdb_takeover_tests.c @@ -254,6 +254,8 @@ int main(int argc, const char *argv[]) int loglevel; const char *debuglevelstr = getenv("CTDB_TEST_LOGLEVEL"); + setup_logging("ctdb_takeover_tests", DEBUG_STDERR); + if (! debug_level_parse(debuglevelstr, &loglevel)) { loglevel = DEBUG_DEBUG; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via dda99e4 ctdb-tests: Switch to using new event daemon via db548f4 ctdb-daemon: Add client code to talk to new event daemon via 8250072 ctdb-protocol: Remove protocol for old event daemon via 0e444c9 ctdb-client: Remove client code for old event daemon via b6938c0 ctdb-tools: Remove old event daemon tool via ce3db0d ctdb-daemon: Remove old event daemon via 99fa3a3 ctdb-tests: Remove tests for old event daemon via 26b1940 ctdb-tools: Switch to using new event daemon tool via efc5d3c ctdb-daemon: Switch to starting new event daemon via 6eaef84 ctdb-event: Add tests for event daemon via f9104d4 ctdb-tests: Rename eventd testsuite to ctdb_eventd via 587a1e0 ctdb-event: Add event daemon client tool via 99c33e6 ctdb-event: Add event daemon client code via 24ba8e7 ctdb-event: Add event daemon implementation via 281bc84 ctdb-event: Add event daemon protocol via f42106f ctdb-common: Add client pid to connect callback in sock_daemon via 5586e03 ctdb-tests: Separate testing code for basic data types via cbf7e2f ctdb-build: Add ctdb prefix to build target via 046d468 ctdb-protocol: Separate protocol-basic subsystem from 9a7e9e5 autobuild: Fix random-sleep.sh invocation in autobuild.py https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit dda99e49e3be6295cf91d4dffe010361469f8eb1 Author: Amitay Isaacs Date: Thu Jun 21 18:02:06 2018 +1000 ctdb-tests: Switch to using new event daemon Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Jul 5 09:39:33 CEST 2018 on sn-devel-144 commit db548f4852533bfbe250cd7b3281f16e2c34d14e Author: Amitay Isaacs Date: Thu Jun 21 17:16:07 2018 +1000 ctdb-daemon: Add client code to talk to new event daemon This fixes the build and now new eventd is integrated completely in CTDB. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 8250072a8116e04031e6a161c3bbc2af73fae431 Author: Amitay Isaacs Date: Thu Jun 21 16:44:02 2018 +1000 ctdb-protocol: Remove protocol for old event daemon This breaks the build. The new eventd protocol cannot be introduced without removing the old eventd protocol. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 0e444c961c0755129d614963fb23cff737cfcaf1 Author: Amitay Isaacs Date: Thu Jun 21 16:56:43 2018 +1000 ctdb-client: Remove client code for old event daemon Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit b6938c0976d3d4150f683cabb8dc5dc5b3b4944f Author: Amitay Isaacs Date: Thu Jun 21 17:02:54 2018 +1000 ctdb-tools: Remove old event daemon tool Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit ce3db0d4698c77808448dce1f762e7157de9395f Author: Amitay Isaacs Date: Thu Jun 21 16:41:16 2018 +1000 ctdb-daemon: Remove old event daemon Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 99fa3a343f61213cf4cf214751ede0a7568f3167 Author: Amitay Isaacs Date: Thu Jun 21 16:42:47 2018 +1000 ctdb-tests: Remove tests for old event daemon Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 26b19401622d751a56d9a8df4d4102b5df1f6519 Author: Amitay Isaacs Date: Thu Jun 21 17:02:09 2018 +1000 ctdb-tools: Switch to using new event daemon tool Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit efc5d3caddc3952b30b709f4f24c51e42e8c9bdb Author: Amitay Isaacs Date: Thu Jun 21 16:38:01 2018 +1000 ctdb-daemon: Switch to starting new event daemon From this patch onwards, CTDB daemon is broken till the client code for new eventd is integrated. This requires getting rid of the old eventd protocol and client code and then switching to the new eventd protocol and client code. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 6eaef8491e4dbef2d5e7467e9e7dc40a971ec84a Author: Amitay Isaacs Date: Fri May 4 18:08:08 2018 +1000 ctdb-event: Add tests for event daemon Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit f9104d46596919dd0e55c841533b26c7f90526fe Author: Amitay Isaacs Date: Fri May 4 17:18:39 2018 +1000 ctdb-tests: Rename eventd testsuite to ctdb_eventd Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 587a1e045e5cf632abef0c1ee14231bae32837b1 Author: Amitay Isaacs Date: Thu Apr 26 18:46:27 2018 +1000 ctdb-event: Add event daemon client tool Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 99c33e6f984e6431cbeeab006e61ea99ce15ff47 Author: Amitay
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 734ea27 uid_wrapper: Be strict when checking __attribute__ features via c220e31 resolv_wrapper: Be strict when checking __attribute__ features via 65b0746 pam_wrapper: Be strict when checking __attribute__ features via 9a670bd nss_wrapper: Be strict when checking __attribute__ features via 59dfd2d replace: Be strict when checking __attribute__ features via 77cdfe3 socket_wrapper: Be strict when checking __attribute__ features via a9775c2 wafsamba: Be strict when checking __attribute__ features via c08d65c wafsamba: Add strict option to CHECK_CODE via 271407a ctdb-daemon: Set environment variable if running in interactive mode via a4393dd ctdb-daemon: Avoid closing stdin when running in interactive mode via af69700 ctdb-tests: Avoid segfault by initializing logging via b977ded ctdb-common: Use correct return type for tevent_queue_add_entry from 9f28d30 s3:winbind: Do not lookup local system accounts in AD https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 734ea271ab01e74d0694f3fbc9acdf980d866b30 Author: Amitay Isaacs Date: Tue Jul 3 14:45:39 2018 +1000 uid_wrapper: Be strict when checking __attribute__ features BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Jul 5 03:01:33 CEST 2018 on sn-devel-144 commit c220e310b40c67b73248141b3af544bad19fd39d Author: Amitay Isaacs Date: Tue Jul 3 14:45:24 2018 +1000 resolv_wrapper: Be strict when checking __attribute__ features BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider commit 65b0746694a0cbd8f40c5e89dc9a680044f7a1a9 Author: Amitay Isaacs Date: Tue Jul 3 14:45:04 2018 +1000 pam_wrapper: Be strict when checking __attribute__ features BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider commit 9a670bde563b269587c051c655a7b3778c008c87 Author: Amitay Isaacs Date: Tue Jul 3 14:44:48 2018 +1000 nss_wrapper: Be strict when checking __attribute__ features BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider commit 59dfd2d797b7fa1610610ad1db2f31d5dfae4f06 Author: Amitay Isaacs Date: Tue Jul 3 14:36:33 2018 +1000 replace: Be strict when checking __attribute__ features BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider commit 77cdfe3ecc06a9aef9ea4201a1a76a9a7b47a73f Author: Amitay Isaacs Date: Tue Jul 3 14:36:16 2018 +1000 socket_wrapper: Be strict when checking __attribute__ features BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider commit a9775c2429554e029164ad9b98dc8c8c749c50fe Author: Amitay Isaacs Date: Tue Jul 3 14:34:29 2018 +1000 wafsamba: Be strict when checking __attribute__ features BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider commit c08d65c3eea997d52e311f027d84bdc3f9c93059 Author: Amitay Isaacs Date: Tue Jul 3 13:56:13 2018 +1000 wafsamba: Add strict option to CHECK_CODE Some compilers (e.g. xlc) ignores unsupported features, generates a warning, but does not fail compilation. This ensures that any compiler warnings are treated as errors and the feature support is correctly identified. This adds equivalent compiler option to -Werror for xlc. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider commit 271407ab16f17282b3e63b6459d5511ec00c6d2d Author: Amitay Isaacs Date: Tue Jun 26 18:39:09 2018 +1000 ctdb-daemon: Set environment variable if running in interactive mode CTDB_INTERACTIVE will be used to tell the other daemons if the ctdb daemon is started in interactive mode. This is primarily used only for testing. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit a4393ddef763382ae0315792421cae0638949f29 Author: Amitay Isaacs Date: Thu Jun 21 17:57:02 2018 +1000 ctdb-daemon: Avoid closing stdin when running in interactive mode Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit af697008531bd74546656841dd3a1ed92522fc57 Author: Amitay Isaacs Date: Thu Jun 21 20:00:41 2018 +1000 ctdb-tests: Avoid segfault by initializing logging Setting DEBUGLEVEL before calling
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 0b4a071 ctdb-tests: Teach strace packet parser about non-octal escapes via 63255ef ctdb-daemon: Only consider client ID for local database attach via af446d5 ctdb-docs: Fix the documentation for VNN map via 36938bf ctdb-server: Rename CTDB_BROADCAST_VNNMAP -> CTDB_BROADCAST_ACTIVE via ec72fad ctdb-tests: Add a simple test for database traverses via 4b00855 ctdb-tests: Add check for non-lmaster node status in integration tests via 77db0b1 ctdb-client: Fix typo where CTDB_BROADCAST_ALL is repeated via b318cf2 ctdb-recoverd: Set the process name correctly via cd9930e ctdb-scripts: Drop 99.timeout event script via ff181a8 ctdb-tests: Switch 90_debug_hung_script.sh to be a simple test via dfd39c9 ctdb-tests: Enable event script debugging in local daemon tests via 9f09579 ctdb-tests: Support CTDB_RUN_TIMEOUT_MONITOR=yes in simple tests via 9e1cbd9 ctdb-tests: Clean up startup event in 00.test event script via 673b0e7 ctdb-tests: Add generic logging of event details in 00.test event script via 711 ctdb-tests: Drop unnecessary code in 00.test event script via acd10a5 ctdb-tests: Clean up argument validation in 00.test event script via 23adbaa ctdb-tests: Drop check for invalid event in 00.test event script via edffe4d tdb: Fix build on AIX via 40a8ab1 ctdb: Fix build on AIX via 05a908d ctdb-tests: Switch fake_ctdbd to use ctdb_get_peer_pid() via fa94a49 ctdb-common: Move capture_socket functions to ctdb_socket.[ch] via eafcc98 ctdb-common: Move ctdb_sys_send_tcp() to ctdb_socket.[ch] via 9c51b27 ctdb-common: Move ctdb_sys_send_arp() to ctdb_socket.[ch] via 1d7d804 ctdb-common: Move ctdb_get_peer_pid() to system.[ch] via 8fcd12b ctdb-common: Move ctdb_system_check_iface_exists() to system.[ch] via 2f0a4d2 ctdb-common: Move parse_ip_mask() to system_socket.[ch] via 57834c6 ctdb-common: Rename system utility files via f697c2e ctdb-build: Add ipv6 headers check for packet details via 14868df ctdb-build: Add checks for raw pkt handling support via 79992db ctdb-common: Use sin6_len only if the structure supports it via 7eeba9c replace: Add test for sin6_len in sockaddr_in6 structure from e84b502 ctdb-common: Correctly handle conf->reload() https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 0b4a071ed1817bbc5523b259ca41c62a9e9b1f0b Author: Martin Schwenke Date: Tue Jun 26 19:51:00 2018 +1000 ctdb-tests: Teach strace packet parser about non-octal escapes strace output also encodes characters 7 to 13 as \a, \b, \t, \n, \v, \f, \r. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Jul 2 11:30:29 CEST 2018 on sn-devel-144 commit 63255ef92552da92956c05160f33622d0bbc3a28 Author: Martin Schwenke Date: Tue Jun 26 20:12:23 2018 +1000 ctdb-daemon: Only consider client ID for local database attach The comment immediately above this code says "don't allow local clients to attach" and then looks up the client ID regardless of whether the request is local or remote. This means that an intentional remote attach from a client will not work correctly. No real client should ever do that since clients attach so they an access databases locally. Perhaps some sanity checks should be added. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13500 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit af446d5209e37a38363911e5f339869b73d87963 Author: Martin Schwenke Date: Fri Jun 15 06:07:54 2018 +1000 ctdb-docs: Fix the documentation for VNN map It is incorrectly says that nodes not in the VNN map can not be DMASTER. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 36938bfdd075a174daecb466085702adfe6a6c09 Author: Martin Schwenke Date: Fri Jun 15 06:01:52 2018 +1000 ctdb-server: Rename CTDB_BROADCAST_VNNMAP -> CTDB_BROADCAST_ACTIVE This broadcast is misnamed. Both places where this type of broadcast is used expect the broadcast to go to all active nodes. Make the corresponding change to the semantics in the daemon by sending to all active nodes. There is a mismatch between the ideas of VNN map and active nodes. A node that is not in the VNN map but is active can still host database records. These were the same until the LMASTER capability was introduced and then the logic was not updated. The only place where the VNN map is relevant is when finding
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e84b502 ctdb-common: Correctly handle conf->reload() from b6b1226 ctdb: Improve robust mutex test https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e84b5020a410b9c2cf736efee60ee704f8ea8f9c Author: Amitay Isaacs Date: Mon Jun 25 12:56:45 2018 +1000 ctdb-common: Correctly handle conf->reload() Configuration reload should reset the values of configuration options missing from the config file to default. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Jun 29 15:12:37 CEST 2018 on sn-devel-144 --- Summary of changes: ctdb/common/conf.c| 147 +- ctdb/tests/cunit/conf_test_001.sh | 48 - ctdb/tests/src/conf_test.c| 53 ++ 3 files changed, 226 insertions(+), 22 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/conf.c b/ctdb/common/conf.c index dccf661..3c1369e 100644 --- a/ctdb/common/conf.c +++ b/ctdb/common/conf.c @@ -161,6 +161,44 @@ static int conf_value_from_string(TALLOC_CTX *mem_ctx, return ret; } +static bool conf_value_compare(struct conf_value *old, struct conf_value *new) +{ + if (old == NULL || new == NULL) { + return false; + } + + if (old->type != new->type) { + return false; + } + + switch (old->type) { + case CONF_STRING: + if (old->data.string == NULL && new->data.string == NULL) { + return true; + } + if (old->data.string != NULL && new->data.string != NULL) { + if (strcmp(old->data.string, new->data.string) == 0) { + return true; + } + } + break; + + case CONF_INTEGER: + if (old->data.integer == new->data.integer) { + return true; + } + break; + + case CONF_BOOLEAN: + if (old->data.boolean == new->data.boolean) { + return true; + } + break; + } + + return false; +} + static int conf_value_copy(TALLOC_CTX *mem_ctx, struct conf_value *src, struct conf_value *dst) @@ -409,6 +447,12 @@ static bool conf_option_validate(struct conf_option *opt, return ret; } +static bool conf_option_same_value(struct conf_option *opt, + struct conf_value *new_value) +{ + return conf_value_compare(opt->value, new_value); +} + static int conf_option_new_value(struct conf_option *opt, struct conf_value *new_value, enum conf_update_mode mode) @@ -416,36 +460,56 @@ static int conf_option_new_value(struct conf_option *opt, int ret; bool ok; - ok = conf_option_validate(opt, new_value, mode); - if (!ok) { - D_ERR("conf: validation for option \"%s\" failed\n", - opt->name); - return EINVAL; + if (opt->new_value != &opt->default_value) { + TALLOC_FREE(opt->new_value); } - TALLOC_FREE(opt->new_value); - opt->new_value = talloc_zero(opt, struct conf_value); - if (opt->new_value == NULL) { - return ENOMEM; - } + if (new_value == &opt->default_value) { + /* +* This happens only during load/reload. Set the value to +* default value, so if the config option is dropped from +* config file, then it get's reset to default. +*/ + opt->new_value = &opt->default_value; + } else { + ok = conf_option_validate(opt, new_value, mode); + if (!ok) { + D_ERR("conf: validation for option \"%s\" failed\n", + opt->name); + return EINVAL; + } - opt->new_value->type = opt->value->type; - ret = conf_value_copy(opt, new_value, opt->new_value); - if (ret != 0) { - return ret; + opt->new_value = talloc_zero(opt, struct conf_value); + if (opt->new_value == NULL) { + return ENOMEM; + } + + opt->new_value->type = opt->value->type; + ret = conf_value_copy(opt, new_value, opt->new_value); +
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via fb3ddb4 ctdb-common: replace talloc / memcpy by talloc_memdup from 5e89a23 krb5_plugin: Add winbind localauth plugin for MIT Kerberos https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit fb3ddb48741e9e9699cf6efab70192a45f49573e Author: Swen Schillig Date: Wed Mar 7 14:40:33 2018 +0100 ctdb-common: replace talloc / memcpy by talloc_memdup Signed-off-by: Swen Schillig Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Jun 22 11:57:19 CEST 2018 on sn-devel-144 --- Summary of changes: ctdb/common/ctdb_io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index 3e732e8..c694124 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -117,12 +117,11 @@ static void queue_process(struct ctdb_queue *queue) } /* Extract complete packet */ - data = talloc_size(queue, pkt_size); + data = talloc_memdup(queue, queue->buffer.data, pkt_size); if (data == NULL) { - DEBUG(DEBUG_ERR, ("read error alloc failed for %u\n", pkt_size)); + D_ERR("read error alloc failed for %u\n", pkt_size); return; } - memcpy(data, queue->buffer.data, pkt_size); /* Shift packet out from buffer */ if (queue->buffer.length > pkt_size) { -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d445704 ctdb-daemon: CID 1435732: Argument cannot be negative via 366f670 ctdb-common: Add support to run events through failure via e4a5d61 ctdb-common: Reset running state on failure via 723529e ctdb-common: Improve error handling in run_event via a3591ed ctdb-common: Return script_list for zero scripts via 4d27c11 ctdb-common: Rename run_event_script_list to run_event_list via a883f8b ctdb-common: Do not initialize run_proc inside run_event via 4b04c27 ctdb-common: Simplify process registration using linked list from f2e8ab3 ctdb-tests: Continue running if a testcase is not executable https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d445704050630509208a74fb23297949a4dce779 Author: Swen Schillig Date: Fri May 25 08:23:17 2018 +0200 ctdb-daemon: CID 1435732: Argument cannot be negative Negative parameter passed to function which cannot take negative values. Signed-off-by: Swen Schillig Reviewed-by: Martin Schwenke Reviewed-by: Christof Schmitt Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Jun 6 01:13:18 CEST 2018 on sn-devel-144 commit 366f6703e7474f5b1c6b97b4d77b80897bdc5f69 Author: Amitay Isaacs Date: Thu May 17 13:32:37 2018 +1000 ctdb-common: Add support to run events through failure Usually run_event will stop executing event scripts on first failure. Optionally it can continue to run events even on failure(s). Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit e4a5d610b8e81c78b7d98217bc87c4b815b4c4e7 Author: Amitay Isaacs Date: Thu May 10 18:49:06 2018 +1000 ctdb-common: Reset running state on failure Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 723529e41e3af72f8f42a3a61192c3ef3b86861b Author: Amitay Isaacs Date: Thu May 10 16:50:35 2018 +1000 ctdb-common: Improve error handling in run_event If event script directory does not exist, then return ENOTDIR. If a directory gets removed at runtime, report error from scandir in get_script_list(). Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit a3591ed5de145df54cf29027273416876de1b774 Author: Amitay Isaacs Date: Thu May 10 12:43:24 2018 +1000 ctdb-common: Return script_list for zero scripts When an event script directory is empty, do not return script_list as NULL. Instead return empty script_list with zero scripts. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 4d27c11ce26bf835448862b6d901056125b5414f Author: Amitay Isaacs Date: Thu May 10 13:50:01 2018 +1000 ctdb-common: Rename run_event_script_list to run_event_list Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit a883f8b0920d68d2d3b923463de59384a4eb8e8f Author: Amitay Isaacs Date: Wed May 9 16:42:40 2018 +1000 ctdb-common: Do not initialize run_proc inside run_event Allowing run_event_init() to take run_proc_context as an argument allows to create multiple run_event instances with a single run_proc_context. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 4b04c27377e835a7bccbf2175e94da730374de81 Author: Amitay Isaacs Date: Wed May 9 14:07:35 2018 +1000 ctdb-common: Simplify process registration using linked list The way run_proc abstraction is used in run_event, there can be maximum of 2 processes active at any given time. So the memory requirements can be reduced by using a linked list. New eventd will have multiple run_event instances but will be limited to 3 or 4. Even then the total number of processes will be less than 10. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/common/run_event.c | 70 +--- ctdb/common/run_event.h | 12 +-- ctdb/common/run_proc.c | 181 +++- ctdb/server/ctdb_eventd.c | 18 +++- ctdb/server/ctdbd.c | 2 +- ctdb/tests/eventd/eventd_001.sh | 2 - ctdb/tests/eventd/eventd_002.sh | 2 - ctdb/tests/src/run_event_test.c | 19 - 8 files changed, 145 insertions(+), 161 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/run_event.c b/ctdb/common/run_event.c index b1b50ec..20e5be8 100644 --- a/ctdb/common/run_event.c +++ b/ctdb/common/run_event.c @@ -70,7 +70,6 @@ static int get_script_list(TALLOC_CTX *mem_ctx, script_dir, ret); } *out = NULL; - ret = 0; goto done; } @@ -272,7 +271,7 @@ struct run_event_context
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via fcda17c ctdb-tools: Add logging config options to config tool via 8f97c17 ctdb-common: Add config options for logging via 7ef8dbc ctdb-common: Add a function to validate logging specification via fec40ea ctdb-common: Refactor log backend parsing code via e96e1de ctdb-common: Add config options tool via 7025041 ctdb-common: Add config file parsing code via 77539b4 util: Add tini to samba-util-core via cb64a7c ctdb-tests: Setup $CTDB_BASE/{run,var} directories via b2eaaca ctdb-common: Add path tool via fe25aa7 ctdb-common: Add utility code to get various paths via 356dacc ctdb-common: Add command line processing abstraction via b72d5fc ctdb-packaging: Package all helpers using wildcard from 77ea31b devel: removing unused code from chgkrbtgtpass https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit fcda17cb42f3384c62d81903e364e8ddb4ce217d Author: Amitay Isaacs Date: Tue Apr 17 22:15:41 2018 +1000 ctdb-tools: Add logging config options to config tool Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sat May 12 15:01:32 CEST 2018 on sn-devel-144 commit 8f97c17df20af9f70b173d7ebb484197e2538587 Author: Martin Schwenke Date: Fri Dec 15 18:38:40 2017 +1100 ctdb-common: Add config options for logging Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 7ef8dbc7fc6f45d09f3813e5c61a4751c1f82a9d Author: Amitay Isaacs Date: Wed Apr 18 11:53:57 2018 +1000 ctdb-common: Add a function to validate logging specification Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit fec40ea544c5bf87c713a5e70a6997d3edd15a68 Author: Amitay Isaacs Date: Wed Apr 18 11:52:05 2018 +1000 ctdb-common: Refactor log backend parsing code This will allow to add a validator for logging specification. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit e96e1defbaf6d524c046b3aea90fe150c0fadcd9 Author: Amitay Isaacs Date: Fri Apr 27 17:21:00 2018 +1000 ctdb-common: Add config options tool Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 702504118f027bd75e959f4d16428758caf9a108 Author: Amitay Isaacs Date: Wed Dec 13 19:41:16 2017 +1100 ctdb-common: Add config file parsing code Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 77539b479e4c5ef52a7876f39b075b0f6f8ca7fd Author: Amitay Isaacs Date: Mon Mar 26 15:04:12 2018 +1100 util: Add tini to samba-util-core So it can be used by CTDB. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit cb64a7ca75fdacc0329326b05ae0049e77d02790 Author: Amitay Isaacs Date: Tue May 8 18:09:46 2018 +1000 ctdb-tests: Setup $CTDB_BASE/{run,var} directories Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit b2eaacaa149913f739c634b55f85c778f957258f Author: Amitay Isaacs Date: Tue May 8 13:23:15 2018 +1000 ctdb-common: Add path tool Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit fe25aa75386298b50192d91e57844cafe39ee571 Author: Amitay Isaacs Date: Tue May 8 13:02:33 2018 +1000 ctdb-common: Add utility code to get various paths This will construct correct paths when running with CTDB_TEST_MODE. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 356dacc6d701b6d4ffa91f20f208e0d09a4136e6 Author: Amitay Isaacs Date: Tue Apr 24 23:17:18 2018 +1000 ctdb-common: Add command line processing abstraction Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit b72d5fc7ba2014e3c37c94a3055a15d0124b45d3 Author: Amitay Isaacs Date: Tue May 8 16:03:54 2018 +1000 ctdb-packaging: Package all helpers using wildcard Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/common/cmdline.c | 517 ctdb/common/cmdline.h | 148 +++ ctdb/common/conf.c | 1259 ctdb/common/conf.h | 473 ctdb/common/conf_tool.c| 304 + .../conf_tool.h} | 25 +- ctdb/common/logging.c | 197 ++- ctdb/common/logging.h |1 + ctdb/common/logging_conf.c | 127 ++ .../logging_conf.h}| 26 +- ctdb/common/path.c | 179 +++ ctdb/{protocol/protocol_packet.c
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c6c67d9 ctdb-scripts: Remove function rewrite_ctdb_options() via 043f3f2 ctdb-scripts: Drop support for CTDB_DBDIR=tmpfs via eb7ec16 ctdb-daemon: Change default volatile database directory via 8ea7fa5 ctdb-tests: CTDB_DBDIR_PERSISTENT should not depend on CTDB_DBDIR via 051203e ctdb-scripts: Fix location of persistent databases via eba893f ctdb-tests: Fix location of persistent databases via 3459a15 ctdb-scripts: Drop UDP/file logging warning from ctdbd_wrapper via 9a5ba6b ctdb-daemon: Log the logging location when not logging via syslog() via 8821857 ctdb-scripts: Drop warning when there is no recovery lock via 79c49f6 ctdb-daemon: Reorder main() to improve the structure via 9623c92 ctdb-daemon: Consolidate basic CTDB context initialisation via 1b57487 ctdb-daemon: Drop duplicate initialisation of request ID context via 4eea531 ctdb-daemon: Move ctdb_init() to the only place it is used via f4fe768 ctdb-docs: Move remaining test options to README via 8a835ae ctdb-daemon: Drop ctdbd --torture and --valgrinding options via 32430f8 ctdb-scripts: Drop CTDB_VALGRIND testing option via 8c43ce7 ctdb-daemon: Drop ctdbd --sloppy-start and --nopublicipcheck options via 5081cec ctdb-tests: Make local daemon tests depend on CTDB_TEST_MODE via 3c7b766 ctdb-daemon: Add testing environment variable CTDB_TEST_MODE via 0349d65 ctdb-daemon: Drop ctdbd --notification-script command-line option via e5af067 ctdb-scripts: Drop CTDB_NOTIFY_SCRIPT configuration option via 7e9dd3f ctdb-tests: Ensure notify.sh is available to local daemons via ed80fc1 ctdb-daemon: Provide a default location for the notification script via 518be6d ctdb-daemon: Use a local variable instead of repeating getenv() via 7052f87 ctdb-daemon: Drop unused function ctdb_set_notification_script() via 17ad7d9 ctdb-daemon: Set ctdb->notification_script directly via f5ee088 ctdb-docs: Move some configuration options out of the debug section via cdd51df ctdb-docs: Move some ctdbd options out of the debug section via b3dc0dc ctdb-build: Rename ctdb-client2 subsystem to ctdb-client via e70fe41 ctdb-daemon: Move ctdb_client.c to server/ subdir via 45202d8 ctdb-build: Drop unnessary dependency on ctdb-client via 01c8dc7 ctdb-client: Remove ununsed functions from old client code from aefe444 ceph: VFS: Add asynchronous fsync to ceph module, fake using synchronous call. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c6c67d9ed29d863d74ad98d1d344797ad2e1db54 Author: Martin Schwenke Date: Thu Apr 19 21:57:07 2018 +1000 ctdb-scripts: Remove function rewrite_ctdb_options() This is no longer necessary after the removal of support for CTDB_DBDIR=tmpfs. File-local variable ctdb_rundir is no longer used, so drop it. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue May 1 16:20:37 CEST 2018 on sn-devel-144 commit 043f3f266a988dadbf2992800c198af6c4bc0569 Author: Martin Schwenke Date: Thu Apr 19 21:54:11 2018 +1000 ctdb-scripts: Drop support for CTDB_DBDIR=tmpfs CTDB has no business mounting filesystems. Instead, documentation for the new configuration system will include a recommendation that a tmpfs be mounted on the volatile database directory. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit eb7ec16a963e13e903171227b655dbbf7f2a4051 Author: Martin Schwenke Date: Thu Apr 26 11:58:13 2018 +1000 ctdb-daemon: Change default volatile database directory Volatile databases now have their own subdirectory. This makes things easier if we later recommend mounting a tmpfs on the volatile database directory, rather than supporting the current CTDB_DBDIR=tmpfs magic. No need to create database directories for local daemon tests. ctdbd will do that. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 8ea7fa57f4a82d7ebd6f8aa77fd8073b0196cb6e Author: Martin Schwenke Date: Mon Apr 30 20:44:36 2018 +1000 ctdb-tests: CTDB_DBDIR_PERSISTENT should not depend on CTDB_DBDIR Add new variable CTDB_DBDIR_BASE, just for event script unit tests. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 051203e1f80c1365e8f72fc3e819e6dda3aac4f2 Author: Martin Schwenke Date: Mon Apr 30 20:26:20 2018 +1000 ctdb-scripts: Fix location of persistent databases If CTDB_DBDIR_PERSISTENT is not set then set the default relative to CTDB_VARDIR. The persistent database directory is not (necessar
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b8f7f42 ctdb: Remove double sanity checks from ctdb_tcp_read_cb via c42c721 ctdb: Remove double sanity checks from ctdb_daemon_read_cb from f2df0e5 krb5_wrap: Fix CID 1414755 Resource leak https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b8f7f42565d35e20ba576db101bd5eb27f90e903 Author: Swen Schillig Date: Tue Mar 13 09:22:45 2018 +0100 ctdb: Remove double sanity checks from ctdb_tcp_read_cb Within ctdb_tcp_read_cb the provided data is checked for sanity, e.g. correct size and content. This is not required because it was done already by the caller(queue_process). Signed-off-by: Swen Schillig Reviewed-by: Martin Schwenke Reviewed-by: Jeremy Allison Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Apr 4 09:31:04 CEST 2018 on sn-devel-144 commit c42c721b980d87588513751c12f8bb9f88e28cd5 Author: Swen Schillig Date: Tue Mar 13 08:57:40 2018 +0100 ctdb: Remove double sanity checks from ctdb_daemon_read_cb Within ctdb_daemon_read_cb the provided data is checked for sanity, e.g. correct size and content. This is not required because it was done already by the caller (queue_process). Signed-off-by: Swen Schillig Reviewed-by: Martin Schwenke Reviewed-by: Jeremy Allison --- Summary of changes: ctdb/server/ctdb_daemon.c | 5 - ctdb/tcp/tcp_io.c | 7 --- 2 files changed, 12 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index 6d2f70f..3b06972 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -895,11 +895,6 @@ static void ctdb_daemon_read_cb(uint8_t *data, size_t cnt, void *args) return; } hdr = (struct ctdb_req_header *)data; - if (cnt != hdr->length) { - ctdb_set_error(client->ctdb, "Bad header length %u expected %u\n in daemon", - (unsigned)hdr->length, (unsigned)cnt); - return; - } if (hdr->ctdb_magic != CTDB_MAGIC) { ctdb_set_error(client->ctdb, "Non CTDB packet rejected\n"); diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c index 3c3b1c1..0eb8e25 100644 --- a/ctdb/tcp/tcp_io.c +++ b/ctdb/tcp/tcp_io.c @@ -56,13 +56,6 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args) goto failed; } - - if (cnt != hdr->length) { - DEBUG(DEBUG_ALERT,(__location__ " Bad header length %u expected %u\n", -(unsigned)hdr->length, (unsigned)cnt)); - goto failed; - } - if (hdr->ctdb_magic != CTDB_MAGIC) { DEBUG(DEBUG_ALERT,(__location__ " Non CTDB packet 0x%x rejected\n", hdr->ctdb_magic)); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 6b75d2c ctdb-scripts: Drop "net serverid wipe" from 50.samba event script from e8dba19 ctdb-server: Only set destructor if required https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 6b75d2c650aa9ee632122fa87ea8a2a98f1fa613 Author: Amitay Isaacs Date: Thu Mar 29 10:45:19 2018 +1100 ctdb-scripts: Drop "net serverid wipe" from 50.samba event script BUG: https://bugzilla.samba.org/show_bug.cgi?id=13359 There is no serverid database anymore. Signed-off-by: Amitay Isaacs Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sat Mar 31 08:34:00 CEST 2018 on sn-devel-144 --- Summary of changes: ctdb/config/events.d/50.samba | 2 -- 1 file changed, 2 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events.d/50.samba index 784d62c..f65f53a 100755 --- a/ctdb/config/events.d/50.samba +++ b/ctdb/config/events.d/50.samba @@ -51,8 +51,6 @@ service_start () # start Samba service. Start it reniced, as under very heavy load # the number of smbd processes will mean that it leaves few cycles # for anything else -net serverid wipe - if [ -n "$CTDB_SERVICE_NMB" ] ; then nice_service "$CTDB_SERVICE_NMB" start || die "Failed to start nmbd" fi -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 9e954bc ctdb-tests: Don't use nc -d or -w options via bd66445 Revert "ctdb-doc: Fix monitoring bug in example NFS Ganesha call-out" via 98bd5b6 ctdb-tests: Depend on setup_ctdb_base() to install events.d/ via 8559848 ctdb-tests: Make fake ssh script set CTDB_BASE via a7a5216 ctdb-tests: Use setup_ctdb_base() for simple tests via caf6b1c ctdb-tests: Reindent setup_ctdb() function via 670668f ctdb-tests: Clean up nodes and public address file setup via 2b09dc9 ctdb-tests: Use SIMPLE_TESTS_VAR_DIR for data for local daemons tests via ee9051b ctdb-tests: New directory for simple test state via 2b38b82 ctdb-tests: Use setup_ctdb_base() for onnode unit tests via 258e1e0 ctdb-tests: Use setup_ctdb_base() for eventscript unit tests via b1c87b2 ctdb-tests: Factor out setup of fake CTDB_BASE via 52cdb03 ctdb-scripts: Drop PID file argument from wrapper via b0d892b ctdb-daemon: CTDB_PIDFILE environment variable overrides default via 6a54738 ctdb-daemon: Provide default location for ctdbd PID file via a2c6c98 ctdb-scripts: Drop init script PID directory backward compatibility via 0e5d537 ctdb-scripts: Don't create directory for PID file via 9fe85f4 ctdb-packaging: Package up relevant /var subdirectories via bf250fe ctdb-scripts: Drop unnecessary complexity from wrapper via a821306 ctdb-scripts: Drop broken wrapper code that uses PID via 914c877 ctdb-tests: Rework simple tests daemon start/stop via 5a99835 ctdb-packaging: Use RPM's local state directory via b416ed7 ctdb-scripts: Simplify the names of NFS fail counter files via bcadab7 ctdb-scripts: Move failure counters to the service state directory via e6aae12 ctdb-scripts: Move the reconfigure flag to the script state directory via ef0962a ctdb-scripts: Drop unused function ctdb_setup_service_state_dir() via eed0e3f ctdb-scripts: Use ctdb_setup_state_dir() via fac6d23 ctdb-scripts: Factor out function ctdb_setup_state_dir() via 2089961 ctdb-scripts: Move script state to its own directory via ba71230 ctdb-tools: Fix documentation for ctdb ping command via 8053f65 ctdb-tools: Event script commands cannot be run without daemon via 53c550d ctdb-common: Drop unused function ctdb_sys_find_ifname() via efe3a72 ctdb-tools: Drop ipiface command from ctdb tool via 35cc786 ctdb-tools: Wait for ctdb daemon to go away in shutdown via 376e979 ctdb-client: Client code should never free the client context via f70164d ctdb-ib: Avoid fall through case statements from f0bebcc ldb_tdb: Remove unnecessary call to tdb_get_seqnum https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 9e954bcbf43d67a18ee55f84cda0b09028f96b92 Author: Martin Schwenke Date: Thu Mar 8 11:49:56 2018 +1100 ctdb-tests: Don't use nc -d or -w options nmap-ncat is used in some distributions to replace netcat. It has a different meaning for these options. We can get the same effect as the current combination of -d and -w by piping a sleep process to nc. Subsequent use of $! works because it gets the last process in pipeline. Note that redirecting from /dev/null doesn't work with some versions of nc. They just exit when they get EOF. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Mar 9 12:24:13 CET 2018 on sn-devel-144 commit bd66445eddd1273da034df703f6aba7864e8e542 Author: Martin Schwenke Date: Wed Jan 31 17:07:46 2018 +1100 Revert "ctdb-doc: Fix monitoring bug in example NFS Ganesha call-out" The check action should be there. It is used by 20.nfs_ganesha.check. This reverts commit 4fa9026bbd9f67348d3203e0205c59ff4fb51d2d. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 98bd5b6a41f656802d075c50be7c5b766333080c Author: Martin Schwenke Date: Fri Feb 16 14:27:39 2018 +1100 ctdb-tests: Depend on setup_ctdb_base() to install events.d/ This directory is only used by simple tests when running against local daemons. Moving it to simple/etc-ctdb/events.d/ means that it is automatically copied by setup_ctdb_base(). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 85598480fbb3a994b853bcd44438d6da85d8f4f3 Author: Martin Schwenke Date: Fri Mar 2 20:36:39 2018 +1100 ctdb-tests: Make fake ssh script set CTDB_BASE The local daemons code puts the socket in the CTDB_BASE directory. This means CTDB_NODES_SOCKETS can be replaced by CTDB_BASES, a list of base directories.
[SCM] Samba Website Repository - branch master updated
The branch, master has been updated via eb22034 team: Update URL for my home page from c79d765 NEWS[4.8.0rc4]: Samba 4.8.0rc4 Available for Download https://git.samba.org/?p=samba-web.git;a=shortlog;h=master - Log - commit eb22034fb1c547343ff5a3b6c199ee2bd048aafc Author: Martin Schwenke Date: Fri Mar 9 20:11:49 2018 +1100 team: Update URL for my home page I dropped the subdomain some time ago. Signed-off-by: Martin Schwenke --- Summary of changes: team/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/team/index.html b/team/index.html index 790f115..07d6a59 100755 --- a/team/index.html +++ b/team/index.html @@ -90,7 +90,7 @@ mailing list and start contributing to the development of Samba. Garming Sam (http://catalyst.net.nz/what-we-offer/enterprise-solutions/samba";>Catalyst) mailto:c...@samba.org";>Christof Schmitt https://www.samba.org/~asn/";>Andreas Schneider (https://www.redhat.com/";>Red Hat) -http://martin.meltin.net/";>Martin Schwenke +https://meltin.net/martin/";>Martin Schwenke mailto:ksee...@samba.org";>Karolin Seeger (https://www.sernet.de/en/";>SerNet) http://www.richardsharpe.com";>Richard Sharpe mailto:i...@samba.org";>Simo Sorce (https://www.redhat.com/";>Red Hat) -- Samba Website Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 426e4a5 ctdb-pmda: Use modified API in pcp library 4.0 via 4bb8a62 ctdb-tests: Generalise SM_NOTIFY output format in statd-callout tests via 95888c8 ctdb-scripts: Clean up statd-callout via 11c4bb1 ctdb-tests: Exit on statd-callout sub-test failure via 2ad1604 ctdb-scripts: Avoid no-op "ctdb ptrans" call via 9a12d6a ctdb-tools: Reindent parts of onnode via 8f9ac94 ctdb-tools: Remove test hooks from onnode via 53fea36 ctdb-tests: Use fake ssh script for onnode in local daemons tests via d1ff946 ctdb-tests: Add fake ssh command for local daemons tests via 254a184 ctdb-tools: Revisit stray file descriptor avoidance in onnode via 248c374 ctdb-tools: Introduce a variable to hold the ssh command via 9260ca2 ctdb-tools: Change onnode to use ONNODE_SSH and ONNODE_SSH_OPTS via ca31520 ctdb-common: Drop debugging variable CTDB_EXTERNAL_TRACE via 86f6481 ctdb-tests: Avoid creating files in /tmp. via e0e6e40 ctdb-tests: Check for errors when adding stubs/ subdirectory to PATH via 99350c1 ctdb-tests: Clean up PATH setting for stubs/ subdirectory via 5537b36 ctdb-tests: Drop unneccessary unset of variable via bb03532 ctdb-tests: Use consistent NAT gateway nodes file via 1c2361a ctdb-tests: Fix a double-typo bug via c8dfd4f ctdb-scripts: Add default for public addresses file where missing via 0519c51 ctdb-scripts: Do not use ctdb_service_reconfigure() for policy routing via 61a0ae9 ctdb-packaging: Package event scripts via a wildcard via 1e18edc ctdb-packaging: Make the ctdb package own more directories from 33fa677 wafsamba: Build with -Wimplicit-fallthrough if supported https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 426e4a5a20cff73a80d80b46f15826deac3f934f Author: Amitay Isaacs Date: Thu Mar 1 12:32:26 2018 +1100 ctdb-pmda: Use modified API in pcp library 4.0 Support backward compatibility by checking for __pmID_int type, which was previously in . In the new version, this type is not defined anymore and there is no need to include . Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Mar 2 00:38:52 CET 2018 on sn-devel-144 commit 4bb8a6222a7b24c8877aa8a799d6b10187f8259f Author: Martin Schwenke Date: Thu Mar 2 21:55:54 2017 +1100 ctdb-tests: Generalise SM_NOTIFY output format in statd-callout tests Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 95888c8e1a491ef58333714fe545d5651d05cc1a Author: Martin Schwenke Date: Thu Mar 2 16:43:51 2017 +1100 ctdb-scripts: Clean up statd-callout This means there will be 2 loops reading the data but the code flow is much more obvious. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 11c4bb110bad2a2ca213f1703a5a1408705ae0d8 Author: Martin Schwenke Date: Thu Mar 2 21:35:03 2017 +1100 ctdb-tests: Exit on statd-callout sub-test failure Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 2ad1604c2baa547ad881dc75cbb47722d0af651b Author: Martin Schwenke Date: Wed Jan 4 09:53:54 2017 +1100 ctdb-scripts: Avoid no-op "ctdb ptrans" call This causes unnecessary g_lock activity and overhead. This could be optimised in ctdb.c:control_ptrans(). However, that makes the code more complex. Let's only do that if we get more potentially no-op uses. Note no optimisation is needed in the "notify" case because there is already an early exit if there are no items. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 9a12d6af0553207809ad1e882df25fbcb00c22a2 Author: Martin Schwenke Date: Tue Feb 27 13:59:50 2018 +1100 ctdb-tools: Reindent parts of onnode No functional changes. Best viewed with diff/show -w to avoid whitespace differences. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 8f9ac941902c587b9920e1ff4be77d6d4e3bbe4b Author: Martin Schwenke Date: Wed Feb 28 15:11:56 2018 +1100 ctdb-tools: Remove test hooks from onnode CTDB_NODES_SOCKETS is no longer used. The test code uses ONNODE_SSH to run a fake ssh client. Leave indenting sloppy and fix it in the next commit so that this change is clear. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 53fea36b6e2dd8b44bbe6e011208cabfd21d1a58 Author: Martin Schwenke Date: Tue Feb 27 12:13:37 2018 +1100 ctdb-tests: Use fake ssh script for onnode in local daemons tests Signed-off-by: Martin Schwenke
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 32d867c ctdb-common: Optimize sock_queue's memory managament via eae2d35 ctdb-common: Remove sock_queue_destructor via f9150c5 ctdb-common: Return if packet size is zero from 0766f06 libcli: Remove finddcs_nbt.c https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 32d867cf09a15626b991be414ab6440f68953f35 Author: Swen Schillig Date: Mon Jan 8 14:55:31 2018 +0100 ctdb-common: Optimize sock_queue's memory managament Make use of talloc pools for the sock_queue's memory requirements. Signed-off-by: Swen Schillig Reviewed-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Jan 30 18:12:32 CET 2018 on sn-devel-144 commit eae2d35fec071b020f420ba74ac6551c84140a4d Author: Swen Schillig Date: Mon Jan 8 14:13:46 2018 +0100 ctdb-common: Remove sock_queue_destructor The sock_queue_destructor is not needed. The performed tasks will be performed automatically. Signed-off-by: Swen Schillig Reviewed-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit f9150c5fa0ac81a848dbb6978a73c10170648d5b Author: Swen Schillig Date: Mon Jan 8 14:10:40 2018 +0100 ctdb-common: Return if packet size is zero Prevent further processing of sock_queue_process if the received packet size is zero. Signed-off-by: Swen Schillig Reviewed-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/common/sock_io.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/sock_io.c b/ctdb/common/sock_io.c index 3f7138f..51341ce 100644 --- a/ctdb/common/sock_io.c +++ b/ctdb/common/sock_io.c @@ -94,8 +94,18 @@ struct sock_queue { size_t buflen, begin, end; }; +/* + * The reserved talloc headers, SOCK_QUEUE_OBJ_COUNT, + * and the pre-allocated pool-memory SOCK_QUEUE_POOL_SIZE, + * are used for the sub-objects queue->im, queue->queue, queue->fde + * and queue->buf. + * If the memory allocating sub-objects of struct sock_queue change, + * those values need to be adjusted. + */ +#define SOCK_QUEUE_OBJ_COUNT 4 +#define SOCK_QUEUE_POOL_SIZE 2048 + static bool sock_queue_set_fd(struct sock_queue *queue, int fd); -static int sock_queue_destructor(struct sock_queue *queue); static void sock_queue_handler(struct tevent_context *ev, struct tevent_fd *fde, uint16_t flags, void *private_data); @@ -112,10 +122,12 @@ struct sock_queue *sock_queue_setup(TALLOC_CTX *mem_ctx, { struct sock_queue *queue; - queue = talloc_zero(mem_ctx, struct sock_queue); + queue = talloc_pooled_object(mem_ctx, struct sock_queue, +SOCK_QUEUE_OBJ_COUNT, SOCK_QUEUE_POOL_SIZE); if (queue == NULL) { return NULL; } + memset(queue, 0, sizeof(struct sock_queue)); queue->ev = ev; queue->callback = callback; @@ -138,8 +150,6 @@ struct sock_queue *sock_queue_setup(TALLOC_CTX *mem_ctx, return NULL; } - talloc_set_destructor(queue, sock_queue_destructor); - return queue; } @@ -168,14 +178,6 @@ static bool sock_queue_set_fd(struct sock_queue *queue, int fd) return true; } -static int sock_queue_destructor(struct sock_queue *queue) -{ - TALLOC_FREE(queue->fde); - queue->fd = -1; - - return 0; -} - static void sock_queue_handler(struct tevent_context *ev, struct tevent_fd *fde, uint16_t flags, void *private_data) @@ -231,6 +233,7 @@ static void sock_queue_process(struct sock_queue *queue) if (pkt_size == 0) { D_ERR("Invalid packet of length 0\n"); queue->callback(NULL, 0, queue->private_data); + return; } if ((queue->end - queue->begin) < pkt_size) { -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 9daf40c talloc: Fix documentation typo via 33c0f55 ctdb-tests: Avoid race condition in sock_daemon test 5 from ac9d528 docs: Remove prog_guide4.txt https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 9daf40c55af61081abca663c7250f103d5b2a0df Author: Martin Schwenke Date: Thu Jan 18 16:08:15 2018 +1100 talloc: Fix documentation typo Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Jan 22 11:11:38 CET 2018 on sn-devel-144 commit 33c0f5599d93a34619c8f37945f79a6e399a1b5e Author: Amitay Isaacs Date: Mon Jan 22 12:54:49 2018 +1100 ctdb-tests: Avoid race condition in sock_daemon test 5 This test fails when it takes more than 10s to run. This can occur when the system is loaded and socket-wrapper is used. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/tests/src/sock_daemon_test.c | 26 +- lib/talloc/talloc.h | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/tests/src/sock_daemon_test.c b/ctdb/tests/src/sock_daemon_test.c index 5641d37..ebc0b85 100644 --- a/ctdb/tests/src/sock_daemon_test.c +++ b/ctdb/tests/src/sock_daemon_test.c @@ -668,7 +668,8 @@ static void test4(TALLOC_CTX *mem_ctx, const char *pidfile, * Start daemon, multiple client connects, requests, disconnects */ -#define TEST5_MAX_CLIENTS 10 +#define TEST5_VALID_CLIENTS10 +#define TEST5_MAX_CLIENTS 100 struct test5_pkt { uint32_t len; @@ -710,7 +711,8 @@ static void test5_client_callback(uint8_t *buf, size_t buflen, state->done = true; } -static int test5_client(const char *sockpath, int id) +static int test5_client(const char *sockpath, int id, pid_t pid_server, + pid_t *client_pid) { pid_t pid; int fd[2]; @@ -760,7 +762,9 @@ static int test5_client(const char *sockpath, int id) close(fd[0]); state.fd = -1; - sleep(10); + while (kill(pid_server, 0) == 0 || errno != ESRCH) { + sleep(1); + } exit(0); } @@ -775,6 +779,7 @@ static int test5_client(const char *sockpath, int id) close(fd[0]); + *client_pid = pid; return ret; } @@ -788,12 +793,12 @@ static bool test5_connect(struct sock_client_context *client, struct test5_server_state *state = (struct test5_server_state *)private_data; - if (state->num_clients == TEST5_MAX_CLIENTS) { + if (state->num_clients == TEST5_VALID_CLIENTS) { return false; } state->num_clients += 1; - assert(state->num_clients <= TEST5_MAX_CLIENTS); + assert(state->num_clients <= TEST5_VALID_CLIENTS); return true; } @@ -925,6 +930,7 @@ static void test5(TALLOC_CTX *mem_ctx, const char *pidfile, pid_t pid_server, pid; int fd[2], ret, i; ssize_t n; + pid_t client_pid[TEST5_MAX_CLIENTS]; pid = getpid(); @@ -968,16 +974,18 @@ static void test5(TALLOC_CTX *mem_ctx, const char *pidfile, close(fd[0]); - for (i=0; i<100; i++) { - ret = test5_client(sockpath, i); - if (i < TEST5_MAX_CLIENTS) { + for (i=0; i=0; i--) { + kill(client_pid[i], SIGKILL); + pid = wait(&ret); assert(pid != -1); } diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h index 618430a..dda308d 100644 --- a/lib/talloc/talloc.h +++ b/lib/talloc/talloc.h @@ -1226,7 +1226,7 @@ size_t talloc_array_length(const void *ctx); * * @code * ptr = talloc_array(ctx, type, count); - * if (ptr) memset(ptr, sizeof(type) * count); + * if (ptr) memset(ptr, 0, sizeof(type) * count); * @endcode */ void *talloc_zero_array(const void *ctx, #type, unsigned count); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ac9d528 docs: Remove prog_guide4.txt via c6999a2 vfs_fileid: Fix the 32-bit build via 3904c26 Added smbc_SetConfiguration which lets the user set the smb.conf for libsmbclient code from 7c1c8c6 mit-kdb: support MIT Kerberos 1.16 KDB API changes https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ac9d528b823aa89b3f3144f9377cc540f4b692e4 Author: Volker Lendecke Date: Thu Jan 18 10:57:23 2018 +0100 docs: Remove prog_guide4.txt Move the still relevant parts elsewhere Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Sun Jan 21 11:48:01 CET 2018 on sn-devel-144 commit c6999a248ad78f75cbfcc0f461298021b20905b4 Author: Volker Lendecke Date: Fri Jan 19 12:15:58 2018 + vfs_fileid: Fix the 32-bit build Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison commit 3904c26ac860038518d4ffae781ddbbf23746715 Author: Puran Chand Date: Wed Jan 10 13:13:44 2018 +0530 Added smbc_SetConfiguration which lets the user set the smb.conf for libsmbclient code BUG: https://bugzilla.samba.org/show_bug.cgi?id=13229 Signed-off-by: Puran Chand Reviewed-by: Jeremy Allison Reviewed-by: Andrew Bartlett --- Summary of changes: librpc/binding-strings.txt | 55 ++ prog_guide4.txt| 777 - source3/include/libsmbclient.h | 4 + .../{smbclient-0.3.1.sigs => smbclient-0.3.2.sigs} | 1 + source3/libsmb/libsmb_setget.c | 15 + source3/libsmb/wscript | 2 +- source3/modules/vfs_fileid.c | 4 +- source3/selftest/tests.py | 3 + source4/rpc_server/dcerpc_server.h | 26 + source4/selftest/tests.py | 3 +- source4/torture/libsmbclient/libsmbclient.c| 65 ++ testdata/samba3/smb_new.conf | 7 + 12 files changed, 181 insertions(+), 781 deletions(-) create mode 100644 librpc/binding-strings.txt delete mode 100644 prog_guide4.txt copy source3/libsmb/ABI/{smbclient-0.3.1.sigs => smbclient-0.3.2.sigs} (99%) create mode 100644 testdata/samba3/smb_new.conf Changeset truncated at 500 lines: diff --git a/librpc/binding-strings.txt b/librpc/binding-strings.txt new file mode 100644 index 000..5503da1 --- /dev/null +++ b/librpc/binding-strings.txt @@ -0,0 +1,55 @@ +DCERPC binding strings +-- + +When connecting to a dcerpc service you need to specify a binding +string. + +The format is: + + TRANSPORT:host[flags] + +where TRANSPORT is either ncacn_np for SMB or ncacn_ip_tcp for RPC/TCP + +"host" is an IP or hostname or netbios name. If the binding string +identifies the server side of an endpoint, "host" may be an empty +string. + +"flags" can include a SMB pipe name if using the ncacn_np transport or +a TCP port number if using the ncacn_ip_tcp transport, otherwise they +will be auto-determined. + +other recognised flags are: + + sign : enable ntlmssp signing + seal : enable ntlmssp sealing + spnego: use SPNEGO instead of NTLMSSP authentication + krb5 : use KRB5 instead of NTLMSSP authentication + connect : enable rpc connect level auth (auth, but no sign or seal) + validate : enable the NDR validator + print : enable debugging of the packets + bigendian : use bigendian RPC + padcheck : check reply data for non-zero pad bytes + + +Here are some examples: + + ncacn_np:myserver + ncacn_np:myserver[samr] + ncacn_np:myserver[\pipe\samr] + ncacn_np:myserver[/pipe/samr] + ncacn_np:myserver[samr,sign,print] + ncacn_np:myserver[sign,spnego] + ncacn_np:myserver[\pipe\samr,sign,seal,bigendian] + ncacn_np:myserver[/pipe/samr,seal,validate] + ncacn_np: + ncacn_np:[/pipe/samr] + ncacn_ip_tcp:myserver + ncacn_ip_tcp:myserver[1024] + ncacn_ip_tcp:myserver[sign,seal] + ncacn_ip_tcp:myserver[spnego,seal] + + +IDEA: Maybe extend UNC names like this? + + smbclient //server/share + smbclient //server/share[sign,seal,spnego] diff --git a/prog_guide4.txt b/prog_guide4.txt deleted file mode 100644 index 0a33284..000 --- a/prog_guide4.txt +++ /dev/null @@ -1,777 +0,0 @@ - - -THIS IS INCOMPLETE! I'M ONLY COMMITING IT IN ORDER TO SOLICIT COMMENTS -FROM A FEW PEOPLE. DON'T TAKE THIS AS THE FINAL VERSION YET. - - -Samba4 Programming Guide - - -.. contents:: - -The internals of Samba4 are quite different from previous versions of -Samba, so even if you are an experienced Samba developer please take -the time to read through this document
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 9f4eda9 selftest: Fix copyright header on samba.dsdb_lock via de3f0d8 ctdb-recovery-helper: Deregister message handler in error paths via cb5e6e8 ctdb-client: Add async version for ctdb_client_init() via 43145c8 ctdb-common: Avoid using void ** argument via 495cc4e ctdb-build: Apply dependency to correct subsystem from 2a8b507 selftest: Add cleanup of ForeignSecurityPrincipal in samba.dsdb test https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 9f4eda9c24ff4c051002080e862757b69c09b175 Author: Andrew Bartlett Date: Wed Dec 6 14:31:54 2017 +1300 selftest: Fix copyright header on samba.dsdb_lock BUG: https://bugzilla.samba.org/show_bug.cgi?id=13178 Signed-off-by: Andrew Bartlett Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Dec 13 13:03:16 CET 2017 on sn-devel-144 commit de3f0d889b3667eb165ab1004fdfff3a05046110 Author: Amitay Isaacs Date: Wed Dec 13 16:12:09 2017 +1100 ctdb-recovery-helper: Deregister message handler in error paths BUG: https://bugzilla.samba.org/show_bug.cgi?id=13188 If PULL_DB control times out but the remote node is still sending the data, then the tevent_req for pull_database_send will be freed without removing the message handler. So when the data is received, srvid handler will be called and it will try to access tevent_req which will result in use-after-free and abort. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit cb5e6e8c798b19610dfaa505fdfc5b2cab3fa19b Author: Amitay Isaacs Date: Tue Nov 28 21:17:37 2017 +1100 ctdb-client: Add async version for ctdb_client_init() Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 43145c88fe75d57ff66ea95d9db0ce503a2e8c03 Author: Amitay Isaacs Date: Thu Nov 9 16:37:15 2017 +1100 ctdb-common: Avoid using void ** argument Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 495cc4ed2255b334fa6fa75424add7c43575ab74 Author: Amitay Isaacs Date: Thu Nov 2 17:33:19 2017 +1100 ctdb-build: Apply dependency to correct subsystem Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/client/client.h | 27 - ctdb/client/client_connect.c | 205 + ctdb/common/sock_client.c | 4 +- ctdb/common/sock_client.h | 2 +- ctdb/server/ctdb_recovery_helper.c | 16 ++- ctdb/wscript | 4 +- python/samba/tests/dsdb_lock.py| 4 +- 7 files changed, 185 insertions(+), 77 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/client/client.h b/ctdb/client/client.h index 5be54b2..e792047 100644 --- a/ctdb/client/client.h +++ b/ctdb/client/client.h @@ -83,7 +83,7 @@ typedef void (*ctdb_tunnel_callback_func_t)(struct ctdb_tunnel_context *tctx, void *private_data); /** - * @brief Initialize and connect to ctdb daemon + * @brief Async computation start to initialize a connection to ctdb daemon * * This returns a ctdb client context. Freeing this context will free the * connection to ctdb daemon and any memory associated with it. @@ -102,6 +102,31 @@ typedef void (*ctdb_tunnel_callback_func_t)(struct ctdb_tunnel_context *tctx, * @param[in] mem_ctx Talloc memory context * @param[in] ev Tevent context * @param[in] sockpath Path to ctdb daemon unix domain socket + * @return new tevent request, NULL on failure + */ +struct tevent_req *ctdb_client_init_send(TALLOC_CTX *mem_ctx, +struct tevent_context *ev, +const char *sockpath); + +/** + * @brief Async computation end to initialize a connection to ctdb daemon + * + * @param[in] req Tevent request + * @param[out] perr errno in case of failure + * @param[in] mem_ctx Talloc memory context + * @param[out] result The new ctdb client context + * @return true on success, false on failure + */ +bool ctdb_client_init_recv(struct tevent_req *req, int *perr, + TALLOC_CTX *mem_ctx, + struct ctdb_client_context **result); + +/** + * @brief Sync wrapper to initialize ctdb connection + * + * @param[in] mem_ctx Talloc memory context + * @param[in] ev Tevent context + * @param[in] sockpath Path to ctdb daemon unix domain socket * @param[out] result The new ctdb client context * @return 0 on succcess, errno on failure */ diff --git a/ctdb/client/client_connect.c b/ctdb/client/client_connect.c index ed4371f..89a602d 100644 --- a/ctdb/client/client_connect.c +++ b/ctdb/client/client_connect.c @@ -40,58
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d7a5cd5 ctdb-daemon: Send STARTUP control after startup event via 73e261b ctdb-takeover: Send tcp tickles immediately on STARTUP control via 2b253f6 ctdb-takeover: Refactor code to send tickle lists for all public IPs from 27bb881 selftest: mark samba3.smb2.kernel-oplocks as flapping https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d7a5cd589b7b16d625dbc64dac21a1384519e32b Author: Amitay Isaacs Date: Mon Nov 20 15:27:52 2017 +1100 ctdb-daemon: Send STARTUP control after startup event BUG: https://bugzilla.samba.org/show_bug.cgi?id=13154 STARTUP control is primarily used to synchronise tcp tickles from running nodes to a node which has just started up. Earlier STARTUP control was sent (using BROADCAST_ALL) after setup event. Once the other nodes in the cluster connected to this node, the queued up messages would be sent and the tcp tickles would get synchronised. Recent fix to drop messages to disconnected or not-yet-connected nodes, the STARTUP control was never sent to the remote nodes and the tcp tickles did not get synchronised. To fix this problem send the STARTUP control (using BROADCAST_CONNECTED) after startup event. By this time all the running nodes in the cluster are connected. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Nov 30 15:29:48 CET 2017 on sn-devel-144 commit 73e261b48c4abc91e00775ac7437752c9640e5bd Author: Amitay Isaacs Date: Mon Nov 20 15:37:39 2017 +1100 ctdb-takeover: Send tcp tickles immediately on STARTUP control BUG: https://bugzilla.samba.org/show_bug.cgi?id=13154 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 2b253f6b1bc4e765f3fcb614a3b67b14084a625d Author: Amitay Isaacs Date: Mon Nov 20 15:17:15 2017 +1100 ctdb-takeover: Refactor code to send tickle lists for all public IPs BUG: https://bugzilla.samba.org/show_bug.cgi?id=13154 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/server/ctdb_daemon.c | 6 - ctdb/server/ctdb_monitor.c | 6 + ctdb/server/ctdb_takeover.c | 59 ++--- 3 files changed, 40 insertions(+), 31 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index aa2c92e..459dd29 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -1088,12 +1088,6 @@ static void ctdb_setup_event_callback(struct ctdb_context *ctdb, int status, } ctdb_run_notification_script(ctdb, "setup"); - /* tell all other nodes we've just started up */ - ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, -0, CTDB_CONTROL_STARTUP, 0, -CTDB_CTRL_FLAG_NOREPLY, -tdb_null, NULL, NULL); - /* Start the recovery daemon */ if (ctdb_start_recoverd(ctdb) != 0) { DEBUG(DEBUG_ALERT,("Failed to start recovery daemon\n")); diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c index 2ecbbb3..0a77665 100644 --- a/ctdb/server/ctdb_monitor.c +++ b/ctdb/server/ctdb_monitor.c @@ -240,6 +240,12 @@ static void ctdb_startup_callback(struct ctdb_context *ctdb, int status, void *p ctdb->monitor->next_interval = 2; ctdb_run_notification_script(ctdb, "startup"); + /* tell all other nodes we've just started up */ + ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_CONNECTED, +0, CTDB_CONTROL_STARTUP, 0, +CTDB_CTRL_FLAG_NOREPLY, +tdb_null, NULL, NULL); + tevent_add_timer(ctdb->ev, ctdb->monitor->monitor_context, timeval_current_ofs(ctdb->monitor->next_interval, 0), ctdb_check_health, ctdb); diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index 5e8aabf..cd24087 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -1483,24 +1483,23 @@ int32_t ctdb_control_tcp_remove(struct ctdb_context *ctdb, TDB_DATA indata) } +static void ctdb_send_set_tcp_tickles_for_all(struct ctdb_context *ctdb, + bool force); + /* Called when another daemon starts - causes all tickles for all public addresses we are serving to be sent to the new node on the - next check. This actually causes the next scheduled call to - tdb_update_tcp_tickles() to update all nodes. This is s
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via aace1f8 lib: Fix a typo from 6f8e3f7 python:tests: Create a test user for the dsdb test https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit aace1f83459c8e2f727c5d9422b7ac964afbac17 Author: Volker Lendecke Date: Fri Nov 24 17:00:05 2017 +0100 lib: Fix a typo Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Nov 27 04:51:59 CET 2017 on sn-devel-144 --- Summary of changes: source3/lib/ctdbd_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 521e016..9832dfa 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -1371,7 +1371,7 @@ static struct tevent_req *ctdb_pkt_send_send(TALLOC_CTX *mem_ctx, } /* -* Attempt a direct write. If this returns short, shedule the +* Attempt a direct write. If this returns short, schedule the * remaining data as an async write, otherwise we're already done. */ -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f026314 ctdb-eventd: Simplify eventd code via ada9e95 ctdb-common: Add special monitor handling to run_event abstraction via c19fc7c ctdb-tests: Make sure child processes are waited on after termination from 926e7a7 lib/replace: apply readline -Wstrict-prototypes workaround https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f026314661a76f9892f79da970810fe3fe040c8e Author: Amitay Isaacs Date: Wed Nov 8 20:09:59 2017 +1100 ctdb-eventd: Simplify eventd code Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Nov 24 15:49:46 CET 2017 on sn-devel-144 commit ada9e95c1bda5995d87b0e2830bcf1a935bcfc4a Author: Amitay Isaacs Date: Wed Nov 8 19:31:05 2017 +1100 ctdb-common: Add special monitor handling to run_event abstraction Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit c19fc7c9cc94dcf708a3ad0e417304a9d5c965ff Author: Amitay Isaacs Date: Wed Nov 22 11:08:14 2017 +1100 ctdb-tests: Make sure child processes are waited on after termination Looks like the if a process holding fcntl lock (on pid file) is killed, then the lock is not released till the process is reaped using either wait() or waitpid(). Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/common/run_event.c | 145 +++--- ctdb/server/ctdb_eventd.c | 183 -- ctdb/tests/src/sock_daemon_test.c | 13 ++- 3 files changed, 163 insertions(+), 178 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/run_event.c b/ctdb/common/run_event.c index 0961d65..e230b12 100644 --- a/ctdb/common/run_event.c +++ b/ctdb/common/run_event.c @@ -271,6 +271,10 @@ struct run_event_context { const char *script_dir; const char *debug_prog; bool debug_running; + + struct tevent_queue *queue; + struct tevent_req *current_req; + bool monitor_running; }; @@ -321,6 +325,14 @@ int run_event_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev, run_ctx->debug_running = false; + run_ctx->queue = tevent_queue_create(run_ctx, "run event queue"); + if (run_ctx->queue == NULL) { + talloc_free(run_ctx); + return ENOMEM; + } + + run_ctx->monitor_running = false; + *out = run_ctx; return 0; } @@ -341,6 +353,32 @@ static const char *run_event_debug_prog(struct run_event_context *run_ctx) return run_ctx->debug_prog; } +static struct tevent_queue *run_event_queue(struct run_event_context *run_ctx) +{ + return run_ctx->queue; +} + +static void run_event_start_running(struct run_event_context *run_ctx, + struct tevent_req *req, bool is_monitor) +{ + run_ctx->current_req = req; + run_ctx->monitor_running = is_monitor; +} + +static void run_event_stop_running(struct run_event_context *run_ctx) +{ + run_ctx->current_req = NULL; + run_ctx->monitor_running = false; +} + +static struct tevent_req *run_event_get_running( + struct run_event_context *run_ctx, + bool *is_monitor) +{ + *is_monitor = run_ctx->monitor_running; + return run_ctx->current_req; +} + static int run_event_script_status(struct run_event_script *script) { int ret; @@ -583,14 +621,18 @@ struct run_event_state { struct tevent_context *ev; struct run_event_context *run_ctx; const char *event_str; + const char *arg_str; struct timeval timeout; struct run_event_script_list *script_list; const char **argv; + struct tevent_req *script_subreq; int index; - int status; + bool cancelled; }; +static void run_event_cancel(struct tevent_req *req); +static void run_event_trigger(struct tevent_req *req, void *private_data); static struct tevent_req *run_event_run_script(struct tevent_req *req); static void run_event_next_script(struct tevent_req *subreq); static void run_event_debug(struct tevent_req *req, pid_t pid); @@ -603,9 +645,9 @@ struct tevent_req *run_event_send(TALLOC_CTX *mem_ctx, const char *arg_str, struct timeval timeout) { - struct tevent_req *req, *subreq; + struct tevent_req *req, *current_req; struct run_event_state *state; - int ret; + bool monitor_running, status; req = tevent_req_create(mem_ctx, &state, struct run_event_state); if (req == NULL) { @@ -61
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c1b4a74 ctdb-common: Add async version of shutdown in sock_daemon via 41d888a ctdb-common: Add async version of reconfigure in sock_daemon via 7558592 ctdb-common: Add async version of startup in sock_daemon via ba3e9e6 ctdb-tests: Create sock_daemon_funcs per test via 3b8f0cc ctdb-common: Handle errors on unexpected socket close in sock_daemon via 984c3f4 ctdb-common: Start listening to sockets only on successful startup via 001ae55 ctdb-common: Start wait computation only after successful startup via fbb5ac8 ctdb-common: Return status from sock_daemon startup()/reconfigure() via a6296ba ctdb-common: Do not use sock->req outside sock_socket functions via 49308f7 ctdb-common: Call missing tevent_wakeup_recv() in sock_daemon via 848f242 ctdb-daemon: Allocate deferred calls off calling context via 757a120 s3: utils: net. Fix return paths that don't free talloc stackframe. from 6e7d037 Fix formating of sources to be less than 80 lines https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c1b4a74f272977ebdc735c040e976853c7ca800f Author: Amitay Isaacs Date: Fri Nov 17 12:38:47 2017 +1100 ctdb-common: Add async version of shutdown in sock_daemon Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Nov 21 08:58:45 CET 2017 on sn-devel-144 commit 41d888afbecfca6e4ea3c6c86c05101bd5e5b5c4 Author: Amitay Isaacs Date: Fri Nov 17 12:38:18 2017 +1100 ctdb-common: Add async version of reconfigure in sock_daemon Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 7558592d15fa4911fa8d2061aa56e2b151f516a2 Author: Amitay Isaacs Date: Fri Nov 17 12:36:29 2017 +1100 ctdb-common: Add async version of startup in sock_daemon Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit ba3e9e6eae62af0ee991945206e0ef2b3dba8acf Author: Amitay Isaacs Date: Fri Nov 17 13:11:12 2017 +1100 ctdb-tests: Create sock_daemon_funcs per test This avoids defining sock_daemon functions that are not needed in the test. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 3b8f0cc21dd18e84ee78d0450d6f89435abf8dc1 Author: Amitay Isaacs Date: Fri Nov 17 12:31:16 2017 +1100 ctdb-common: Handle errors on unexpected socket close in sock_daemon Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 984c3f4f66846fb05fbbbc0cb4d2a3d2cacb6444 Author: Amitay Isaacs Date: Fri Nov 10 12:15:45 2017 +1100 ctdb-common: Start listening to sockets only on successful startup Fix tests to use wait_send() instead of startup() as a synchronization point to ensure that the socket is listening. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 001ae55011d9c0596f398dc374efc84637f1590c Author: Amitay Isaacs Date: Fri Nov 17 10:52:57 2017 +1100 ctdb-common: Start wait computation only after successful startup This orders the startup events in sock_daemon code. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit fbb5ac8404525a0828504cd744992dfcb7c8e216 Author: Amitay Isaacs Date: Fri Nov 10 12:10:05 2017 +1100 ctdb-common: Return status from sock_daemon startup()/reconfigure() Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit a6296bad87ac16cb0a39d35aa8cf0db2f85ec0d3 Author: Amitay Isaacs Date: Mon Nov 20 11:52:55 2017 +1100 ctdb-common: Do not use sock->req outside sock_socket functions Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 49308f7f22f3d6fa05cc81fdef3db020e503fa9f Author: Amitay Isaacs Date: Fri Nov 10 12:18:01 2017 +1100 ctdb-common: Call missing tevent_wakeup_recv() in sock_daemon https://bugzilla.samba.org/show_bug.cgi?id=13153 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 848f2425984667c243ccac847b8f48a66ce10178 Author: Amitay Isaacs Date: Thu Oct 19 14:58:18 2017 +1100 ctdb-daemon: Allocate deferred calls off calling context BUG: https://bugzilla.samba.org/show_bug.cgi?id=13152 This makes sure that if a client disconnects, all the deferred calls from the client are correctly freed. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 757a120fc4c659047bd6a1175b24f0673630ce2d Author: Jeremy Allison Date: Tue Nov 21 00:09:39 2017 + s3: utils: net. Fix return paths that don't free talloc stackframe. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13151 Signed-off-by: Jeremy Allison Reviewed-by:
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 65442e1 ctdb-client: Fix CID 1419820 via adde930 ctdb-tools: Drop duplicate output from dbstatistics from e583a92 python: Port tests of samba.messaging to Python 3 compatible form. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 65442e171454e62b6cf4a562c4113735213630d4 Author: Amitay Isaacs Date: Wed Oct 18 16:16:27 2017 +1100 ctdb-client: Fix CID 1419820 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Oct 23 19:45:08 CEST 2017 on sn-devel-144 commit adde9307954b2d9726f4be6a7398d6cfa7b2278f Author: Amitay Isaacs Date: Fri Oct 13 12:57:08 2017 +1100 ctdb-tools: Drop duplicate output from dbstatistics Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/client/client_tunnel.c | 4 ++-- ctdb/tools/ctdb.c | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/client/client_tunnel.c b/ctdb/client/client_tunnel.c index 11715b4..17b6546 100644 --- a/ctdb/client/client_tunnel.c +++ b/ctdb/client/client_tunnel.c @@ -155,7 +155,7 @@ static void ctdb_tunnel_handler(uint64_t tunnel_id, TDB_DATA data, return; } - if (data.dsize != sizeof(tunnel_data)) { + if (data.dsize != sizeof(struct ctdb_tunnel_data)) { return; } @@ -362,7 +362,7 @@ void ctdb_client_req_tunnel(struct ctdb_client_context *client, } else if (tunnel->flags & CTDB_TUNNEL_FLAG_REQUEST) { TDB_DATA data = { - .dsize = sizeof(&tunnel_data), + .dsize = sizeof(struct ctdb_tunnel_data), .dptr = (uint8_t *)&tunnel_data, }; diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 8d7adb5..2cb46b0 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -5588,7 +5588,6 @@ const struct { DBSTATISTICS_FIELD(locks.num_current), DBSTATISTICS_FIELD(locks.num_pending), DBSTATISTICS_FIELD(locks.num_failed), - DBSTATISTICS_FIELD(db_ro_delegations), }; static void print_dbstatistics(const char *db_name, -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 3bc8880 ctdb-tests: Add tests for event scripts with multiple '.'s via 7720ca0 ctdb-common: Ignore event scripts with multiple '.'s from f6d6af3 vfs_catia: Fix a potential memleak https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 3bc8880ea0532abed1db002710d3dd6a91f750dc Author: Amitay Isaacs Date: Thu Oct 12 14:44:03 2017 +1100 ctdb-tests: Add tests for event scripts with multiple '.'s BUG: https://bugzilla.samba.org/show_bug.cgi?id=13070 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Oct 18 10:19:48 CEST 2017 on sn-devel-144 commit 7720ca0729b127a93d78401aaf1341d79f9603a4 Author: Amitay Isaacs Date: Thu Oct 12 14:42:59 2017 +1100 ctdb-common: Ignore event scripts with multiple '.'s BUG: https://bugzilla.samba.org/show_bug.cgi?id=13070 This avoids running event script copies left by a package manager. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/common/run_event.c | 6 ++ ctdb/config/events.d/README | 4 +++- ctdb/tests/cunit/run_event_001.sh | 21 + 3 files changed, 30 insertions(+), 1 deletion(-) Changeset truncated at 500 lines: diff --git a/ctdb/common/run_event.c b/ctdb/common/run_event.c index e5d562c..0961d65 100644 --- a/ctdb/common/run_event.c +++ b/ctdb/common/run_event.c @@ -60,6 +60,12 @@ static int script_filter(const struct dirent *de) return 0; } + /* Ignore filenames with multiple '.'s */ + ptr = index(&de->d_name[3], '.'); + if (ptr != NULL) { + return 0; + } + return 1; } diff --git a/ctdb/config/events.d/README b/ctdb/config/events.d/README index 36f94bb..7025a4b 100644 --- a/ctdb/config/events.d/README +++ b/ctdb/config/events.d/README @@ -11,7 +11,9 @@ alphanumeric sort order. As a special case, any eventscript that ends with a '~' character will be ignored since this is a common postfix that some editors will append to -older versions of a file. +older versions of a file. Similarly, any eventscript with multiple '.'s +will be ignored as package managers can create copies with additional +suffix starting with '.' (e.g. .rpmnew, .dpkg-dist). Only executable event scripts are run by CTDB. Any event script that does not have execute permission is ignored. diff --git a/ctdb/tests/cunit/run_event_001.sh b/ctdb/tests/cunit/run_event_001.sh index f0ffe4f..35c256b 100755 --- a/ctdb/tests/cunit/run_event_001.sh +++ b/ctdb/tests/cunit/run_event_001.sh @@ -37,6 +37,27 @@ required_result 1 < "$scriptdir/10.test.rpmnew" < "$scriptdir/11.foo" <
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 71bedfa ctdb-tests: Check an unchecked return value via e0cf8a4 ctdb-test: Fix CID 1419118 (Error handling issues) via 9b880de ctdb-client: Fix a typo via a0c5d2e ctdb-tests: Strengthen some tests via 1eec318 ctdb-protocol: Fix typo in type of return variable from 7d47f75 man pages: properly ident lists https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 71bedfabbfa4d04ff654857094899f6a76e30922 Author: Martin Schwenke Date: Wed Oct 11 19:16:25 2017 +1100 ctdb-tests: Check an unchecked return value This can't fail but check it for completeness... just in case Coverity decides to notice it. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Mon Oct 16 09:27:17 CEST 2017 on sn-devel-144 commit e0cf8a4d0d3d820164d333d8968d4a3b599acd54 Author: Martin Schwenke Date: Wed Oct 11 19:04:28 2017 +1100 ctdb-test: Fix CID 1419118 (Error handling issues) Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke commit 9b880defb6f364925ab2b0ebba3158a21ca062a6 Author: Martin Schwenke Date: Tue Oct 10 14:51:40 2017 +1100 ctdb-client: Fix a typo Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke commit a0c5d2e2b542754ccb8d8c59396119005ce6c9fd Author: Martin Schwenke Date: Mon Oct 9 14:56:00 2017 +1100 ctdb-tests: Strengthen some tests Check for the expected result instead of just any failure. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke commit 1eec3184b6a65e1c1f7417f20c63a31ee4ca01a0 Author: Martin Schwenke Date: Mon Oct 9 14:52:30 2017 +1100 ctdb-protocol: Fix typo in type of return variable This causes failures to be folded down to 1, which is incorrect. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke --- Summary of changes: ctdb/client/client_control_sync.c | 2 +- ctdb/protocol/protocol_util.c | 2 +- ctdb/tests/src/fake_ctdbd.c | 16 +--- ctdb/tests/src/protocol_util_test.c | 6 +++--- 4 files changed, 18 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/ctdb/client/client_control_sync.c b/ctdb/client/client_control_sync.c index e4e14b7..e56a2b2 100644 --- a/ctdb/client/client_control_sync.c +++ b/ctdb/client/client_control_sync.c @@ -2014,7 +2014,7 @@ int ctdb_ctrl_tcp_add_delayed_update(TALLOC_CTX *mem_ctx, ret = ctdb_reply_control_tcp_add_delayed_update(reply); if (ret != 0) { DEBUG(DEBUG_ERR, - ("Control TCP_ADD_DELAYED_UDATE failed, ret=%d\n", ret)); + ("Control TCP_ADD_DELAYED_UPDATE failed, ret=%d\n", ret)); return ret; } diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c index 68a470f..73652e7 100644 --- a/ctdb/protocol/protocol_util.c +++ b/ctdb/protocol/protocol_util.c @@ -265,7 +265,7 @@ int ctdb_sock_addr_from_string(const char *str, unsigned port; char *endp = NULL; size_t len; - bool ret; + int ret; if (! with_port) { ret = ip_from_string(str, addr); diff --git a/ctdb/tests/src/fake_ctdbd.c b/ctdb/tests/src/fake_ctdbd.c index 06b5b22..af56e08 100644 --- a/ctdb/tests/src/fake_ctdbd.c +++ b/ctdb/tests/src/fake_ctdbd.c @@ -251,7 +251,11 @@ static bool nodemap_parse(struct node_map *node_map) } node = &node_map->node[node_map->num_nodes]; - ctdb_sock_addr_from_string(ip, &node->addr, false); + ret = ctdb_sock_addr_from_string(ip, &node->addr, false); + if (ret != 0) { + fprintf(stderr, "bad line (%s) - invalid IP\n", line); + continue; + } ctdb_sock_addr_set_port(&node->addr, CTDB_PORT); node->pnn = pnn; node->flags = flags; @@ -1962,11 +1966,17 @@ static void control_reload_nodes_file(TALLOC_CTX *mem_ctx, } if (nodemap->node[i].flags & NODE_FLAGS_DELETED) { + int ret; + node = &node_map->node[i]; node->flags |= NODE_FLAGS_DELETED; - ctdb_sock_addr_from_string("0.0.0.0", &node->addr, - false); + ret = ctdb_sock_addr_from_string("0.0.0.0", &node->addr, +false); + if
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 046427b ctdb-tests: Add interactive test for tunnels via 79a44d1 ctdb-tests: Add test for tunnels via 6fed8a7 ctdb-protocol: Add tunnel id prefix for testing via ad1a917 ctdb-client: Add client api for using tunnels via c700464 ctdb-protocol: Add protocol marshalling for CTDB_REQ_TUNNEL via 24e4197 ctdb-client: Add client code for tunnel controls via 4467c61 ctdb-protocol: Add protocol marshalling for tunnel controls via 2cb5fda ctdb-daemon: Add code to process ctdb_req_tunnel packets via f4f5e7d ctdb-protocol: Add req_tunnel counts to ctdb statistics via 9c51535 ctdb-daemon: Add implementation of tunnel controls via a41571a ctdb-protocol: Add controls to register/deregister tunnels via c202b18 ctdb-protocol: Add REQ_TUNNEL packet type from 76a1c5a wbinfo: return "NOT MAPPED" instead of "S-0-0" for unmapped id-to-sid https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 046427b0aba58dbecc64d356c32ff019691de363 Author: Amitay Isaacs Date: Fri Aug 11 15:53:28 2017 +1000 ctdb-tests: Add interactive test for tunnels Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Tue Oct 10 15:50:04 CEST 2017 on sn-devel-144 commit 79a44d15bb293aca8726ffd3a8112775b8ab1c06 Author: Amitay Isaacs Date: Mon Jun 26 18:06:18 2017 +1000 ctdb-tests: Add test for tunnels Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 6fed8a731a9de7d045871a5da819e9979631c3b6 Author: Amitay Isaacs Date: Fri Sep 29 12:16:21 2017 +1000 ctdb-protocol: Add tunnel id prefix for testing Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit ad1a9176d1ffa1be29cf090821acbdb23476c252 Author: Amitay Isaacs Date: Thu Apr 6 19:33:47 2017 +1000 ctdb-client: Add client api for using tunnels Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit c700464d2330f3cede96349c0cdcc55bbb88a5a0 Author: Amitay Isaacs Date: Wed Apr 5 16:25:42 2017 +1000 ctdb-protocol: Add protocol marshalling for CTDB_REQ_TUNNEL Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 24e4197195a4a23d1b901ce1d5d9ab5fca22696a Author: Amitay Isaacs Date: Thu Apr 6 18:58:18 2017 +1000 ctdb-client: Add client code for tunnel controls Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 4467c6112a6954908b97dce994852f882c38ce56 Author: Amitay Isaacs Date: Thu Apr 6 18:58:01 2017 +1000 ctdb-protocol: Add protocol marshalling for tunnel controls Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 2cb5fdac42104c68566c9766cabf7d167091f64d Author: Amitay Isaacs Date: Thu Apr 6 19:09:58 2017 +1000 ctdb-daemon: Add code to process ctdb_req_tunnel packets Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit f4f5e7d2ad4740cf0af70da3aa3b8bacfe4d3b6e Author: Amitay Isaacs Date: Thu Apr 6 17:50:38 2017 +1000 ctdb-protocol: Add req_tunnel counts to ctdb statistics Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 9c51535775c9564d0f908ede6cefc2998fe7b2c4 Author: Amitay Isaacs Date: Thu Apr 6 19:03:51 2017 +1000 ctdb-daemon: Add implementation of tunnel controls Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit a41571a7dac87481ef022b50903b6061f1a4f788 Author: Amitay Isaacs Date: Thu Apr 6 18:31:10 2017 +1000 ctdb-protocol: Add controls to register/deregister tunnels Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit c202b188bf6e6b9a4b1eee034acce8981fbb88ff Author: Amitay Isaacs Date: Wed Apr 5 16:07:10 2017 +1000 ctdb-protocol: Add REQ_TUNNEL packet type This allows to tunnel new protocols using ctdb transport. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- Summary of changes: ctdb/client/client.h | 206 ++ ctdb/client/client_connect.c | 11 + ctdb/client/client_control_sync.c | 58 ++ ctdb/client/client_private.h | 13 + ctdb/client/client_sync.h | 10 + ctdb/client/client_tunnel.c| 689 + ctdb/doc/ctdb-statistics.7.xml | 14 + ctdb/include/ctdb_private.h| 18 + ctdb/include/ctdb_protocol.h | 8 + ctdb/protocol/protocol.h | 17 + ctdb/protocol/protocol_api.h | 22 + ctdb/protocol/protocol_client.c
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e1a8c9b ctdb-common: Make parse_ip() and parse_ipv4() static via c98691c ctdb-common: Replace parse_ip() -> ctdb_sock_addr_from_string() via 330436b ctdb-tests: Replace parse_ip() -> ctdb_sock_addr_from_string() via a0051b8 ctdb-tools: Replace parse_ip() -> ctdb_sock_addr_from_string() via 4683ef2 ctdb-common: Remove unused function parse_ip_port() via 3ee9822 ctdb-tools: Replace parse_ip_port() -> ctdb_sock_addr_from_string() via cadd0d5 ctdb-common: Remove unused function ctdb_parse_connections() via 96e3ea5 ctdb-tools: Use ctdb_connection_list_read() via ddd9755 ctdb-common: Do not queue a packet if queue does not have valid fd via bf11bea ctdb-tests: Send broadcast to connected nodes, not configured nodes via 70d3063 ctdb-daemon: Send broadcast to connected nodes, not configured nodes from b07f221 s3: VFS: Ensure default SMB_VFS_GETWD() call can't return a partially completed struct smb_filename. https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e1a8c9b27014f4f576d1508de4b380b7517c0861 Author: Martin Schwenke Date: Tue Sep 19 23:51:21 2017 +1000 ctdb-common: Make parse_ip() and parse_ipv4() static parse_ip() has interface checking for IPv6 that is still used indirectly by the IP takeover code via parse_ip_mask(). This will be removed eventually. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu Oct 5 09:19:31 CEST 2017 on sn-devel-144 commit c98691c340e3463d90279014bbdc4e71da61de85 Author: Martin Schwenke Date: Tue Sep 19 23:44:31 2017 +1000 ctdb-common: Replace parse_ip() -> ctdb_sock_addr_from_string() ... and ctdb_sock_addr_set_port(). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 330436bd6ca4ec2700fd3b493bfd569c4ec81e4e Author: Martin Schwenke Date: Tue Sep 19 23:38:31 2017 +1000 ctdb-tests: Replace parse_ip() -> ctdb_sock_addr_from_string() ... and ctdb_sock_addr_set_port() where required. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit a0051b80d5126cca879bb1add24212020f9d5810 Author: Martin Schwenke Date: Tue Sep 19 23:28:45 2017 +1000 ctdb-tools: Replace parse_ip() -> ctdb_sock_addr_from_string() Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 4683ef28ab9674f49fa050075186011a671d4c85 Author: Martin Schwenke Date: Tue Sep 19 23:19:00 2017 +1000 ctdb-common: Remove unused function parse_ip_port() Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 3ee9822f9d776fcc57978e426c9ae8187cd5b1c6 Author: Martin Schwenke Date: Tue Sep 19 23:17:36 2017 +1000 ctdb-tools: Replace parse_ip_port() -> ctdb_sock_addr_from_string() Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit cadd0d51fb2fe861291f54cd8fc896c86bf76883 Author: Martin Schwenke Date: Tue Sep 19 23:12:15 2017 +1000 ctdb-common: Remove unused function ctdb_parse_connections() Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit 96e3ea54621f04f84b10b34caa0a1c13cb3a885b Author: Martin Schwenke Date: Tue Sep 19 23:10:55 2017 +1000 ctdb-tools: Use ctdb_connection_list_read() Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs commit ddd97553f0a8bfaada178ec4a7460d76fa21f079 Author: Amitay Isaacs Date: Fri Sep 29 14:23:24 2017 +1000 ctdb-common: Do not queue a packet if queue does not have valid fd BUG: https://bugzilla.samba.org/show_bug.cgi?id=13056 The only time a ctdb_queue is created without valid fd is when CTDB is trying to establish connections with other nodes in the cluster. All the other uses always create a ctdb_queue with valid fd. This avoids queueing up packets for dead nodes or nodes that are not running in the cluster and stops consuming memory. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit bf11bea5dbb589186a205fa1d81368cc89a6139b Author: Amitay Isaacs Date: Thu Sep 28 11:47:24 2017 +1000 ctdb-tests: Send broadcast to connected nodes, not configured nodes https://bugzilla.samba.org/show_bug.cgi?id=13056 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke commit 70d306373e80eafe3a356c60a823a2577001d7d1 Author: Amitay Isaacs Date: Thu Sep 28 11:47:00 2017 +1000 ctdb-daemon: Send broadcast to connected nodes, not configured nodes https://bugzilla.samba.org/show_bug.cgi?id=13056 Database recovery takes care of attaching missing databases on all the nodes. Signed-off-by: Amitay Isaacs