Hello community,

here is the log from the commit of package mdadm for openSUSE:Factory checked 
in at 2019-02-24 17:04:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mdadm (Old)
 and      /work/SRC/openSUSE:Factory/.mdadm.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mdadm"

Sun Feb 24 17:04:53 2019 rev:117 rq:674340 version:4.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/mdadm/mdadm.changes      2018-12-19 
13:25:29.417230295 +0100
+++ /work/SRC/openSUSE:Factory/.mdadm.new.28833/mdadm.changes   2019-02-24 
17:04:57.328635941 +0100
@@ -1,0 +2,7 @@
+Tue Feb 12 06:21:48 UTC 2019 - [email protected]
+
+- Detail.c: do not skip first character when calling xstrdup in
+  Detail() (bsc#1123814)
+  0009-Detail.c-do-not-skip-first-character-when-calling-xs.patch
+
+-------------------------------------------------------------------

New:
----
  0009-Detail.c-do-not-skip-first-character-when-calling-xs.patch

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

Other differences:
------------------
++++++ mdadm.spec ++++++
--- /var/tmp/diff_new_pack.HyJGVw/_old  2019-02-24 17:04:57.832635702 +0100
+++ /var/tmp/diff_new_pack.HyJGVw/_new  2019-02-24 17:04:57.836635700 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package mdadm
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 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
@@ -50,6 +50,7 @@
 Patch16:        0006-Grow-avoid-overflow-in-compute_backup_blocks.patch
 Patch17:        0007-Grow-report-correct-new-chunk-size.patch
 Patch18:        0008-policy.c-prevent-NULL-pointer-referencing.patch
+Patch19:        0009-Detail.c-do-not-skip-first-character-when-calling-xs.patch
 Patch1001:      1001-display-timeout-status.patch
 %define _udevdir %(pkg-config --variable=udevdir udev)
 %define _systemdshutdowndir %{_unitdir}/../system-shutdown
@@ -68,6 +69,7 @@
 %patch16 -p1
 %patch17 -p1
 %patch18 -p1
+%patch19 -p1
 %patch1001 -p1
 
 %build

++++++ 0009-Detail.c-do-not-skip-first-character-when-calling-xs.patch ++++++
>From 02acb5718a68b16def418699c6afcc84223f52c7 Mon Sep 17 00:00:00 2001
From: Coly Li <[email protected]>
Date: Tue, 12 Feb 2019 12:43:40 +0800
Subject: [PATCH] Detail.c: do not skip first character when calling xstrdup in
 Detail()
Git-commit: Posted but not upstreamed yet
References: bsc#1123814

'Commit b9c9bd9bacaa ("Detail: ensure --export names are acceptable as
shell variables")' duplicates mdi->sys_name to sysdev string by,
        char *sysdev = xstrdup(mdi->sys_name + 1);
which skips the first character of mdi->sys_name. Then when running
mdadm --detail <md device> --export, the output looks like,
        MD_DEVICE_ev_sda2_ROLE=1
        MD_DEVICE_ev_sda2_DEV=/dev/sda2
The first character of md device (between MD_DEVICE and _ROLE/_DEV)
is dropped. The expected output should be,
        MD_DEVICE_dev_sda2_ROLE=1
        MD_DEVICE_dev_sda2_DEV=/dev/sda2

This patch removes the '+ 1' from calling xstrdup() in Detail(), which
gets the dropped first character back.

Reported-by: Arvin Schnell <[email protected]>
Fixes: b9c9bd9bacaa ("Detail: ensure --export names are acceptable as 4 shell 
variables")
Signed-off-by: Coly Li <[email protected]>
Cc: NeilBrown <[email protected]>
---
 Detail.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Detail.c b/Detail.c
index b3e857a..20ea03a 100644
--- a/Detail.c
+++ b/Detail.c
@@ -284,7 +284,7 @@ int Detail(char *dev, struct context *c)
                        struct mdinfo *mdi;
                        for (mdi  = sra->devs; mdi; mdi = mdi->next) {
                                char *path;
-                               char *sysdev = xstrdup(mdi->sys_name + 1);
+                               char *sysdev = xstrdup(mdi->sys_name);
                                char *cp;
 
                                path = map_dev(mdi->disk.major,
-- 
2.16.4


Reply via email to