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-11-17 01:14:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sbd (Old)
 and      /work/SRC/openSUSE:Factory/.sbd.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "sbd"

Wed Nov 17 01:14:22 2021 rev:43 rq:931811 version:1.5.1+20211116.6bb085f

Changes:
--------
--- /work/SRC/openSUSE:Factory/sbd/sbd.changes  2021-09-21 21:13:30.050662939 
+0200
+++ /work/SRC/openSUSE:Factory/.sbd.new.1890/sbd.changes        2021-11-17 
01:15:33.178191529 +0100
@@ -1,0 +2,16 @@
+Tue Nov 16 06:50:12 UTC 2021 - Yan Gao <y...@suse.com>
+
+- Update to version 1.5.1+20211116.6bb085f (v1.5.1):
+- configure: validate configure options for paths (bsc#1185182)
+- man: refer to the modern run state directory `/run` if appropriate 
(bsc#1185182)
+- configure: add --with-runstatedir option (bsc#1185182)
+
+-------------------------------------------------------------------
+Tue Oct 19 13:23:13 UTC 2021 - Yan Gao <y...@suse.com>
+
+- Update to version 1.5.0+20211005.5ed9fd2:
+- sbd-md: properly destroy io-context
+- sbd-md: properly free one-time-allocations of sector-buffers
+- avoid using deprecated valloc & frequent aligned alloc
+
+-------------------------------------------------------------------

Old:
----
  sbd-1.5.0+20210720.f4ca41f.tar.xz

New:
----
  sbd-1.5.1+20211116.6bb085f.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sbd.spec ++++++
--- /var/tmp/diff_new_pack.hQAveQ/_old  2021-11-17 01:15:33.722191554 +0100
+++ /var/tmp/diff_new_pack.hQAveQ/_new  2021-11-17 01:15:33.722191554 +0100
@@ -47,7 +47,7 @@
 %global sync_resource_startup_sysconfig ""
 
 Name:           sbd
-Version:        1.5.0+20210720.f4ca41f
+Version:        1.5.1+20211116.6bb085f
 Release:        0
 Summary:        Storage-based death
 License:        GPL-2.0-or-later
@@ -96,7 +96,7 @@
 %configure --with-watchdog-timeout-default=%{watchdog_timeout_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="/"
+           --with-runstatedir=%{_rundir}
 make %{?_smp_mflags}
 
 %install

++++++ _service ++++++
--- /var/tmp/diff_new_pack.hQAveQ/_old  2021-11-17 01:15:33.778191557 +0100
+++ /var/tmp/diff_new_pack.hQAveQ/_new  2021-11-17 01:15:33.778191557 +0100
@@ -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.5.0+%cd.%h</param>
+    <param name="versionformat">1.5.1+%cd.%h</param>
     <param name="changesgenerate">enable</param>
   </service>
 

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.hQAveQ/_old  2021-11-17 01:15:33.822191559 +0100
+++ /var/tmp/diff_new_pack.hQAveQ/_new  2021-11-17 01:15:33.822191559 +0100
@@ -1,6 +1,6 @@
 <servicedata>
   <service name="tar_scm">
     <param name="url">https://github.com/ClusterLabs/sbd.git</param>
-    <param 
name="changesrevision">5c2576e547c49976ce9a78309bc18194a09d85ce</param>
+    <param 
name="changesrevision">6bb085f5704dd4c3841c79504f2aed2228e6d76a</param>
   </service>
 </servicedata>
\ No newline at end of file

++++++ sbd-1.5.0+20210720.f4ca41f.tar.xz -> sbd-1.5.1+20211116.6bb085f.tar.xz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/configure.ac 
new/sbd-1.5.1+20211116.6bb085f/configure.ac
--- old/sbd-1.5.0+20210720.f4ca41f/configure.ac 2021-07-20 08:58:18.000000000 
+0200
+++ new/sbd-1.5.1+20211116.6bb085f/configure.ac 2021-11-16 07:29:58.000000000 
+0100
@@ -20,7 +20,7 @@
 dnl     checks for system services
 
 AC_INIT([sbd], 
-       [1.5.0],
+       [1.5.1],
        [l...@suse.com])
 m4_include([tests-opt.m4])
 AC_CANONICAL_HOST
@@ -28,8 +28,37 @@
 AC_CONFIG_HEADERS(config.h)
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([no])])
 AM_INIT_AUTOMAKE(1.11.1 foreign TESTS_OPTION)
+LT_INIT([dlopen],[disable-static])
 AM_PROG_CC_C_O
 
+# expand_path_option $path_variable_name $default
+expand_path_option() {
+    # The first argument is the variable *name* (not value)
+    ac_path_varname="$1"
+
+    # Get the original value of the variable
+    ac_path_value=$(eval echo "\${${ac_path_varname}}")
+
+    # Expand any literal variable expressions in the value so that we don't
+    # end up with something like '${prefix}' in #defines etc.
+    #
+    # Autoconf deliberately leaves values unexpanded to allow overriding
+    # the configure script choices in make commands (for example,
+    # "make exec_prefix=/foo install"). No longer being able to do this seems
+    # like no great loss.
+    eval ac_path_value=$(eval echo "${ac_path_value}")
+
+    # Use (expanded) default if necessary
+    AS_IF([test x"${ac_path_value}" = x""],
+         [eval ac_path_value=$(eval echo "$2")])
+
+    # Require a full path
+    AS_CASE(["$ac_path_value"],
+            [/*], [eval ${ac_path_varname}="$ac_path_value"],
+            [*], [AC_MSG_ERROR([$ac_path_varname value "$ac_path_value" is not 
a full path])]
+    )
+}
+
 PKG_CHECK_MODULES(glib, [glib-2.0])
 PKG_CHECK_MODULES(libxml, [libxml-2.0])
 
@@ -164,6 +193,15 @@
     [ CONFIGDIR="$withval" ]
 )
 
+dnl --runstatedir is available as of autoconf 2.70 (2020-12-08). When users
+dnl have an older version, they can use our --with-runstatedir.
+sbd_runstatedir=""
+AC_ARG_WITH([runstatedir],
+    [AS_HELP_STRING([--with-runstatedir=DIR],
+        [modifiable per-process data @<:@LOCALSTATEDIR/run@:>@ (ignored if 
--runstatedir is available)])],
+    [ sbd_runstatedir="$withval" ]
+)
+
 SBD_WATCHDOG_TIMEOUT_DEFAULT=""
 AC_ARG_WITH(watchdog-timeout-default,
     [  --with-watchdog-timeout-default=SECONDS
@@ -289,32 +327,29 @@
   prefix) exec_prefix=$prefix;;
 esac
 
-dnl Expand autoconf variables so that we dont end up with '${prefix}'
-dnl in #defines and python scripts
-dnl NOTE: Autoconf deliberately leaves them unexpanded to allow
-dnl    make exec_prefix=/foo install
-dnl No longer being able to do this seems like no great loss to me...
-
-eval prefix="`eval echo ${prefix}`"
-eval exec_prefix="`eval echo ${exec_prefix}`"
-eval bindir="`eval echo ${bindir}`"
-eval sbindir="`eval echo ${sbindir}`"
-eval libexecdir="`eval echo ${libexecdir}`"
-eval datadir="`eval echo ${datadir}`"
-eval sysconfdir="`eval echo ${sysconfdir}`"
-eval sharedstatedir="`eval echo ${sharedstatedir}`"
-eval localstatedir="`eval echo ${localstatedir}`"
-eval libdir="`eval echo ${libdir}`"
-eval includedir="`eval echo ${includedir}`"
-eval oldincludedir="`eval echo ${oldincludedir}`"
-eval infodir="`eval echo ${infodir}`"
-eval mandir="`eval echo ${mandir}`"
+dnl Expand values of autoconf-provided directory options
+expand_path_option prefix
+expand_path_option exec_prefix
+expand_path_option bindir
+expand_path_option sbindir
+expand_path_option libexecdir
+expand_path_option datadir
+expand_path_option sysconfdir
+expand_path_option sharedstatedir
+expand_path_option localstatedir
+expand_path_option libdir
+expand_path_option includedir
+expand_path_option oldincludedir
+expand_path_option infodir
+expand_path_option mandir
+
+AS_IF([test x"${runstatedir}" = x""], [runstatedir="${sbd_runstatedir}"])
+expand_path_option runstatedir "${localstatedir}/run"
+AC_SUBST(runstatedir)
 
 AC_SUBST(LIBADD_DL)        dnl extra flags for dynamic linking libraries
 
-if test x"${CONFIGDIR}" = x""; then
-    CONFIGDIR="${sysconfdir}/sysconfig"
-fi
+expand_path_option CONFIGDIR "${sysconfdir}/sysconfig"
 AC_SUBST(CONFIGDIR)
 
 if test x"${SBD_WATCHDOG_TIMEOUT_DEFAULT}" = x""; then
@@ -345,9 +380,7 @@
 AC_SUBST(SBD_SYNC_RESOURCE_STARTUP_SYSCONFIG)
 
 dnl The Makefiles and shell scripts we output
-AC_CONFIG_FILES([Makefile src/Makefile agent/Makefile man/Makefile agent/sbd 
src/sbd.service src/sbd_remote.service src/sbd.sh src/sbd.sysconfig sbd.pc])
-
-AC_CONFIG_SUBDIRS([tests])
+AC_CONFIG_FILES([Makefile src/Makefile agent/Makefile man/Makefile 
tests/Makefile agent/sbd src/sbd.service src/sbd_remote.service src/sbd.sh 
src/sbd.sysconfig sbd.pc])
 
 dnl Now process the entire list of files added by previous 
 dnl  calls to AC_CONFIG_FILES()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/man/Makefile.am 
new/sbd-1.5.1+20211116.6bb085f/man/Makefile.am
--- old/sbd-1.5.0+20210720.f4ca41f/man/Makefile.am      2021-07-20 
08:58:18.000000000 +0200
+++ new/sbd-1.5.1+20211116.6bb085f/man/Makefile.am      2021-11-16 
07:29:58.000000000 +0100
@@ -6,7 +6,7 @@
        sed -r -n -e "s/^## Type: (.*)/Allows C<\1>/;t type;s/^## Default: 
(.*)/ defaulting to C<\1>/;t default;s/^#*(.*)=.*/=item B<\1>\n/;t 
variable;s/^#*//;s/^ *//;H;d;:type;h;d;:default;H;x;s/\n//;x;d;:variable;G;p" 
$< > $@
 
 sbd.8.pod: sbd.8.pod.in sbd.sysconfig.pod
-       sed -e "s/@environment_section@//;t 
insert;p;d;:insert;rsbd.sysconfig.pod" $< > $@
+       sed -e "s,\@runstatedir\@,$(runstatedir)," $< |sed -e 
"s/@environment_section@//;t insert;p;d;:insert;rsbd.sysconfig.pod" > $@
 
 sbd.8: sbd.8.pod
        @POD2MAN@ -s 8 -c "STONITH Block Device" -r "SBD" -n "SBD" $< $@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/man/sbd.8.pod.in 
new/sbd-1.5.1+20211116.6bb085f/man/sbd.8.pod.in
--- old/sbd-1.5.0+20210720.f4ca41f/man/sbd.8.pod.in     2021-07-20 
08:58:18.000000000 +0200
+++ new/sbd-1.5.1+20211116.6bb085f/man/sbd.8.pod.in     2021-11-16 
07:29:58.000000000 +0100
@@ -242,7 +242,7 @@
 This can be used to override the default watchdog device used and should not
 usually be necessary.
 
-=item B<-p> F</var/run/sbd.pid>
+=item B<-p> F<@runstatedir@/sbd.pid>
 
 This option can be used to specify a pidfile for the main sbd process.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/sbd.spec 
new/sbd-1.5.1+20211116.6bb085f/sbd.spec
--- old/sbd-1.5.0+20210720.f4ca41f/sbd.spec     2021-07-20 08:58:18.000000000 
+0200
+++ new/sbd-1.5.1+20211116.6bb085f/sbd.spec     2021-11-16 07:29:58.000000000 
+0100
@@ -15,7 +15,7 @@
 
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
-%global longcommit 2a00ac70f7200ed238a5bc73392e6a59a06fe904
+%global longcommit 7bcdf69597042c31ea0b4a523e732d4bbb99b3a0
 %global shortcommit %(echo %{longcommit}|cut -c1-8)
 %global modified %(echo %{longcommit}-|cut -f2 -d-)
 %global github_owner Clusterlabs
@@ -51,7 +51,7 @@
 Summary:        Storage-based death
 License:        GPLv2+
 Group:          System Environment/Daemons
-Version:        1.5.0
+Version:        1.5.1
 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
@@ -109,7 +109,8 @@
 export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror"
 %configure --with-watchdog-timeout-default=%{watchdog_timeout_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}
+           
--with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig} \
+           --with-runstatedir=%{_rundir}
 make %{?_smp_mflags}
 ###########################################################
 
@@ -172,6 +173,23 @@
 %{_libdir}/libsbdtestbed*
 
 %changelog
+* Mon Nov 15 2021 <klaus.wennin...@aon.at> - 1.5.1-99.0.7bcdf695.git
+- improve/fix cmdline handling
+  - tell the actual watchdog device specified with -w
+  - tolerate and strip any leading spaces of commandline option values
+  - Sanitize numeric arguments
+- if start-delay enabled, not explicitly given and msgwait can't be
+  read from disk (diskless) use 2 * watchdog-timeout
+- avoid using deprecated valloc for disk-io-buffers
+- avoid frequent alloc/free of aligned buffers to prevent fragmentation
+- fix memory-leak in one-time-allocations of sector-buffers
+- fix AIO-API usage: properly destroy io-context
+- improve/fix build environment
+  - validate configure options for paths
+  - remove unneeded complexity of configure.ac hierarchy
+  - correctly derive package version from git (regression since 1.5.0)
+  - make runstatedir configurable and derive from distribution
+
 * Tue Jun 8 2021 <klaus.wennin...@aon.at> - 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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/src/sbd-md.c 
new/sbd-1.5.1+20211116.6bb085f/src/sbd-md.c
--- old/sbd-1.5.0+20210720.f4ca41f/src/sbd-md.c 2021-07-20 08:58:18.000000000 
+0200
+++ new/sbd-1.5.1+20211116.6bb085f/src/sbd-md.c 2021-11-16 07:29:58.000000000 
+0100
@@ -89,7 +89,16 @@
 static void
 close_device(struct sbd_context *st)
 {
-       close(st->devfd);
+       if (!st) {
+               return;
+       }
+       if (st->ioctx) {
+               io_destroy(st->ioctx);
+       }
+       if (st->devfd >= 0) {
+               close(st->devfd);
+       }
+       free(st->buffer);
        free(st);
 }
 
@@ -101,15 +110,15 @@
        if (!devname)
                return NULL;
 
-       st = malloc(sizeof(struct sbd_context));
-       if (!st)
+       st = calloc(1, sizeof(struct sbd_context));
+       if (!st) {
                return NULL;
-       memset(st, 0, sizeof(struct sbd_context));
+       }
+       st->devfd = -1;
 
        if (io_setup(1, &st->ioctx) != 0) {
                cl_perror("io_setup failed");
-               free(st);
-               return NULL;
+               goto out;
        }
        
        st->devfd = open(devname, O_SYNC|O_RDWR|O_DIRECT);
@@ -120,19 +129,26 @@
                } else {
                        cl_log(loglevel, "Opening device %s failed.", devname);
                }
-               free(st);
-               return NULL;
+               goto out;
        }
 
        ioctl(st->devfd, BLKSSZGET, &sector_size);
 
        if (sector_size == 0) {
                cl_perror("Get sector size failed.\n");
-               close_device(st);
-               return NULL;
+               goto out;
+       }
+
+       if (posix_memalign(&st->buffer, sector_size, sector_size)) {
+               cl_perror("Couldn't allocate sector-buffer.");
+               goto out;
        }
 
        return st;
+
+out:
+       close_device(st);
+       return NULL;
 }
 
 static void *
@@ -140,11 +156,10 @@
 {
        void *x;
 
-       x = valloc(sector_size);
+       x = calloc(1, sector_size);
        if (!x) {
                exit(1);
        }
-       memset(x, 0, sector_size);
 
        return x;
 }
@@ -162,9 +177,11 @@
 
        memset(&st->io, 0, sizeof(struct iocb));
        if (rw) {
-               io_prep_pwrite(&st->io, st->devfd, data, sector_size, (long 
long) sector_size * sector);
+               memcpy(st->buffer, data, sector_size);
+               io_prep_pwrite(&st->io, st->devfd, st->buffer, sector_size, 
(long long) sector_size * sector);
        } else {
-               io_prep_pread(&st->io, st->devfd, data, sector_size, (long 
long) sector_size * sector);
+               memset(st->buffer, 0, sector_size);
+               io_prep_pread(&st->io, st->devfd, st->buffer, sector_size, 
(long long) sector_size * sector);
        }
 
        if (io_submit(st->ioctx, 1, ios) != 1) {
@@ -179,7 +196,7 @@
                cl_log(LOG_ERR, "Failed to retrieve IO events (rw=%d)", rw);
                return -1;
        } else if (r < 1L) {
-               cl_log(LOG_INFO, "Cancelling IO request due to timeout 
(rw=%d)", rw);
+               cl_log(LOG_INFO, "Cancelling IO request due to timeout (rw=%d, 
r=%ld)", rw, r);
                r = io_cancel(st->ioctx, ios[0], &event);
                if (r) {
                        DBGLOG(LOG_INFO, "Could not cancel IO request (rw=%d)", 
rw);
@@ -195,6 +212,9 @@
        
        /* IO is happy */
        if (event.res == sector_size) {
+               if (!rw) {
+                       memcpy(data, st->buffer, sector_size);
+               }
                return 0;
        } else {
                cl_log(LOG_ERR, "Short IO (rw=%d, res=%lu, sector_size=%d)",
@@ -322,11 +342,13 @@
 
        if (header_read(st, s_header) < 0) {
                cl_log(LOG_ERR, "Unable to read header from device %d", 
st->devfd);
+               free(s_header);
                return NULL;
        }
 
        if (valid_header(s_header) < 0) {
                cl_log(LOG_ERR, "header on device %d is not valid.", st->devfd);
+               free(s_header);
                return NULL;
        }
 
@@ -364,6 +386,8 @@
                        (unsigned long)s_header->timeout_loop);
        printf("Timeout (msgwait)  : %lu\n",
                        (unsigned long)s_header->timeout_msgwait);
+
+       free(s_header);
        return 0;
 }
 
@@ -916,6 +940,7 @@
         if (s_header != NULL) {
             msgwait = (unsigned long)s_header->timeout_msgwait;
             close_device(st);
+            free(s_header);
             return msgwait;
         }
 
@@ -1081,13 +1106,15 @@
        s_header = header_get(st);
        if (!s_header) {
                cl_log(LOG_ERR, "Not a valid header on %s", diskname);
-               exit(EXIT_MD_SERVANT_IO_FAIL);
+               rc = EXIT_MD_SERVANT_IO_FAIL;
+               goto out;
        }
 
        if (servant_check_timeout_inconsistent(s_header) < 0) {
                cl_log(LOG_ERR, "Timeouts on %s do not match first device",
                                diskname);
-               exit(EXIT_MD_SERVANT_IO_FAIL);
+               rc = EXIT_MD_SERVANT_IO_FAIL;
+               goto out;
        }
 
        if (s_header->minor_version > 0) {
@@ -1107,7 +1134,8 @@
        if (slot_read(st, mbox, s_node) < 0) {
                cl_log(LOG_ERR, "Unable to read node entry on %s",
                                diskname);
-               exit(EXIT_MD_SERVANT_IO_FAIL);
+               rc = EXIT_MD_SERVANT_IO_FAIL;
+               goto out;
        }
 
        cl_log(LOG_NOTICE, "Monitoring slot %d on disk %s", mbox, diskname);
@@ -1168,28 +1196,36 @@
                s_header_retry = header_get(st);
                if (!s_header_retry) {
                        cl_log(LOG_ERR, "No longer found a valid header on %s", 
diskname);
-                       exit(EXIT_MD_SERVANT_IO_FAIL);
+                       rc = EXIT_MD_SERVANT_IO_FAIL;
+                       goto out;
                }
                if (memcmp(s_header, s_header_retry, sizeof(*s_header)) != 0) {
                        cl_log(LOG_ERR, "Header on %s changed since start-up!", 
diskname);
-                       exit(EXIT_MD_SERVANT_IO_FAIL);
+                       free(s_header_retry);
+                       rc = EXIT_MD_SERVANT_IO_FAIL;
+                       goto out;
                }
                free(s_header_retry);
 
                s_node_retry = sector_alloc();
                if (slot_read(st, mbox, s_node_retry) < 0) {
                        cl_log(LOG_ERR, "slot read failed in servant.");
-                       exit(EXIT_MD_SERVANT_IO_FAIL);
+                       free(s_node_retry);
+                       rc = EXIT_MD_SERVANT_IO_FAIL;
+                       goto out;
                }
                if (memcmp(s_node, s_node_retry, sizeof(*s_node)) != 0) {
                        cl_log(LOG_ERR, "Node entry on %s changed since 
start-up!", diskname);
-                       exit(EXIT_MD_SERVANT_IO_FAIL);
+                       free(s_node_retry);
+                       rc = EXIT_MD_SERVANT_IO_FAIL;
+                       goto out;
                }
                free(s_node_retry);
 
                if (mbox_read(st, mbox, s_mbox) < 0) {
                        cl_log(LOG_ERR, "mbox read failed in servant.");
-                       exit(EXIT_MD_SERVANT_IO_FAIL);
+                       rc = EXIT_MD_SERVANT_IO_FAIL;
+                       goto out;
                }
 
                if (s_mbox->cmd > 0) {
@@ -1204,14 +1240,17 @@
                                sigqueue(ppid, SIG_TEST, signal_value);
                                break;
                        case SBD_MSG_RESET:
-                               exit(EXIT_MD_SERVANT_REQUEST_RESET);
+                               rc = EXIT_MD_SERVANT_REQUEST_RESET;
+                               goto out;
                        case SBD_MSG_OFF:
-                               exit(EXIT_MD_SERVANT_REQUEST_SHUTOFF);
+                               rc = EXIT_MD_SERVANT_REQUEST_SHUTOFF;
+                               goto out;
                        case SBD_MSG_EXIT:
                                sigqueue(ppid, SIG_EXITREQ, signal_value);
                                break;
                        case SBD_MSG_CRASHDUMP:
-                               exit(EXIT_MD_SERVANT_REQUEST_CRASHDUMP);
+                               rc = EXIT_MD_SERVANT_REQUEST_CRASHDUMP;
+                               goto out;
                        default:
                                /* FIXME:
                                   An "unknown" message might result
@@ -1240,6 +1279,8 @@
                }
        }
  out:
+       free(s_header);
+       free(s_node);
        free(s_mbox);
        close_device(st);
        exit(rc);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/src/sbd.h 
new/sbd-1.5.1+20211116.6bb085f/src/sbd.h
--- old/sbd-1.5.0+20210720.f4ca41f/src/sbd.h    2021-07-20 08:58:18.000000000 
+0200
+++ new/sbd-1.5.1+20211116.6bb085f/src/sbd.h    2021-11-16 07:29:58.000000000 
+0100
@@ -108,6 +108,7 @@
        int     devfd;
        io_context_t    ioctx;
        struct iocb     io;
+       void *buffer;
 };
 
 enum pcmk_health 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/src/sbd.service.in 
new/sbd-1.5.1+20211116.6bb085f/src/sbd.service.in
--- old/sbd-1.5.0+20210720.f4ca41f/src/sbd.service.in   2021-07-20 
08:58:18.000000000 +0200
+++ new/sbd-1.5.1+20211116.6bb085f/src/sbd.service.in   2021-11-16 
07:29:58.000000000 +0100
@@ -10,9 +10,9 @@
 
 [Service]
 Type=forking
-PIDFile=@localstatedir@/run/sbd.pid
+PIDFile=@runstatedir@/sbd.pid
 EnvironmentFile=-@CONFIGDIR@/sbd
-ExecStart=@sbindir@/sbd $SBD_OPTS -p @localstatedir@/run/sbd.pid watch
+ExecStart=@sbindir@/sbd $SBD_OPTS -p @runstatedir@/sbd.pid watch
 ExecStop=@bindir@/kill -TERM $MAINPID
 
 # Could this benefit from exit codes for restart?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/src/sbd.sh.in 
new/sbd-1.5.1+20211116.6bb085f/src/sbd.sh.in
--- old/sbd-1.5.0+20210720.f4ca41f/src/sbd.sh.in        2021-07-20 
08:58:18.000000000 +0200
+++ new/sbd-1.5.1+20211116.6bb085f/src/sbd.sh.in        2021-11-16 
07:29:58.000000000 +0100
@@ -60,7 +60,7 @@
 SBD_DEVS=${SBD_DEVICE%;}
 SBD_DEVICE_ARGS="-d ${SBD_DEVS//;/ -d }"
 
-: ${SBD_PIDFILE:=/var/run/sbd.pid}
+: ${SBD_PIDFILE:=@runstatedir@/sbd.pid}
 SBD_OPTS+=" -p $SBD_PIDFILE"
 : ${SBD_PACEMAKER:="true"}
 if ocf_is_true "$SBD_PACEMAKER" ; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/src/sbd_remote.service.in 
new/sbd-1.5.1+20211116.6bb085f/src/sbd_remote.service.in
--- old/sbd-1.5.0+20210720.f4ca41f/src/sbd_remote.service.in    2021-07-20 
08:58:18.000000000 +0200
+++ new/sbd-1.5.1+20211116.6bb085f/src/sbd_remote.service.in    2021-11-16 
07:29:58.000000000 +0100
@@ -8,9 +8,9 @@
 
 [Service]
 Type=forking
-PIDFile=@localstatedir@/run/sbd.pid
+PIDFile=@runstatedir@/sbd.pid
 EnvironmentFile=-@CONFIGDIR@/sbd
-ExecStart=@sbindir@/sbd $SBD_OPTS -p @localstatedir@/run/sbd.pid watch
+ExecStart=@sbindir@/sbd $SBD_OPTS -p @runstatedir@/sbd.pid watch
 ExecStop=@bindir@/kill -TERM $MAINPID
 
 # Could this benefit from exit codes for restart?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/tests/configure.ac 
new/sbd-1.5.1+20211116.6bb085f/tests/configure.ac
--- old/sbd-1.5.0+20210720.f4ca41f/tests/configure.ac   2021-07-20 
08:58:18.000000000 +0200
+++ new/sbd-1.5.1+20211116.6bb085f/tests/configure.ac   1970-01-01 
01:00:00.000000000 +0100
@@ -1,183 +0,0 @@
-dnl
-dnl autoconf for Agents
-dnl
-dnl License: GNU General Public License (GPL)
-
-dnl ===============================================
-dnl Bootstrap
-dnl ===============================================
-AC_PREREQ(2.63)
-
-dnl Suggested structure:
-dnl     information on the package
-dnl     checks for programs
-dnl     checks for libraries
-dnl     checks for header files
-dnl     checks for types
-dnl     checks for structures
-dnl     checks for compiler characteristics
-dnl     checks for library functions
-dnl     checks for system services
-
-AC_INIT([sbd],
-       [1.5.0],
-       [l...@suse.com])
-m4_include([../tests-opt.m4])
-AC_CANONICAL_HOST
-AC_CONFIG_AUX_DIR(.)
-AC_CONFIG_HEADERS(config.h)
-m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([no])])
-AM_INIT_AUTOMAKE(1.11.1 foreign TESTS_OPTION)
-LT_INIT([dlopen],[disable-static])
-AM_PROG_CC_C_O
-
-PKG_CHECK_MODULES(glib, [glib-2.0])
-
-CPPFLAGS="$CPPFLAGS -Werror $glib_CFLAGS"
-LIBS="$LIBS $glib_LIBS"
-
-dnl     checks for libraries
-AC_CHECK_LIB(c, dlopen)                         dnl if dlopen is in libc...
-AC_CHECK_LIB(dl, dlopen)                        dnl -ldl (for Linux)
-
-
-CONFIGDIR=""
-AC_ARG_WITH(configdir,
-    [  --with-configdir=DIR
-       Directory for SBD configuration file [${CONFIGDIR}]],
-    [ CONFIGDIR="$withval" ]
-)
-
-#
-# Where is dlopen?
-#
-if test "$ac_cv_lib_c_dlopen" = yes; then
-    LIBADD_DL=""
-elif test "$ac_cv_lib_dl_dlopen" = yes; then
-    LIBADD_DL=-ldl
-else
-    LIBADD_DL=${lt_cv_dlopen_libs}
-fi
-
-
-dnl **********************************************************************
-dnl Check for various argv[] replacing functions on various OSs
-dnl
-dnl Borrowed from Proftpd
-dnl Proftpd is Licenced under the terms of the GNU General Public Licence
-dnl and is available from http://www.proftpd.org/
-dnl
-
-AC_CHECK_FUNCS(setproctitle)
-AC_CHECK_HEADERS(libutil.h)
-AC_CHECK_LIB(util, setproctitle,
-        [AC_DEFINE(HAVE_SETPROCTITLE,1,[ ])
-                ac_cv_func_setproctitle="yes" ; LIBS="$LIBS -lutil"])
-
-if test "$ac_cv_func_setproctitle" = "yes"; then
-  pf_argv_set="PF_ARGV_NONE"
-fi
-
-if test "$pf_argv_set" = ""; then
-  AC_CHECK_HEADERS(sys/pstat.h)
-  if test "$ac_cv_header_pstat_h" = "yes"; then
-    AC_CHECK_FUNCS(pstat)
-
-    if test "$ac_cv_func_pstat" = "yes"; then
-        pf_argv_set="PF_ARGV_PSTAT"
-    else
-        pf_argv_set="PF_ARGV_WRITEABLE"
-    fi
-  fi
-
-  if test "$pf_argv_set" = ""; then
-    AC_EGREP_HEADER([#define.*PS_STRINGS.*],sys/exec.h,
-                        have_psstrings="yes",have_psstrings="no")
-    if test "$have_psstrings" = "yes"; then
-        pf_argv_set="PF_ARGV_PSSTRINGS"
-    fi
-  fi
-
-  if test "$pf_argv_set" = ""; then
-    AC_CACHE_CHECK(whether __progname and __progname_full are available,
-                    pf_cv_var_progname,
-                    AC_TRY_LINK([extern char *__progname, *__progname_full;],
-                        [__progname = "foo"; __progname_full = "foo bar";],
-                        pf_cv_var_progname="yes", pf_cv_var_progname="no"))
-
-    if test "$pf_cv_var_progname" = "yes"; then
-        AC_DEFINE(HAVE___PROGNAME,1,[ ])
-    fi
-
-    AC_CACHE_CHECK(which argv replacement method to use,
-                    pf_cv_argv_type,
-                    AC_EGREP_CPP(yes,[
-#if defined(__GNU_HURD__)
-  yes
-#endif
-  ],pf_cv_argv_type="new", pf_cv_argv_type="writeable"))
-
-    if test "$pf_cv_argv_type" = "new"; then
-        pf_argv_set="PF_ARGV_NEW"
-    fi
-
-    if test "$pf_argv_set" = ""; then
-        pf_argv_set="PF_ARGV_WRITEABLE"
-    fi
-  fi
-fi
-AC_DEFINE_UNQUOTED(PF_ARGV_TYPE, $pf_argv_set,
-        mechanism to pretty-print ps output: setproctitle-equivalent)
-
-dnl End of tests borrowed from Proftpd
-
-AC_MSG_NOTICE(Sanitizing prefix: ${prefix})
-case $prefix in
-  NONE)
-       prefix=/usr
-       dnl Fix default variables - "prefix" variable if not specified
-       if test "$localstatedir" = "\${prefix}/var"; then
-               localstatedir="/var"
-       fi
-       if test "$sysconfdir" = "\${prefix}/etc"; then
-               sysconfdir="/etc"
-       fi
-       ;;
-esac
-
-AC_MSG_NOTICE(Sanitizing exec_prefix: ${exec_prefix})
-case $exec_prefix in
-  dnl For consistency with Heartbeat, map NONE->$prefix
-  NONE)          exec_prefix=$prefix;;
-  prefix) exec_prefix=$prefix;;
-esac
-
-dnl Expand autoconf variables so that we dont end up with '${prefix}'
-dnl in #defines and python scripts
-dnl NOTE: Autoconf deliberately leaves them unexpanded to allow
-dnl    make exec_prefix=/foo install
-dnl No longer being able to do this seems like no great loss to me...
-
-eval prefix="`eval echo ${prefix}`"
-eval exec_prefix="`eval echo ${exec_prefix}`"
-eval bindir="`eval echo ${bindir}`"
-eval sbindir="`eval echo ${sbindir}`"
-eval libexecdir="`eval echo ${libexecdir}`"
-eval datadir="`eval echo ${datadir}`"
-eval sysconfdir="`eval echo ${sysconfdir}`"
-eval sharedstatedir="`eval echo ${sharedstatedir}`"
-eval localstatedir="`eval echo ${localstatedir}`"
-eval libdir="`eval echo ${libdir}`"
-eval includedir="`eval echo ${includedir}`"
-eval oldincludedir="`eval echo ${oldincludedir}`"
-eval infodir="`eval echo ${infodir}`"
-eval mandir="`eval echo ${mandir}`"
-
-AC_SUBST(LIBADD_DL)        dnl extra flags for dynamic linking libraries
-
-dnl The Makefiles and shell scripts we output
-AC_CONFIG_FILES([Makefile])
-
-dnl Now process the entire list of files added by previous
-dnl  calls to AC_CONFIG_FILES()
-AC_OUTPUT()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sbd-1.5.0+20210720.f4ca41f/tests/sbd-testbed.c 
new/sbd-1.5.1+20211116.6bb085f/tests/sbd-testbed.c
--- old/sbd-1.5.0+20210720.f4ca41f/tests/sbd-testbed.c  2021-07-20 
08:58:18.000000000 +0200
+++ new/sbd-1.5.1+20211116.6bb085f/tests/sbd-testbed.c  2021-11-16 
07:29:58.000000000 +0100
@@ -63,6 +63,7 @@
 typedef FILE *(*orig_fopen_f_type)(const char *pathname, const char *mode);
 typedef int (*orig_fclose_f_type)(FILE *fp);
 typedef int (*orig_io_setup_f_type)(int nr_events, io_context_t *ctx_idp);
+typedef int (*orig_io_destroy_f_type)(io_context_t ctx_id);
 typedef int (*orig_io_submit_f_type)(io_context_t ctx_id, long nr, struct iocb 
*ios[]);
 typedef int (*orig_io_getevents_f_type)(io_context_t ctx_id, long min_nr, long 
nr,
                 struct io_event *events, struct timespec *timeout);
@@ -93,6 +94,7 @@
 static orig_fopen_f_type orig_fopen = NULL;
 static orig_fclose_f_type orig_fclose = NULL;
 static orig_io_setup_f_type orig_io_setup = NULL;
+static orig_io_destroy_f_type orig_io_destroy = NULL;
 static orig_io_submit_f_type orig_io_submit = NULL;
 static orig_io_getevents_f_type orig_io_getevents = NULL;
 static orig_io_cancel_f_type orig_io_cancel = NULL;
@@ -158,6 +160,7 @@
             exit(1);
         }
         orig_io_setup     = 
(orig_io_setup_f_type)dlsym_fatal(handle,"io_setup");
+        orig_io_destroy   = 
(orig_io_destroy_f_type)dlsym_fatal(handle,"io_destroy");
         orig_io_submit    = 
(orig_io_submit_f_type)dlsym_fatal(handle,"io_submit");
         orig_io_getevents = 
(orig_io_getevents_f_type)dlsym_fatal(handle,"io_getevents");
         orig_io_cancel    = 
(orig_io_cancel_f_type)dlsym_fatal(handle,"io_cancel");
@@ -625,6 +628,19 @@
     return 0;
 }
 
+int io_destroy(io_context_t ctx_id)
+{
+    init();
+
+    if (!translate_aio) {
+        return orig_io_destroy(ctx_id);
+    }
+
+    if (ctx_id != &our_io_context) {
+        return EINVAL;
+    }
+    return 0;
+}
 
 int io_submit(io_context_t ctx_id, long nr, struct iocb *ios[])
 {

Reply via email to