- Fix crash when AUTO keyword is in mdadm.conf (bz552342)

This commit is contained in:
Doug Ledford 2010-01-15 21:38:45 +00:00
parent 381a3d3bb5
commit af2730f568
2 changed files with 31 additions and 1 deletions

25
mdadm-3.0.3-auto.patch Normal file
View File

@ -0,0 +1,25 @@
--- mdadm-3.0.3/config.c 2009-10-01 02:57:03.000000000 -0400
+++ mdadm-3.0.3/config.c 2010-01-04 11:24:58.700853405 -0500
@@ -677,12 +677,21 @@
static char *auto_options = NULL;
void autoline(char *line)
{
+ char *w;
+
if (auto_options) {
fprintf(stderr, Name ": AUTO line may only be give once."
" Subsequent lines ignored\n");
return;
}
- auto_options = line;
+
+ auto_options = dl_strdup(line);
+ dl_init(auto_options);
+
+ for (w=dl_next(line); w != line ; w=dl_next(w)) {
+ char *w2 = dl_strdup(w);
+ dl_add(auto_options, w2);
+ }
}
int loaded = 0;

View File

@ -1,7 +1,7 @@
Summary: The mdadm program controls Linux md devices (software RAID arrays)
Name: mdadm
Version: 3.0.3
Release: 2%{?dist}
Release: 3%{?dist}
Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.bz2
Source1: mdmonitor.init
Source2: raid-check
@ -12,6 +12,7 @@ Patch2: mdadm-3.0-metadata.patch
Patch3: mdadm-3.0-uuid.patch
Patch4: mdadm-3.0-mdmon-dev-.mdadm.patch
Patch5: mdadm-3.0.3-intel-serial.patch
Patch6: mdadm-3.0.3-auto.patch
URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/
License: GPLv2+
Group: System Environment/Base
@ -37,6 +38,7 @@ file can be used to help with some common tasks.
%patch3 -p1 -b .uuid
%patch4 -p1 -b .mdmon
%patch5 -p1 -b .serial
%patch6 -p1 -b .auto
%build
make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" SYSCONFDIR="%{_sysconfdir}" mdadm.static mdadm mdmon
@ -83,6 +85,9 @@ fi
%attr(0700,root,root) %dir /var/run/mdadm
%changelog
* Fri Jan 15 2010 Doug Ledford <dledford@redhat.com> - 3.0.3-3
- Fix crash when AUTO keyword is in mdadm.conf (bz552342)
* Tue Dec 01 2009 Doug Ledford <dledford@redhat.com> - 3.0.3-2
- Minor tweak to init script for LSB compliance (bz527957)