From b2af54ada06ba998fa91e30f20108f79500fed33ff70b4186d64e80985fcec46 Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Thu, 1 Oct 2009 09:12:36 +0000 Subject: [PATCH] Accepting request 21462 from home:michal-m:branches:Base:System Copy from home:michal-m:branches:Base:System/mdadm via accept of submit request 21462 revision 2. OBS-URL: https://build.opensuse.org/request/show/21462 OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=4 --- ...missing-space-in-detail-brief-output.patch | 32 +++++++++++++ ...-null-dereference-in-set_member_info.patch | 48 +++++++++++++++++++ mdadm-3.0.2.tar.bz2 | 3 ++ mdadm.changes | 6 +++ mdadm.spec | 16 +++---- 5 files changed, 96 insertions(+), 9 deletions(-) create mode 100644 0001-Add-missing-space-in-detail-brief-output.patch create mode 100644 0002-Fix-null-dereference-in-set_member_info.patch create mode 100644 mdadm-3.0.2.tar.bz2 diff --git a/0001-Add-missing-space-in-detail-brief-output.patch b/0001-Add-missing-space-in-detail-brief-output.patch new file mode 100644 index 0000000..34e888c --- /dev/null +++ b/0001-Add-missing-space-in-detail-brief-output.patch @@ -0,0 +1,32 @@ +From 0e90271e53c0f6efb33e904cf407498350e2a14d Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 1 Oct 2009 12:38:31 +1000 +Subject: [PATCH 1/2] Add missing space in "--detail --brief" output. + +We need a space between the device name and the word "level".. + +Signed-off-by: NeilBrown +--- + Detail.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Detail.c b/Detail.c +index 001012a..a70db34 100644 +--- a/Detail.c ++++ b/Detail.c +@@ -207,11 +207,11 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) + printf("ARRAY %s", dev); + if (brief > 1) { + if (array.raid_disks) +- printf("level=%s num-devices=%d", ++ printf(" level=%s num-devices=%d", + c?c:"-unknown-", + array.raid_disks ); + else +- printf("level=container num-devices=%d", ++ printf(" level=container num-devices=%d", + array.nr_disks); + } + if (container) { +-- +1.6.3.3 diff --git a/0002-Fix-null-dereference-in-set_member_info.patch b/0002-Fix-null-dereference-in-set_member_info.patch new file mode 100644 index 0000000..dfbb818 --- /dev/null +++ b/0002-Fix-null-dereference-in-set_member_info.patch @@ -0,0 +1,48 @@ +From 2b9aa337af7291d3f141322da96c9f667c99d53c Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 1 Oct 2009 12:51:04 +1000 +Subject: [PATCH 2/2] Fix null-dereference in set_member_info + +set_member_info would try to dereference ->metadata_version, without +checking that it isn't NULL. + +Signed-off-by: NeilBrown +--- + mapfile.c | 15 +++++++++------ + 1 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/mapfile.c b/mapfile.c +index a3038be..ed59db5 100644 +--- a/mapfile.c ++++ b/mapfile.c +@@ -303,19 +303,22 @@ struct map_ent *map_by_name(struct map_ent **map, char *name) + */ + static void set_member_info(struct supertype *st, struct mdstat_ent *ent) + { +- char version[strlen(ent->metadata_version)+1]; + + st->subarray[0] = '\0'; + +- if (strncmp(ent->metadata_version, "external:", 9) != 0) ++ if (ent->metadata_version == NULL || ++ strncmp(ent->metadata_version, "external:", 9) != 0) + return; + +- strcpy(version, ent->metadata_version); +- +- if (is_subarray(&version[9])) { +- char *subarray = strrchr(version, '/'); ++ if (is_subarray(&ent->metadata_version[9])) { ++ char version[strlen(ent->metadata_version)+1]; ++ char *subarray; + char *name = &version[10]; + ++ strcpy(version, ent->metadata_version); ++ subarray = strrchr(version, '/'); ++ name = &version[10]; ++ + if (!subarray) + return; + *subarray++ = '\0'; +-- +1.6.3.3 diff --git a/mdadm-3.0.2.tar.bz2 b/mdadm-3.0.2.tar.bz2 new file mode 100644 index 0000000..2db571a --- /dev/null +++ b/mdadm-3.0.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:821c2a073daed4916973226a6c623de5d697cceb077de935e2b1c316b11f3da7 +size 252754 diff --git a/mdadm.changes b/mdadm.changes index 1c5a09b..6de6c6a 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 1 10:51:38 CEST 2009 - mmarek@suse.cz + +- updated to 3.0.2 + 2 patches + * bugfixes only + ------------------------------------------------------------------- Fri Jun 12 09:43:43 CEST 2009 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index faf1932..45db418 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -19,9 +19,8 @@ Name: mdadm -Version: 3.0 +Version: 3.0.2 Release: 21 -%define ver 3.0 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -31,10 +30,9 @@ License: GPL v2 or later Url: http://www.kernel.org/pub/linux/utils/raid/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: %{name}-%{ver}.tar.bz2 -# XXX - still needed? -Patch6: Start-kpartx-for-imsm-devices.patch -Patch11: manage-rebuild-map-for-kpartx +Source: %{name}-%{version}.tar.bz2 +Patch1: 0001-Add-missing-space-in-detail-brief-output.patch +Patch2: 0002-Fix-null-dereference-in-set_member_info.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -54,9 +52,9 @@ Authors: Neil Brown %prep -%setup -q -a1 -n %{name}-%{ver} -#patch6 -p1 -#patch11 -p1 +%setup -q -a1 +%patch1 -p1 +%patch2 -p1 %build %{suse_update_config -f}