Hello community,

here is the log from the commit of package corosync for openSUSE:Factory 
checked in at 2017-12-08 12:54:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/corosync (Old)
 and      /work/SRC/openSUSE:Factory/.corosync.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "corosync"

Fri Dec  8 12:54:58 2017 rev:50 rq:548541 version:2.4.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/corosync/corosync.changes        2017-11-30 
12:39:29.406791982 +0100
+++ /work/SRC/openSUSE:Factory/.corosync.new/corosync.changes   2017-12-08 
12:55:01.806794557 +0100
@@ -1,0 +2,6 @@
+Tue Dec  5 06:13:13 UTC 2017 - [email protected]
+
+- wd: gcc shows snprintf warnings(bsc#1071187)  
+    Added: 0008-wd-fix-snprintf-warnings.patch
+
+-------------------------------------------------------------------

New:
----
  0008-wd-fix-snprintf-warnings.patch

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

Other differences:
------------------
++++++ corosync.spec ++++++
--- /var/tmp/diff_new_pack.B9pHWU/_old  2017-12-08 12:55:03.062749198 +0100
+++ /var/tmp/diff_new_pack.B9pHWU/_new  2017-12-08 12:55:03.066749053 +0100
@@ -69,6 +69,7 @@
 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
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 # openais is indeed gone and should be uninstalled. Yes, we do not
@@ -148,6 +149,7 @@
 %patch12 -p1
 %patch13 -p1
 %patch14 -p1
+%patch15 -p1
 
 %build
 %if %{with runautogen}

++++++ 0008-wd-fix-snprintf-warnings.patch ++++++
>From 0906e5717cce87ac8db25ac9a335a63530dba839 Mon Sep 17 00:00:00 2001
From: Bin Liu <[email protected]>
Date: Fri, 1 Dec 2017 10:58:50 +0800
Subject: [PATCH] wd: fix snprintf warnings

When running ./configure --enable-watchdog, gcc 7.2.1 will report
warnings for snprintf. This patch fixes the warnings.

Signed-off-by: Bin Liu <[email protected]>
Reviewed-by: Jan Friesse <[email protected]>
---
 exec/wd.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/exec/wd.c b/exec/wd.c
index 8d0734c9..042d2046 100644
--- a/exec/wd.c
+++ b/exec/wd.c
@@ -221,15 +221,15 @@ static int32_t wd_resource_state_is_ok (struct resource 
*ref)
        uint64_t allowed_period;
        char key_name[ICMAP_KEYNAME_MAXLEN];
 
-       snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"last_updated");
-       if (icmap_get_uint64(key_name, &last_updated) != CS_OK) {
+       if ((snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"last_updated") >= ICMAP_KEYNAME_MAXLEN) ||
+               (icmap_get_uint64(key_name, &last_updated) != CS_OK)) {
                /* key does not exist.
                */
                return CS_FALSE;
        }
 
-       snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"state");
-       if (icmap_get_string(key_name, &state) != CS_OK || strcmp(state, 
"disabled") == 0) {
+       if ((snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"state") >= ICMAP_KEYNAME_MAXLEN) ||
+               (icmap_get_string(key_name, &state) != CS_OK || strcmp(state, 
"disabled") == 0)) {
                /* key does not exist.
                */
                if (state != NULL)
@@ -279,8 +279,8 @@ static void wd_config_changed (struct cs_fsm* fsm, int32_t 
event, void * data)
 
        next_timeout = ref->check_timeout;
 
-       snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"poll_period");
-       if (icmap_get_uint64(ref->res_path, &tmp_value) == CS_OK) {
+       if ((snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"poll_period") >= ICMAP_KEYNAME_MAXLEN) ||
+               (icmap_get_uint64(ref->res_path, &tmp_value) == CS_OK)) {
                if (tmp_value >= WD_MIN_TIMEOUT_MS && tmp_value <= 
WD_MAX_TIMEOUT_MS) {
                        log_printf (LOGSYS_LEVEL_DEBUG,
                                "poll_period changing from:%"PRIu64" to 
%"PRIu64".",
@@ -299,8 +299,8 @@ static void wd_config_changed (struct cs_fsm* fsm, int32_t 
event, void * data)
                }
        }
 
-       snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"recovery");
-       if (icmap_get_string(key_name, &ref->recovery) != CS_OK) {
+       if ((snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"recovery") >= ICMAP_KEYNAME_MAXLEN) ||
+               (icmap_get_string(key_name, &ref->recovery) != CS_OK)) {
                /* key does not exist.
                 */
                log_printf (LOGSYS_LEVEL_WARNING,
@@ -308,8 +308,8 @@ static void wd_config_changed (struct cs_fsm* fsm, int32_t 
event, void * data)
                cs_fsm_state_set(&ref->fsm, WD_S_STOPPED, ref, wd_fsm_cb);
                return;
        }
-       snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"state");
-       if (icmap_get_string(key_name, &state) != CS_OK) {
+       if ((snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", ref->res_path, 
"state") >= ICMAP_KEYNAME_MAXLEN) ||
+               (icmap_get_string(key_name, &state) != CS_OK)) {
                /* key does not exist.
                */
                log_printf (LOGSYS_LEVEL_WARNING,
-- 
2.13.6


Reply via email to