From 2b389892e9d2df696f431ae44a59810595b9a5a08faf2aa3c25ca45726bff28b Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Wed, 3 Jan 2018 02:29:50 +0000 Subject: [PATCH] Accepting request 561082 from home:BinLiu:branches:network:ha-clustering:Factory - qdevice failed to run(bsc#1074276) Added: 0010-qdevice-mv-free-str-after-port-validation.patch - add support for corosync-qdevice in yast2-cluster and bootstrap(bsc#1070961) Added: 0009-add-config-for-corosync-qnetd.patch OBS-URL: https://build.opensuse.org/request/show/561082 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=128 --- 0009-add-config-for-corosync-qnetd.patch | 11 +++++ ...ce-mv-free-str-after-port-validation.patch | 40 +++++++++++++++++++ corosync.changes | 12 ++++++ corosync.spec | 6 ++- 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 0009-add-config-for-corosync-qnetd.patch create mode 100644 0010-qdevice-mv-free-str-after-port-validation.patch diff --git a/0009-add-config-for-corosync-qnetd.patch b/0009-add-config-for-corosync-qnetd.patch new file mode 100644 index 0000000..f746a56 --- /dev/null +++ b/0009-add-config-for-corosync-qnetd.patch @@ -0,0 +1,11 @@ +--- corosync-2.4.3.orig/init/corosync-qnetd.sysconfig.example 2017-09-21 23:14:59.000000000 +0800 ++++ corosync-2.4.3/init/corosync-qnetd.sysconfig.example 2017-12-27 13:39:01.024262758 +0800 +@@ -3,7 +3,7 @@ + # COROSYNC_QNETD_OPTIONS specifies options passed to corosync-qnetd command + # (default is no options). + # See "man corosync-qnetd" for detailed descriptions of the options. +-COROSYNC_QNETD_OPTIONS="" ++COROSYNC_QNETD_OPTIONS="-4 -l 0.0.0.0 -p 5403 -s off" + + # COROSYNC_QNETD_RUNAS specifies user under which qnetd daemon should be running + # (not set or empty is default and means "user who executes init script") diff --git a/0010-qdevice-mv-free-str-after-port-validation.patch b/0010-qdevice-mv-free-str-after-port-validation.patch new file mode 100644 index 0000000..3a055e8 --- /dev/null +++ b/0010-qdevice-mv-free-str-after-port-validation.patch @@ -0,0 +1,40 @@ +From 60d419917ac5a64abe8539bedb9fd57af1451ff5 Mon Sep 17 00:00:00 2001 +From: Bin Liu +Date: Wed, 27 Dec 2017 18:21:34 +0800 +Subject: [PATCH] qdevice: mv free(str) after port validation + +in the previous code of qdevice_net_instance_init_from_cmap: + host_port = strtol(str, &ep, 10); + + free(str); + + if (host_port <= 0 || host_port > ((uint16_t)~0) || *ep != '\0') + +before free, *ep is '\0'. But after free, *ep changed to 'U', so mv +free behind the comparison. +--- + qdevices/qdevice-net-instance.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/qdevices/qdevice-net-instance.c b/qdevices/qdevice-net-instance.c +index 7adcaa3f..e4b7b04d 100644 +--- a/qdevices/qdevice-net-instance.c ++++ b/qdevices/qdevice-net-instance.c +@@ -274,12 +274,12 @@ qdevice_net_instance_init_from_cmap(struct qdevice_instance *instance) + if (cmap_get_string(cmap_handle, "quorum.device.net.port", &str) == CS_OK) { + host_port = strtol(str, &ep, 10); + +- free(str); +- + if (host_port <= 0 || host_port > ((uint16_t)~0) || *ep != '\0') { + qdevice_log(LOG_ERR, "quorum.device.net.port must be in range 0-65535"); ++ free(str); + goto error_free_host_addr; + } ++ free(str); + } else { + host_port = QNETD_DEFAULT_HOST_PORT; + } +-- +2.13.6 + diff --git a/corosync.changes b/corosync.changes index e716936..9490db3 100644 --- a/corosync.changes +++ b/corosync.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Jan 2 06:15:29 UTC 2018 - bliu@suse.com + +- qdevice failed to run(bsc#1074276) + Added: 0010-qdevice-mv-free-str-after-port-validation.patch + +------------------------------------------------------------------- +Wed Dec 27 05:49:39 UTC 2017 - bliu@suse.com + +- add support for corosync-qdevice in yast2-cluster and bootstrap(bsc#1070961) + Added: 0009-add-config-for-corosync-qnetd.patch + ------------------------------------------------------------------- Tue Dec 5 06:13:13 UTC 2017 - bliu@suse.com diff --git a/corosync.spec b/corosync.spec index afda65c..0378e64 100644 --- a/corosync.spec +++ b/corosync.spec @@ -1,7 +1,7 @@ # # spec file for package corosync # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -70,6 +70,8 @@ Patch12: 0005-do-not-convert-empty-uid-gid-to-0.patch Patch13: 0006-Fix-compile-warnings-with-GCC-7.2.1.patch Patch14: 0007-sync-Call-sync_init-of-all-services-at-once.patch Patch15: 0008-wd-fix-snprintf-warnings.patch +Patch16: 0009-add-config-for-corosync-qnetd.patch +Patch17: 0010-qdevice-mv-free-str-after-port-validation.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # openais is indeed gone and should be uninstalled. Yes, we do not @@ -150,6 +152,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %patch13 -p1 %patch14 -p1 %patch15 -p1 +%patch16 -p1 +%patch17 -p1 %build %if %{with runautogen}