- set cloexec on device descriptor so it doesn't leak to sendmail (#214182)
- fixed minor bug in initscript (#213683) - backported SATA disk detection from upstream
This commit is contained in:
parent
e746d6d2c4
commit
9b8343902b
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# smartmontools init file for smartd
|
# smartmontools init file for smartd
|
||||||
# Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
# Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net>
|
||||||
# $Id: smartd.initd,v 1.3 2006/06/27 15:40:29 tmraz Exp $
|
# $Id: smartd.initd,v 1.4 2006/11/07 10:19:40 tmraz Exp $
|
||||||
|
|
||||||
# For RedHat and cousins:
|
# For RedHat and cousins:
|
||||||
# chkconfig: 2345 99 01
|
# chkconfig: 2345 99 01
|
||||||
@ -37,7 +37,7 @@ case "$1" in
|
|||||||
start | reload | restart)
|
start | reload | restart)
|
||||||
GEN_CONF="*SMARTD*AUTOGENERATED*"
|
GEN_CONF="*SMARTD*AUTOGENERATED*"
|
||||||
[ ! -f /etc/smartd.conf ] || read DUMMY GEN_CONF DUMMY </etc/smartd.conf \
|
[ ! -f /etc/smartd.conf ] || read DUMMY GEN_CONF DUMMY </etc/smartd.conf \
|
||||||
&& [ $GEN_CONF == "*SMARTD*AUTOGENERATED*" ] \
|
&& [ "$GEN_CONF" == "*SMARTD*AUTOGENERATED*" ] \
|
||||||
&& smartd-conf.py 2>/dev/null >/etc/smartd.conf.new-autogenerated \
|
&& smartd-conf.py 2>/dev/null >/etc/smartd.conf.new-autogenerated \
|
||||||
&& mv -f /etc/smartd.conf.new-autogenerated /etc/smartd.conf
|
&& mv -f /etc/smartd.conf.new-autogenerated /etc/smartd.conf
|
||||||
;;
|
;;
|
||||||
|
53
smartmontools-5.36-cloexec.patch
Normal file
53
smartmontools-5.36-cloexec.patch
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
--- smartmontools-5.36/os_linux.c.cloexec 2006-05-11 09:41:12.000000000 +0200
|
||||||
|
+++ smartmontools-5.36/os_linux.c 2006-11-07 10:02:55.000000000 +0100
|
||||||
|
@@ -183,14 +183,14 @@
|
||||||
|
|
||||||
|
// equivalent to open(path, flags)
|
||||||
|
int deviceopen(const char *pathname, char *type){
|
||||||
|
+ int fd = -1;
|
||||||
|
if (!strcmp(type,"SCSI")) {
|
||||||
|
- int fd = open(pathname, O_RDWR | O_NONBLOCK);
|
||||||
|
+ fd = open(pathname, O_RDWR | O_NONBLOCK);
|
||||||
|
if (fd < 0 && errno == EROFS)
|
||||||
|
fd = open(pathname, O_RDONLY | O_NONBLOCK);
|
||||||
|
- return fd;
|
||||||
|
}
|
||||||
|
else if (!strcmp(type,"ATA"))
|
||||||
|
- return open(pathname, O_RDONLY | O_NONBLOCK);
|
||||||
|
+ fd = open(pathname, O_RDONLY | O_NONBLOCK);
|
||||||
|
else if (!strcmp(type,"ATA_3WARE_9000")) {
|
||||||
|
// the device nodes for this controller are dynamically assigned,
|
||||||
|
// so we need to check that they exist with the correct major
|
||||||
|
@@ -200,7 +200,7 @@
|
||||||
|
errno=ENXIO;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
- return open(pathname, O_RDONLY | O_NONBLOCK);
|
||||||
|
+ fd = open(pathname, O_RDONLY | O_NONBLOCK);
|
||||||
|
}
|
||||||
|
else if (!strcmp(type,"ATA_3WARE_678K")) {
|
||||||
|
// the device nodes for this controller are dynamically assigned,
|
||||||
|
@@ -211,17 +211,21 @@
|
||||||
|
errno=ENXIO;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
- return open(pathname, O_RDONLY | O_NONBLOCK);
|
||||||
|
+ fd = open(pathname, O_RDONLY | O_NONBLOCK);
|
||||||
|
}
|
||||||
|
// cciss+
|
||||||
|
else if(!strcmp(type, "CCISS"))
|
||||||
|
{
|
||||||
|
// the device is a cciss smart array device.
|
||||||
|
- return open(pathname, O_RDWR | O_NONBLOCK);
|
||||||
|
+ fd = open(pathname, O_RDWR | O_NONBLOCK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
+ if (fd != -1) {
|
||||||
|
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||||
|
+ }
|
||||||
|
+ return fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
// equivalent to close(file descriptor)
|
57
smartmontools-5.36-sata.patch
Normal file
57
smartmontools-5.36-sata.patch
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
--- smartmontools-5.33/scsicmds.c.sata 2004-09-05 22:57:43.000000000 +0200
|
||||||
|
+++ smartmontools-5.33/scsicmds.c 2006-10-25 20:38:01.000000000 +0200
|
||||||
|
@@ -1979,11 +1979,15 @@
|
||||||
|
int k, id_len, c_set, assoc, id_type, i_len;
|
||||||
|
unsigned char * ucp;
|
||||||
|
unsigned char * ip;
|
||||||
|
+ unsigned char buff1[20];
|
||||||
|
+ unsigned char buff2[20];
|
||||||
|
|
||||||
|
if (len < 4) {
|
||||||
|
/* Device identification VPD page length too short */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
+ buff1[0] = '\0';
|
||||||
|
+ buff2[0] = '\0';
|
||||||
|
len -= 4;
|
||||||
|
ucp = vpd_di_buff + 4;
|
||||||
|
for (k = 0; k < len; k += id_len, ucp += id_len) {
|
||||||
|
@@ -1997,9 +2001,24 @@
|
||||||
|
c_set = (ucp[0] & 0xf);
|
||||||
|
assoc = ((ucp[1] >> 4) & 0x3);
|
||||||
|
id_type = (ucp[1] & 0xf);
|
||||||
|
- if ((0 == id_type) && (2 == c_set) && (0 == assoc) &&
|
||||||
|
- (0 == strncmp((const char *)ip,
|
||||||
|
- "Linux ATA-SCSI simulator", i_len))) {
|
||||||
|
+ if ((0 == id_type) && (2 == c_set) && (0 == assoc)) {
|
||||||
|
+ /* assoc=lu, c_set=ascii, id_type=vendor */
|
||||||
|
+ if (0 == strncmp((const char *)ip,
|
||||||
|
+ "Linux ATA-SCSI simulator", i_len)) {
|
||||||
|
+ /* until lk 2.6.16 */
|
||||||
|
+ return 1;
|
||||||
|
+ }
|
||||||
|
+ memcpy(buff1, ip, sizeof(buff1));
|
||||||
|
+ }
|
||||||
|
+ if ((1 == id_type) && (2 == c_set) && (0 == assoc)) {
|
||||||
|
+ /* assoc=lu, c_set=ascii, id_type=t10 vendor id */
|
||||||
|
+ if (0 == strncmp((const char *)ip, "ATA", 3))
|
||||||
|
+ memcpy(buff2, ip + 48, sizeof(buff2));
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if (buff1[0] && buff2[0]) {
|
||||||
|
+ if (0 == memcmp(buff1, buff2, sizeof(buff1))) {
|
||||||
|
+ /* after lk 2.6.16, look for serial number match */
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--- smartmontools-5.33/scsiprint.c.sata 2004-09-06 07:44:54.000000000 +0200
|
||||||
|
+++ smartmontools-5.33/scsiprint.c 2006-10-25 20:47:58.000000000 +0200
|
||||||
|
@@ -739,7 +739,7 @@
|
||||||
|
/* <<<< This is Linux specific code to detect SATA disks using a
|
||||||
|
SCSI-ATA command translation layer. This may be generalized
|
||||||
|
later when the t10.org SAT project matures. >>>> */
|
||||||
|
- req_len = 96;
|
||||||
|
+ req_len = 252;
|
||||||
|
memset(gBuf, 0, req_len);
|
||||||
|
if ((err = scsiInquiryVpd(device, 0x83, gBuf, req_len))) {
|
||||||
|
PRINT_ON(con);
|
@ -1,7 +1,7 @@
|
|||||||
Summary: Tools for monitoring SMART capable hard disks
|
Summary: Tools for monitoring SMART capable hard disks
|
||||||
Name: smartmontools
|
Name: smartmontools
|
||||||
Version: 5.36
|
Version: 5.36
|
||||||
Release: 3
|
Release: 4%{?dist}
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
License: GPL
|
License: GPL
|
||||||
@ -12,6 +12,8 @@ Source2: smartd.initd
|
|||||||
Source3: smartd-conf.py
|
Source3: smartd-conf.py
|
||||||
Source4: smartmontools.sysconf
|
Source4: smartmontools.sysconf
|
||||||
Patch1: http://people.fedora.de/rsc/smartmontools-5.36-cciss.patch
|
Patch1: http://people.fedora.de/rsc/smartmontools-5.36-cciss.patch
|
||||||
|
Patch2: smartmontools-5.36-cloexec.patch
|
||||||
|
Patch3: smartmontools-5.36-sata.patch
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||||
PreReq: /sbin/chkconfig /sbin/service
|
PreReq: /sbin/chkconfig /sbin/service
|
||||||
@ -76,6 +78,11 @@ exit 0
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 7 2006 Tomas Mraz <tmraz@redhat.com> - 1:5.36-4
|
||||||
|
- set cloexec on device descriptor so it doesn't leak to sendmail (#214182)
|
||||||
|
- fixed minor bug in initscript (#213683)
|
||||||
|
- backported SATA disk detection from upstream
|
||||||
|
|
||||||
* Fri Aug 18 2006 Jesse Keating <jkeating@redhat.com> - 1:5.36-3
|
* Fri Aug 18 2006 Jesse Keating <jkeating@redhat.com> - 1:5.36-3
|
||||||
- rebuilt with latest binutils to pick up 64K -z commonpagesize on ppc*
|
- rebuilt with latest binutils to pick up 64K -z commonpagesize on ppc*
|
||||||
(#203001)
|
(#203001)
|
||||||
|
Loading…
Reference in New Issue
Block a user