Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sbd for openSUSE:Factory checked in at 2021-09-21 21:12:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sbd (Old) and /work/SRC/openSUSE:Factory/.sbd.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sbd" Tue Sep 21 21:12:41 2021 rev:42 rq:919506 version:1.5.0+20210720.f4ca41f Changes: -------- --- /work/SRC/openSUSE:Factory/sbd/sbd.changes 2021-05-03 22:08:39.960364183 +0200 +++ /work/SRC/openSUSE:Factory/.sbd.new.1899/sbd.changes 2021-09-21 21:13:30.050662939 +0200 @@ -1,0 +2,20 @@ +Thu Aug 12 15:48:03 UTC 2021 - Yan Gao <[email protected]> + +- Update to version 1.5.0+20210720.f4ca41f: +- sbd-inquisitor: Implement default delay start for diskless sbd (bsc#1189398) +- sbd-inquisitor: Sanitize numeric arguments + +------------------------------------------------------------------- +Thu Aug 12 15:28:38 UTC 2021 - Yan Gao <[email protected]> + +- Update to version 1.5.0+20210629.1c72cf2: +- sbd-inquisitor: tolerate and strip any leading spaces of command line option values (bsc#1187547) +- sbd-inquisitor: tell the actual watchdog device specified with `-w` (bsc#1187547) + +------------------------------------------------------------------- +Thu Aug 12 13:47:25 UTC 2021 - Yan Gao <[email protected]> + +- Update to version 1.5.0+20210614.d7f447d (v1.5.0): +- spec, configure.ac: default to resource-syncing with pacemaker + +------------------------------------------------------------------- Old: ---- sbd-1.4.2+20210305.926b554.tar.xz New: ---- sbd-1.5.0+20210720.f4ca41f.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sbd.spec ++++++ --- /var/tmp/diff_new_pack.NU6OOI/_old 2021-09-21 21:13:30.706663681 +0200 +++ /var/tmp/diff_new_pack.NU6OOI/_new 2021-09-21 21:13:30.710663685 +0200 @@ -29,11 +29,25 @@ %global watchdog_timeout_default 5 %endif -%global sync_resource_startup_default no -%global sync_resource_startup_sysconfig no +# Be careful with sync_resource_startup_default +# being enabled. This configuration has +# to be in sync with configuration in pacemaker +# where it is called sbd_sync - assure by e.g. +# mutual rpm dependencies. +%bcond_without sync_resource_startup_default +# Syncing enabled per default will lead to +# syncing enabled on upgrade without adaption +# of the config. +# Setting can still be overruled via sysconfig. +# The setting in the config-template packaged +# will follow the default if below is is left +# empty. But it is possible to have the setting +# in the config-template deviate from the default +# by setting below to an explicit 'yes' or 'no'. +%global sync_resource_startup_sysconfig "" Name: sbd -Version: 1.4.2+20210305.926b554 +Version: 1.5.0+20210720.f4ca41f Release: 0 Summary: Storage-based death License: GPL-2.0-or-later @@ -57,6 +71,7 @@ BuildRequires: pkgconfig(uuid) Requires(post): %fillup_prereq Conflicts: ClusterTools2 < 2.3.2 +Conflicts: libpacemaker3 < 2.1.0 BuildRoot: %{_tmppath}/%{name}-%{version}-build %{?systemd_requires} @@ -79,7 +94,7 @@ ./autogen.sh %configure --with-watchdog-timeout-default=%{watchdog_timeout_default} \ - --with-sync-resource-startup-default=%{sync_resource_startup_default} \ + --with-sync-resource-startup-default=%{?with_sync_resource_startup_default:yes}%{!?with_sync_resource_startup_default:no} \ --with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig} \ --localstatedir="/" make %{?_smp_mflags} ++++++ _service ++++++ --- /var/tmp/diff_new_pack.NU6OOI/_old 2021-09-21 21:13:30.742663722 +0200 +++ /var/tmp/diff_new_pack.NU6OOI/_new 2021-09-21 21:13:30.742663722 +0200 @@ -4,7 +4,7 @@ <param name="exclude">.git</param> <param name="url">https://github.com/ClusterLabs/sbd.git</param> <param name="revision">master</param> - <param name="versionformat">1.4.2+%cd.%h</param> + <param name="versionformat">1.5.0+%cd.%h</param> <param name="changesgenerate">enable</param> </service> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.NU6OOI/_old 2021-09-21 21:13:30.758663740 +0200 +++ /var/tmp/diff_new_pack.NU6OOI/_new 2021-09-21 21:13:30.758663740 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/ClusterLabs/sbd.git</param> - <param name="changesrevision">8b823d13220cc9942bd72a6a83f3b96db39ecb62</param> + <param name="changesrevision">5c2576e547c49976ce9a78309bc18194a09d85ce</param> </service> </servicedata> \ No newline at end of file ++++++ sbd-1.4.2+20210305.926b554.tar.xz -> sbd-1.5.0+20210720.f4ca41f.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sbd-1.4.2+20210305.926b554/Makefile.am new/sbd-1.5.0+20210720.f4ca41f/Makefile.am --- old/sbd-1.4.2+20210305.926b554/Makefile.am 2021-03-05 18:01:54.000000000 +0100 +++ new/sbd-1.5.0+20210720.f4ca41f/Makefile.am 2021-07-20 08:58:18.000000000 +0200 @@ -26,7 +26,7 @@ BUILD_COUNTER ?= build.counter COUNT = $(shell expr 1 + 0$(shell cat $(BUILD_COUNTER))) -COMMIT_COUNTER ?= $(shell git describe --tags --long --always --match v$(SPEC_VERSION) | cut -f 2 -d-) +COMMIT_COUNTER ?= $(shell git describe --tags --long --always --match v$(SPEC_VERSION) | cut -f 2 -d- -s) TESTS = tests/regressions.sh export SBD_BINARY := src/sbd @@ -73,7 +73,7 @@ sed -i 's/global\ build_counter.*/global\ build_counter\ $(COUNT)/' $(distdir)/$(PACKAGE).spec; \ echo $(COUNT) > $(BUILD_COUNTER); \ fi - if [ -n $(COMMIT_COUNTER) ]; then \ + if [ -n "$(COMMIT_COUNTER)" ]; then \ sed -i 's/global\ commit_counter.*/global\ commit_counter\ $(COMMIT_COUNTER)/' $(distdir)/$(PACKAGE).spec; \ fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sbd-1.4.2+20210305.926b554/configure.ac new/sbd-1.5.0+20210720.f4ca41f/configure.ac --- old/sbd-1.4.2+20210305.926b554/configure.ac 2021-03-05 18:01:54.000000000 +0100 +++ new/sbd-1.5.0+20210720.f4ca41f/configure.ac 2021-07-20 08:58:18.000000000 +0200 @@ -20,7 +20,7 @@ dnl checks for system services AC_INIT([sbd], - [1.4.2], + [1.5.0], [[email protected]]) m4_include([tests-opt.m4]) AC_CANONICAL_HOST @@ -332,7 +332,7 @@ Timeout in seconds SBD will configure the watchdog per default) if test x"${SBD_SYNC_RESOURCE_STARTUP_DEFAULT}" = x""; then - SBD_SYNC_RESOURCE_STARTUP_DEFAULT=no + SBD_SYNC_RESOURCE_STARTUP_DEFAULT=yes fi AC_SUBST(SBD_SYNC_RESOURCE_STARTUP_DEFAULT) dnl rather pass to C as a string and interpret there for consistent interpretation @@ -340,7 +340,7 @@ Default for SBD_SYNC_RESOURCE_STARTUP if not given in SBD configuration file explicitly) if test x"${SBD_SYNC_RESOURCE_STARTUP_SYSCONFIG}" = x""; then - SBD_SYNC_RESOURCE_STARTUP_SYSCONFIG=no + SBD_SYNC_RESOURCE_STARTUP_SYSCONFIG=${SBD_SYNC_RESOURCE_STARTUP_DEFAULT} fi AC_SUBST(SBD_SYNC_RESOURCE_STARTUP_SYSCONFIG) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sbd-1.4.2+20210305.926b554/sbd.spec new/sbd-1.5.0+20210720.f4ca41f/sbd.spec --- old/sbd-1.4.2+20210305.926b554/sbd.spec 2021-03-05 18:01:54.000000000 +0100 +++ new/sbd-1.5.0+20210720.f4ca41f/sbd.spec 2021-07-20 08:58:18.000000000 +0200 @@ -15,12 +15,12 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -%global longcommit bfeee963f7363720da91a018045ca6746d822ba0 +%global longcommit 2a00ac70f7200ed238a5bc73392e6a59a06fe904 %global shortcommit %(echo %{longcommit}|cut -c1-8) %global modified %(echo %{longcommit}-|cut -f2 -d-) %global github_owner Clusterlabs %global commit_counter 0 -%global build_counter 1 +%global build_counter 0 %global buildnum %(expr %{commit_counter} + %{build_counter}) %ifarch s390x s390 @@ -30,14 +30,28 @@ %global watchdog_timeout_default 5 %endif -%global sync_resource_startup_default no -%global sync_resource_startup_sysconfig no +# Be careful with sync_resource_startup_default +# being enabled. This configuration has +# to be in sync with configuration in pacemaker +# where it is called sbd_sync - assure by e.g. +# mutual rpm dependencies. +%bcond_without sync_resource_startup_default +# Syncing enabled per default will lead to +# syncing enabled on upgrade without adaption +# of the config. +# Setting can still be overruled via sysconfig. +# The setting in the config-template packaged +# will follow the default if below is is left +# empty. But it is possible to have the setting +# in the config-template deviate from the default +# by setting below to an explicit 'yes' or 'no'. +%global sync_resource_startup_sysconfig "" Name: sbd Summary: Storage-based death License: GPLv2+ Group: System Environment/Daemons -Version: 1.4.2 +Version: 1.5.0 Release: 99.%{buildnum}.%{shortcommit}.%{modified}git%{?dist} Url: https://github.com/%{github_owner}/%{name} Source0: https://github.com/%{github_owner}/%{name}/archive/%{longcommit}/%{name}-%{longcommit}.tar.gz @@ -72,6 +86,9 @@ This package contains the storage-based death functionality. +Available rpmbuild rebuild options: + --with(out) : sync_resource_startup_default + %package tests Summary: Storage-based death environment for regression tests License: GPLv2+ @@ -91,7 +108,7 @@ ./autogen.sh export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror" %configure --with-watchdog-timeout-default=%{watchdog_timeout_default} \ - --with-sync-resource-startup-default=%{sync_resource_startup_default} \ + --with-sync-resource-startup-default=%{?with_sync_resource_startup_default:yes}%{!?with_sync_resource_startup_default:no} \ --with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig} make %{?_smp_mflags} ########################################################### @@ -155,6 +172,14 @@ %{_libdir}/libsbdtestbed* %changelog +* Tue Jun 8 2021 <[email protected]> - 1.5.0-99.0.2a00ac70.git +- default to resource-syncing with pacemaker in spec-file and configure.ac + This default has to match between sbd and pacemaker and + thus qualifies this release for a minor-version-bump +- fix some regressions introduced by adding configurability previously +- adapt description of startup/shutdown sync with pacemaker +- make watchdog warning messages more understandable + * Wed Dec 2 2020 <[email protected]> - 1.4.2-99.1.bfeee963.git - improve build/CI-friendlyness - * travis: switch to F32 as build-host diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sbd-1.4.2+20210305.926b554/src/sbd-inquisitor.c new/sbd-1.5.0+20210720.f4ca41f/src/sbd-inquisitor.c --- old/sbd-1.4.2+20210305.926b554/src/sbd-inquisitor.c 2021-03-05 18:01:54.000000000 +0100 +++ new/sbd-1.5.0+20210720.f4ca41f/src/sbd-inquisitor.c 2021-07-20 08:58:18.000000000 +0200 @@ -39,10 +39,31 @@ int parse_device_line(const char *line); +static int +sanitize_numeric_option_value(const char *value) +{ + char *end = NULL; + long int result = -1; + + if (value == NULL) { + return -1; + } + + errno = 0; + + result = strtol(value, &end, 10); + if (result <= INT_MIN || result >= INT_MAX || errno != 0) { + result = -1; + } else if (*end != '\0') { + result = -1; + } + + return (int)result; +} + static const char * -get_env_option(const char *option) +sanitize_option_value(const char *value) { - const char *value = getenv(option); size_t max = 0; size_t lpc = 0; @@ -61,6 +82,14 @@ return (strlen(value + lpc) > 0 ? (value + lpc) : NULL); } +static const char * +get_env_option(const char *option) +{ + const char *value = getenv(option); + + return sanitize_option_value(value); +} + static int recruit_servant(const char *devname, pid_t pid) { @@ -968,10 +997,6 @@ } } } - cl_log(LOG_DEBUG, "Delay start: %s%s%s", - delay_start? "yes (" : "no", - delay_start? (delay > 0 ? value: "msgwait") : "", - delay_start? ")" : ""); value = get_env_option("SBD_TIMEOUT_ACTION"); if(value) { @@ -992,6 +1017,18 @@ } while ((c = getopt(argc, argv, "czC:DPRTWZhvw:d:n:p:1:2:3:4:5:t:I:F:S:s:r:")) != -1) { + int sanitized_num_optarg = 0; + /* Call it before checking optarg for NULL to make coverity happy */ + const char *sanitized_optarg = sanitize_option_value(optarg); + + if (optarg && ((sanitized_optarg == NULL) || + (strchr("SsC12345tIF", c) && + (sanitized_num_optarg = sanitize_numeric_option_value(sanitized_optarg)) < 0))) { + fprintf(stderr, "Invalid value \"%s\" for option -%c\n", optarg, c); + exit_status = -2; + goto out; + } + switch (c) { case 'D': break; @@ -1004,11 +1041,11 @@ cl_log(LOG_INFO, "Realtime mode deactivated."); break; case 'S': - start_mode = atoi(optarg); + start_mode = sanitized_num_optarg; cl_log(LOG_INFO, "Start mode set to: %d", (int)start_mode); break; case 's': - timeout_startup = atoi(optarg); + timeout_startup = sanitized_num_optarg; cl_log(LOG_INFO, "Start timeout set to: %d", (int)timeout_startup); break; case 'v': @@ -1035,14 +1072,14 @@ W_count++; break; case 'w': - cl_log(LOG_NOTICE, "Using watchdog device '%s'", watchdogdev); free(watchdogdev); - watchdogdev = strdup(optarg); + watchdogdev = strdup(sanitized_optarg); watchdogdev_is_default = false; + cl_log(LOG_NOTICE, "Using watchdog device '%s'", watchdogdev); break; case 'd': #if SUPPORT_SHARED_DISK - if (recruit_servant(optarg, 0) != 0) { + if (recruit_servant(sanitized_optarg, 0) != 0) { fprintf(stderr, "Invalid device: %s\n", optarg); exit_status = -1; goto out; @@ -1063,48 +1100,48 @@ disk_priority = 0; break; case 'n': - local_uname = strdup(optarg); + local_uname = strdup(sanitized_optarg); cl_log(LOG_INFO, "Overriding local hostname to %s", local_uname); break; case 'p': - pidfile = strdup(optarg); + pidfile = strdup(sanitized_optarg); cl_log(LOG_INFO, "pidfile set to %s", pidfile); break; case 'C': - timeout_watchdog_crashdump = atoi(optarg); + timeout_watchdog_crashdump = sanitized_num_optarg; cl_log(LOG_INFO, "Setting crashdump watchdog timeout to %d", (int)timeout_watchdog_crashdump); break; case '1': - timeout_watchdog = atoi(optarg); + timeout_watchdog = sanitized_num_optarg; break; case '2': - timeout_allocate = atoi(optarg); + timeout_allocate = sanitized_num_optarg; break; case '3': - timeout_loop = atoi(optarg); + timeout_loop = sanitized_num_optarg; break; case '4': - timeout_msgwait = atoi(optarg); + timeout_msgwait = sanitized_num_optarg; break; case '5': - timeout_watchdog_warn = atoi(optarg); + timeout_watchdog_warn = sanitized_num_optarg; do_calculate_timeout_watchdog_warn = false; cl_log(LOG_INFO, "Setting latency warning to %d", (int)timeout_watchdog_warn); break; case 't': - servant_restart_interval = atoi(optarg); + servant_restart_interval = sanitized_num_optarg; cl_log(LOG_INFO, "Setting servant restart interval to %d", (int)servant_restart_interval); break; case 'I': - timeout_io = atoi(optarg); + timeout_io = sanitized_num_optarg; cl_log(LOG_INFO, "Setting IO timeout to %d", (int)timeout_io); break; case 'F': - servant_restart_count = atoi(optarg); + servant_restart_count = sanitized_num_optarg; cl_log(LOG_INFO, "Servant restart count set to %d", (int)servant_restart_count); break; @@ -1112,7 +1149,7 @@ if (timeout_action) { free(timeout_action); } - timeout_action = strdup(optarg); + timeout_action = strdup(sanitized_optarg); break; case 'h': usage(); @@ -1266,37 +1303,53 @@ } else if (strcmp(argv[optind], "ping") == 0) { exit_status = ping_via_slots(argv[optind + 1], servants_leader); + } else +#endif + if (strcmp(argv[optind], "query-watchdog") == 0) { + exit_status = watchdog_info(); + } else if (strcmp(argv[optind], "test-watchdog") == 0) { + exit_status = watchdog_test(); } else if (strcmp(argv[optind], "watch") == 0) { + /* sleep $(sbd $SBD_DEVICE_ARGS dump | grep -m 1 msgwait | awk '{print $4}') 2>/dev/null */ + + const char *delay_source = delay ? "SBD_DELAY_START" : ""; + +#if SUPPORT_SHARED_DISK if(disk_count > 0) { /* If no devices are specified, its not an error to be unable to find one */ open_any_device(servants_leader); + + if (delay_start && delay <= 0) { + delay = get_first_msgwait(servants_leader); + + if (delay > 0) { + delay_source = "msgwait"; + } else { + cl_log(LOG_WARNING, "No 'msgwait' value from disk, using '2 * watchdog-timeout' for 'delay' starting"); + } + } + } +#endif + /* Re-calculate timeout_watchdog_warn based on any timeout_watchdog from: + * SBD_WATCHDOG_TIMEOUT, -1 option or on-disk setting read with open_any_device() */ + if (do_calculate_timeout_watchdog_warn) { + timeout_watchdog_warn = calculate_timeout_watchdog_warn(timeout_watchdog); } if (delay_start) { + /* diskless mode or disk read issues causing get_first_msgwait() to return a 0 for delay */ if (delay <= 0) { - delay = get_first_msgwait(servants_leader); + delay = 2 * timeout_watchdog; + delay_source = "watchdog-timeout * 2"; } - sleep((unsigned long) delay); - } - - } else { - exit_status = -2; - } -#endif + cl_log(LOG_DEBUG, "Delay start (yes), (delay: %ld), (delay source: %s)", delay, delay_source); - /* Re-calculate timeout_watchdog_warn based on any timeout_watchdog from: - * SBD_WATCHDOG_TIMEOUT, -1 option or on-disk setting read with open_any_device() */ - if (do_calculate_timeout_watchdog_warn) { - timeout_watchdog_warn = calculate_timeout_watchdog_warn(timeout_watchdog); - } + sleep((unsigned long) delay); - if (strcmp(argv[optind], "query-watchdog") == 0) { - exit_status = watchdog_info(); - } else if (strcmp(argv[optind], "test-watchdog") == 0) { - exit_status = watchdog_test(); - } else if (strcmp(argv[optind], "watch") == 0) { - /* sleep $(sbd $SBD_DEVICE_ARGS dump | grep -m 1 msgwait | awk '{print $4}') 2>/dev/null */ + } else { + cl_log(LOG_DEBUG, "Delay start (no)"); + } /* We only want this to have an effect during watch right now; * pinging and fencing would be too confused */ @@ -1316,6 +1369,8 @@ cl_log(LOG_NOTICE, "%s flush + write \'%c\' to sysrq in case of timeout", do_flush?"Do":"Skip", timeout_sysrq_char); exit_status = inquisitor(); + } else { + exit_status = -2; } out: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sbd-1.4.2+20210305.926b554/tests/configure.ac new/sbd-1.5.0+20210720.f4ca41f/tests/configure.ac --- old/sbd-1.4.2+20210305.926b554/tests/configure.ac 2021-03-05 18:01:54.000000000 +0100 +++ new/sbd-1.5.0+20210720.f4ca41f/tests/configure.ac 2021-07-20 08:58:18.000000000 +0200 @@ -20,7 +20,7 @@ dnl checks for system services AC_INIT([sbd], - [1.4.2], + [1.5.0], [[email protected]]) m4_include([../tests-opt.m4]) AC_CANONICAL_HOST
