From 54e274beabebbb808b6f25cd8185353b2d76f33f2a6bde0884235f31d256a328 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Thu, 22 Oct 2009 14:39:38 +0000 Subject: [PATCH 1/8] - Make 'param' local (bnc#548708) - Include multipath-fix.patch in git tree. OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=6 --- multipath-tools-0.4.8-opensuse-11.2.diff.bz2 | 4 ++-- multipath-tools.changes | 6 ++++++ multipath-tools.spec | 8 +++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 b/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 index e55f7ec..b2535b6 100644 --- a/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 +++ b/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:507361270bd9d1c703a265834334ba5d39f3d2d4677dd531ab23611c845fb381 -size 131381 +oid sha256:6ee2872ba8dd45be1f365c3e1cc76fc1e4294eca617e6830cf9a51b60173403b +size 131574 diff --git a/multipath-tools.changes b/multipath-tools.changes index 1d98954..c305613 100644 --- a/multipath-tools.changes +++ b/multipath-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 22 16:29:35 CEST 2009 - hare@suse.de + +- Make 'param' local (bnc#548708) +- Include multipath-fix.patch in git tree. + ------------------------------------------------------------------- Tue Sep 8 20:56:53 UTC 2009 - aj@suse.de diff --git a/multipath-tools.spec b/multipath-tools.spec index 231aef5..aa0b431 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -21,18 +21,17 @@ Name: multipath-tools BuildRequires: device-mapper-devel libaio-devel readline-devel Url: http://christophe.varoqui.free.fr/ -License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) +License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) Group: System/Base Requires: device-mapper kpartx PreReq: %insserv_prereq %fillup_prereq coreutils grep AutoReqProv: on Version: 0.4.8 -Release: 43 +Release: 41 Summary: Tools to Manage Multipathed Devices with the device-mapper Source: multipath-tools-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2 -Patch1: multipath-fix.patch %description This package provides the tools to manage multipathed devices by @@ -56,7 +55,7 @@ Authors: Christophe Varoqui %package -n kpartx -License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) +License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) Summary: Manages partition tables on device-mapper devices Group: System/Base Requires: device-mapper @@ -74,7 +73,6 @@ Authors: %prep %setup -q -n multipath-tools-%{version} %patch0 -p1 -%patch1 %build # This package failed when testing with -Wl,-as-needed being default. From baa09c67f6e9ca56ba7712400c43667a52f198757afc938f631cf1f528e0e0fc Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 23 Oct 2009 13:04:45 +0000 Subject: [PATCH 2/8] checked in OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=7 --- multipath-tools-0.4.8-opensuse-11.2.diff.bz2 | 4 ++-- multipath-tools.changes | 6 ------ multipath-tools.spec | 8 +++++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 b/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 index b2535b6..e55f7ec 100644 --- a/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 +++ b/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6ee2872ba8dd45be1f365c3e1cc76fc1e4294eca617e6830cf9a51b60173403b -size 131574 +oid sha256:507361270bd9d1c703a265834334ba5d39f3d2d4677dd531ab23611c845fb381 +size 131381 diff --git a/multipath-tools.changes b/multipath-tools.changes index c305613..1d98954 100644 --- a/multipath-tools.changes +++ b/multipath-tools.changes @@ -1,9 +1,3 @@ -------------------------------------------------------------------- -Thu Oct 22 16:29:35 CEST 2009 - hare@suse.de - -- Make 'param' local (bnc#548708) -- Include multipath-fix.patch in git tree. - ------------------------------------------------------------------- Tue Sep 8 20:56:53 UTC 2009 - aj@suse.de diff --git a/multipath-tools.spec b/multipath-tools.spec index aa0b431..231aef5 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -21,17 +21,18 @@ Name: multipath-tools BuildRequires: device-mapper-devel libaio-devel readline-devel Url: http://christophe.varoqui.free.fr/ -License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) +License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) Group: System/Base Requires: device-mapper kpartx PreReq: %insserv_prereq %fillup_prereq coreutils grep AutoReqProv: on Version: 0.4.8 -Release: 41 +Release: 43 Summary: Tools to Manage Multipathed Devices with the device-mapper Source: multipath-tools-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2 +Patch1: multipath-fix.patch %description This package provides the tools to manage multipathed devices by @@ -55,7 +56,7 @@ Authors: Christophe Varoqui %package -n kpartx -License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) +License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) Summary: Manages partition tables on device-mapper devices Group: System/Base Requires: device-mapper @@ -73,6 +74,7 @@ Authors: %prep %setup -q -n multipath-tools-%{version} %patch0 -p1 +%patch1 %build # This package failed when testing with -Wl,-as-needed being default. From 9e68a06ec3f0fc6a546172e09623bd6c3c7e4412a92584b26caa8e6dc918fa2a Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Mon, 22 Feb 2010 11:06:12 +0000 Subject: [PATCH 3/8] use factory OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=9 --- multipath-fix.patch | 13 --- multipath-tools-0.4.8-opensuse-11.2.diff.bz2 | 4 +- multipath-tools.changes | 11 ++ multipath-tools.spec | 6 +- remove-stacked-partitions.diff | 104 +++++++++++++++++++ 5 files changed, 120 insertions(+), 18 deletions(-) delete mode 100644 multipath-fix.patch create mode 100644 remove-stacked-partitions.diff diff --git a/multipath-fix.patch b/multipath-fix.patch deleted file mode 100644 index 1b441ef..0000000 --- a/multipath-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: kpartx/kpartx.c -=================================================================== ---- kpartx/kpartx.c.orig -+++ kpartx/kpartx.c -@@ -578,7 +578,7 @@ main(int argc, char **argv){ - continue; - - if (!dm_simplecmd(DM_DEVICE_REMOVE, -- partname)) { -+ partname, 1)) { - r++; - continue; - } diff --git a/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 b/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 index e55f7ec..b2535b6 100644 --- a/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 +++ b/multipath-tools-0.4.8-opensuse-11.2.diff.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:507361270bd9d1c703a265834334ba5d39f3d2d4677dd531ab23611c845fb381 -size 131381 +oid sha256:6ee2872ba8dd45be1f365c3e1cc76fc1e4294eca617e6830cf9a51b60173403b +size 131574 diff --git a/multipath-tools.changes b/multipath-tools.changes index 1d98954..0636dff 100644 --- a/multipath-tools.changes +++ b/multipath-tools.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Wed Jan 27 16:16:12 CST 2010 - cmeng@novell.com + +- Fix 'multipath -F' can't remove logical partitions (bnc#551827) + +------------------------------------------------------------------- +Thu Oct 22 16:29:35 CEST 2009 - hare@suse.de + +- Make 'param' local (bnc#548708) +- Include multipath-fix.patch in git tree. + ------------------------------------------------------------------- Tue Sep 8 20:56:53 UTC 2009 - aj@suse.de diff --git a/multipath-tools.spec b/multipath-tools.spec index 231aef5..2a7c4cf 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -27,12 +27,12 @@ Requires: device-mapper kpartx PreReq: %insserv_prereq %fillup_prereq coreutils grep AutoReqProv: on Version: 0.4.8 -Release: 43 +Release: 44. Summary: Tools to Manage Multipathed Devices with the device-mapper Source: multipath-tools-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2 -Patch1: multipath-fix.patch +Patch1: remove-stacked-partitions.diff %description This package provides the tools to manage multipathed devices by @@ -74,7 +74,7 @@ Authors: %prep %setup -q -n multipath-tools-%{version} %patch0 -p1 -%patch1 +%patch1 -p1 %build # This package failed when testing with -Wl,-as-needed being default. diff --git a/remove-stacked-partitions.diff b/remove-stacked-partitions.diff new file mode 100644 index 0000000..aac78bc --- /dev/null +++ b/remove-stacked-partitions.diff @@ -0,0 +1,104 @@ +Index: multipath-tools-0.4.8/libmultipath/devmapper.c +=================================================================== +--- multipath-tools-0.4.8.orig/libmultipath/devmapper.c ++++ multipath-tools-0.4.8/libmultipath/devmapper.c +@@ -912,6 +912,60 @@ bad: + return NULL; + } + ++dm_get_full_uuid(char *name, char *uuid) ++{ ++ struct dm_task *dmt; ++ const char *uuidtmp; ++ int r = 1; ++ ++ dmt = dm_task_create(DM_DEVICE_INFO); ++ if (!dmt) ++ return 1; ++ ++ if (!dm_task_set_name (dmt, name)) ++ goto uuidout; ++ ++ if (!dm_task_run(dmt)) ++ goto uuidout; ++ ++ uuidtmp = dm_task_get_uuid(dmt); ++ if (uuidtmp) { ++ strcpy(uuid, uuidtmp); ++ } ++ else ++ uuid[0] = '\0'; ++ ++ r = 0; ++uuidout: ++ dm_task_destroy(dmt); ++ return r; ++} ++ ++/* ++ * returns: ++ * 0 : if both uuids end with same suffix which starts with UUID_PREFIX ++ * 1 : otherwise ++ */ ++int ++dm_compare_uuid(const char* mapname1, const char* mapname2) ++{ ++ char *p1, *p2; ++ char uuid1[WWID_SIZE], uuid2[WWID_SIZE]; ++ ++ if (dm_get_full_uuid(mapname1, uuid1)) ++ return 1; ++ ++ if (dm_get_full_uuid(mapname2, uuid2)) ++ return 1; ++ ++ p1 = strstr(uuid1, UUID_PREFIX); ++ p2 = strstr(uuid2, UUID_PREFIX); ++ if (p1 && p2 && !strcmp(p1, p2)) ++ return 0; ++ ++ return 1; ++} ++ + int + dm_remove_partmaps (const char * mapname) + { +@@ -950,15 +1004,10 @@ dm_remove_partmaps (const char * mapname + (dm_type(names->name, TGT_PART) > 0) && + + /* +- * and the multipath mapname and the part mapname start +- * the same ++ * and the both uuid end with same suffix which ++ * starts with UUID_PREFIX + */ +- !strncmp(names->name, mapname, strlen(mapname)) && +- +- /* +- * and the opencount is 0 for us to allow removal +- */ +- !dm_get_opencount(names->name) && ++ !dm_compare_uuid(names->name, mapname) && + + /* + * and we can fetch the map table from the kernel +@@ -974,6 +1023,19 @@ dm_remove_partmaps (const char * mapname + * then it's a kpartx generated partition. + * remove it. + */ ++ ++ /* ++ * if the opencount is not 0, maybe some other ++ * partitons depend on it. ++ */ ++ if (dm_get_opencount(names->name)) { ++ dm_remove_partmaps(names->name); ++ if (dm_get_opencount(names->name)) { ++ condlog(2, "%s: map in use", names->name); ++ goto out; ++ } ++ } ++ + condlog(4, "partition map %s removed", + names->name); + dm_simplecmd_flush(DM_DEVICE_REMOVE, names->name); From 90b7a7095824214879a35b4e6d2e6972e69d849fdc4c2afcb56567950958c40a Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Mon, 22 Feb 2010 11:06:47 +0000 Subject: [PATCH 4/8] sync with O:F OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=11 --- multipath-tools.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/multipath-tools.spec b/multipath-tools.spec index 2a7c4cf..dd753a8 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -1,7 +1,7 @@ # # spec file for package multipath-tools (Version 0.4.8) # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,18 +21,18 @@ Name: multipath-tools BuildRequires: device-mapper-devel libaio-devel readline-devel Url: http://christophe.varoqui.free.fr/ -License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) +License: BSD3c(or similar) ; GPLv2+ ; LGPLv2.1+ ; Public Domain, Freeware ; MIT License (or similar) Group: System/Base Requires: device-mapper kpartx PreReq: %insserv_prereq %fillup_prereq coreutils grep AutoReqProv: on Version: 0.4.8 -Release: 44. +Release: 45 Summary: Tools to Manage Multipathed Devices with the device-mapper Source: multipath-tools-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2 -Patch1: remove-stacked-partitions.diff +Patch1: remove-stacked-partitions.diff %description This package provides the tools to manage multipathed devices by @@ -56,7 +56,7 @@ Authors: Christophe Varoqui %package -n kpartx -License: BSD 3-clause (or similar) ; GPL v2 or later ; LGPL v2.1 or later ; Public Domain, Freeware ; MIT License (or similar) +License: BSD3c(or similar) ; GPLv2+ ; LGPLv2.1+ ; Public Domain, Freeware ; MIT License (or similar) Summary: Manages partition tables on device-mapper devices Group: System/Base Requires: device-mapper From e333961b6ea5d61ba9418581f77d27b61616cb4cdd2b522c28139f9511a49203 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 26 Feb 2010 12:37:35 +0000 Subject: [PATCH 5/8] - fix buffer overflow in strncat OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=12 --- fixbuffers.diff | 13 +++++++++++++ multipath-tools.changes | 5 +++++ multipath-tools.spec | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 fixbuffers.diff diff --git a/fixbuffers.diff b/fixbuffers.diff new file mode 100644 index 0000000..608f33a --- /dev/null +++ b/fixbuffers.diff @@ -0,0 +1,13 @@ +Index: multipath-tools-0.4.8/libmultipath/configure.c +=================================================================== +--- multipath-tools-0.4.8.orig/libmultipath/configure.c 2010-02-26 13:34:41.000000000 +0100 ++++ multipath-tools-0.4.8/libmultipath/configure.c 2010-02-26 13:35:31.000000000 +0100 +@@ -167,7 +167,7 @@ select_action (struct multipath * mpp, v + if (!find_mp_by_wwid(curmp, mpp->wwid)) { + condlog(2, "%s: remove (wwid changed)", cmpp->alias); + dm_flush_map(mpp->alias); +- strncat(cmpp->wwid, mpp->wwid, WWID_SIZE); ++ strncat(cmpp->wwid, mpp->wwid, WWID_SIZE-strlen(cmpp->wwid)-1); + drop_multipath(curmp, cmpp->wwid, KEEP_PATHS); + mpp->action = ACT_CREATE; + condlog(3, "%s: set ACT_CREATE (map wwid change)", diff --git a/multipath-tools.changes b/multipath-tools.changes index 0636dff..293e668 100644 --- a/multipath-tools.changes +++ b/multipath-tools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 26 12:37:10 UTC 2010 - coolo@novell.com + +- fix buffer overflow in strncat + ------------------------------------------------------------------- Wed Jan 27 16:16:12 CST 2010 - cmeng@novell.com diff --git a/multipath-tools.spec b/multipath-tools.spec index dd753a8..d096263 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -33,6 +33,7 @@ Source: multipath-tools-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2 Patch1: remove-stacked-partitions.diff +Patch2: fixbuffers.diff %description This package provides the tools to manage multipathed devices by @@ -75,6 +76,7 @@ Authors: %setup -q -n multipath-tools-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build # This package failed when testing with -Wl,-as-needed being default. From 450079961137fd4aaf28a1f02dc5e5693735ac38a0d48a2fd6eea04c739e9130 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Mon, 1 Mar 2010 00:45:04 +0000 Subject: [PATCH 6/8] Accepting request 33549 from Base:System checked in (request 33549) OBS-URL: https://build.opensuse.org/request/show/33549 OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=13 --- fixbuffers.diff | 13 ------------- multipath-tools.changes | 5 ----- multipath-tools.spec | 2 -- 3 files changed, 20 deletions(-) delete mode 100644 fixbuffers.diff diff --git a/fixbuffers.diff b/fixbuffers.diff deleted file mode 100644 index 608f33a..0000000 --- a/fixbuffers.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: multipath-tools-0.4.8/libmultipath/configure.c -=================================================================== ---- multipath-tools-0.4.8.orig/libmultipath/configure.c 2010-02-26 13:34:41.000000000 +0100 -+++ multipath-tools-0.4.8/libmultipath/configure.c 2010-02-26 13:35:31.000000000 +0100 -@@ -167,7 +167,7 @@ select_action (struct multipath * mpp, v - if (!find_mp_by_wwid(curmp, mpp->wwid)) { - condlog(2, "%s: remove (wwid changed)", cmpp->alias); - dm_flush_map(mpp->alias); -- strncat(cmpp->wwid, mpp->wwid, WWID_SIZE); -+ strncat(cmpp->wwid, mpp->wwid, WWID_SIZE-strlen(cmpp->wwid)-1); - drop_multipath(curmp, cmpp->wwid, KEEP_PATHS); - mpp->action = ACT_CREATE; - condlog(3, "%s: set ACT_CREATE (map wwid change)", diff --git a/multipath-tools.changes b/multipath-tools.changes index 293e668..0636dff 100644 --- a/multipath-tools.changes +++ b/multipath-tools.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Fri Feb 26 12:37:10 UTC 2010 - coolo@novell.com - -- fix buffer overflow in strncat - ------------------------------------------------------------------- Wed Jan 27 16:16:12 CST 2010 - cmeng@novell.com diff --git a/multipath-tools.spec b/multipath-tools.spec index d096263..dd753a8 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -33,7 +33,6 @@ Source: multipath-tools-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2 Patch1: remove-stacked-partitions.diff -Patch2: fixbuffers.diff %description This package provides the tools to manage multipathed devices by @@ -76,7 +75,6 @@ Authors: %setup -q -n multipath-tools-%{version} %patch0 -p1 %patch1 -p1 -%patch2 -p1 %build # This package failed when testing with -Wl,-as-needed being default. From 449c2973e46086dce5c28b07ea22c09873f6a841d7519b0043eba3cc3dfe16e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Thu, 1 Jul 2010 20:50:26 +0000 Subject: [PATCH 7/8] Accepting request 42351 from home:jengelh:sparc Copy from home:jengelh:sparc/multipath-tools via accept of submit request 42351 revision 2. Request was accepted with message: Reviewed ok OBS-URL: https://build.opensuse.org/request/show/42351 OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=14 --- fixbuffers.diff | 13 +++++++++++++ libdir.diff | 23 +++++++++++++++++++++++ mpt-ucred.diff | 30 ++++++++++++++++++++++++++++++ multipath-tools.changes | 13 +++++++++++++ multipath-tools.spec | 11 ++++++++--- ready | 0 6 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 fixbuffers.diff create mode 100644 libdir.diff create mode 100644 mpt-ucred.diff delete mode 100644 ready diff --git a/fixbuffers.diff b/fixbuffers.diff new file mode 100644 index 0000000..608f33a --- /dev/null +++ b/fixbuffers.diff @@ -0,0 +1,13 @@ +Index: multipath-tools-0.4.8/libmultipath/configure.c +=================================================================== +--- multipath-tools-0.4.8.orig/libmultipath/configure.c 2010-02-26 13:34:41.000000000 +0100 ++++ multipath-tools-0.4.8/libmultipath/configure.c 2010-02-26 13:35:31.000000000 +0100 +@@ -167,7 +167,7 @@ select_action (struct multipath * mpp, v + if (!find_mp_by_wwid(curmp, mpp->wwid)) { + condlog(2, "%s: remove (wwid changed)", cmpp->alias); + dm_flush_map(mpp->alias); +- strncat(cmpp->wwid, mpp->wwid, WWID_SIZE); ++ strncat(cmpp->wwid, mpp->wwid, WWID_SIZE-strlen(cmpp->wwid)-1); + drop_multipath(curmp, cmpp->wwid, KEEP_PATHS); + mpp->action = ACT_CREATE; + condlog(3, "%s: set ACT_CREATE (map wwid change)", diff --git a/libdir.diff b/libdir.diff new file mode 100644 index 0000000..a025224 --- /dev/null +++ b/libdir.diff @@ -0,0 +1,23 @@ + +Ouch, ouch, ouch! +Since when is the presence of a directory an indicator for whether +a 64- or 32-bit library is to be built. Or inspected, for that +matter. + +--- + libmultipath/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: multipath-tools-0.4.8/libmultipath/Makefile +=================================================================== +--- multipath-tools-0.4.8.orig/libmultipath/Makefile ++++ multipath-tools-0.4.8/libmultipath/Makefile +@@ -14,7 +14,7 @@ OBJS = memory.o parser.o vector.o devmap + log.o configure.o structs_vec.o sysfs.o prio.o checkers.o \ + lock.o waiter.o + +-LIBDM_API_FLUSH = $(shell if test -d /lib64 ; then objdump -T /lib64/libdevmapper.so* ; else objdump -T /lib/libdevmapper.so.* ; fi | grep -c dm_task_no_flush) ++LIBDM_API_FLUSH = $(shell objdump -T ${LIB}/libdevmapper.so* | grep -c dm_task_no_flush) + + CFLAGS += -D_GNU_SOURCE + ifneq ($(strip $(LIBDM_API_FLUSH)),0) diff --git a/mpt-ucred.diff b/mpt-ucred.diff new file mode 100644 index 0000000..d3dce26 --- /dev/null +++ b/mpt-ucred.diff @@ -0,0 +1,30 @@ + +We need _GNU_SOURCE even when dmapi is not there. + +cc -O2 -g -m32 -mtune=ultrasparc -fPIC -DLIB_STRING=\"lib64\" +-c -o uevent.o uevent.c +uevent.c: In function 'uevent_listen': +uevent.c:262: error: invalid application of 'sizeof' to +incomplete type 'struct ucred' +uevent.c:290: error: dereferencing pointer to incomplete type +uevent.c:291: error: dereferencing pointer to incomplete type + +--- + libmultipath/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: multipath-tools-0.4.8/libmultipath/Makefile +=================================================================== +--- multipath-tools-0.4.8.orig/libmultipath/Makefile ++++ multipath-tools-0.4.8/libmultipath/Makefile +@@ -16,8 +16,9 @@ OBJS = memory.o parser.o vector.o devmap + + LIBDM_API_FLUSH = $(shell if test -d /lib64 ; then objdump -T /lib64/libdevmapper.so* ; else objdump -T /lib/libdevmapper.so.* ; fi | grep -c dm_task_no_flush) + ++CFLAGS += -D_GNU_SOURCE + ifneq ($(strip $(LIBDM_API_FLUSH)),0) +- CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE ++ CFLAGS += -DLIBDM_API_FLUSH + endif + + all: $(LIBS) diff --git a/multipath-tools.changes b/multipath-tools.changes index 0636dff..ef5781b 100644 --- a/multipath-tools.changes +++ b/multipath-tools.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Jun 30 16:19:00 UTC 2010 - jengelh@medozas.de + +- fix compilation on bi-arch by specifying LIB=%_lib + (Makefiles would erroneously assume a 64-bit target just by the + sheer presence of lib64, which is wrong) +- always add in -D_GNU_SOURCE to get at struct ucred + +------------------------------------------------------------------- +Fri Feb 26 12:37:10 UTC 2010 - coolo@novell.com + +- fix buffer overflow in strncat + ------------------------------------------------------------------- Wed Jan 27 16:16:12 CST 2010 - cmeng@novell.com diff --git a/multipath-tools.spec b/multipath-tools.spec index dd753a8..079135d 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -27,12 +27,15 @@ Requires: device-mapper kpartx PreReq: %insserv_prereq %fillup_prereq coreutils grep AutoReqProv: on Version: 0.4.8 -Release: 45 +Release: 46 Summary: Tools to Manage Multipathed Devices with the device-mapper Source: multipath-tools-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2 Patch1: remove-stacked-partitions.diff +Patch2: fixbuffers.diff +Patch3: mpt-ucred.diff +Patch4: libdir.diff %description This package provides the tools to manage multipathed devices by @@ -75,15 +78,17 @@ Authors: %setup -q -n multipath-tools-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch -P 3 -P 4 -p1 %build # This package failed when testing with -Wl,-as-needed being default. # So we disable it here, if you want to retest, just delete this comment and the line below. export SUSE_ASNEEDED=0 -make OPTFLAGS="$RPM_OPT_FLAGS" +make OPTFLAGS="$RPM_OPT_FLAGS" LIB=%_lib %install -make DESTDIR=$RPM_BUILD_ROOT install +make DESTDIR=$RPM_BUILD_ROOT LIB=%_lib install mkdir -p $RPM_BUILD_ROOT/var/cache/multipath/ %clean diff --git a/ready b/ready deleted file mode 100644 index 473a0f4..0000000 From 55911f934423b37b7f72d3b75083a010e33b71b15481d0e9aa5cca7ad5751825 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 2 Jul 2010 14:04:17 +0000 Subject: [PATCH 8/8] Accepting request 42387 from Base:System checked in (request 42387) OBS-URL: https://build.opensuse.org/request/show/42387 OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=15 --- multipath-tools.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multipath-tools.spec b/multipath-tools.spec index 079135d..800060a 100644 --- a/multipath-tools.spec +++ b/multipath-tools.spec @@ -27,15 +27,15 @@ Requires: device-mapper kpartx PreReq: %insserv_prereq %fillup_prereq coreutils grep AutoReqProv: on Version: 0.4.8 -Release: 46 +Release: 47 Summary: Tools to Manage Multipathed Devices with the device-mapper Source: multipath-tools-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Patch0: %{name}-%{version}-opensuse-11.2.diff.bz2 Patch1: remove-stacked-partitions.diff Patch2: fixbuffers.diff -Patch3: mpt-ucred.diff -Patch4: libdir.diff +Patch3: mpt-ucred.diff +Patch4: libdir.diff %description This package provides the tools to manage multipathed devices by