rpms/smartmontools/devel smartd-conf.py, 1.11, 1.12 smartmontools-5.37-addrinfo.patch, 1.1, 1.2 smartmontools.spec, 1.36, 1.37
Tomas Smetana (tsmetana)
fedora-extras-commits at redhat.com
Wed Oct 31 07:43:33 UTC 2007
Author: tsmetana
Update of /cvs/pkgs/rpms/smartmontools/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9241
Modified Files:
smartd-conf.py smartmontools-5.37-addrinfo.patch
smartmontools.spec
Log Message:
* Wed Oct 31 2007 Tomas Smetana <tsmetana at redhat.com> - 1:5.37-8
- fix #359561 - typo in smartd-conf.py causes smartd to skip all disks
Index: smartd-conf.py
===================================================================
RCS file: /cvs/pkgs/rpms/smartmontools/devel/smartd-conf.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- smartd-conf.py 4 Sep 2007 11:59:22 -0000 1.11
+++ smartd-conf.py 31 Oct 2007 07:42:56 -0000 1.12
@@ -87,7 +87,7 @@
if float(getfile("/sys/module/libata/version")) < 1.20:
comment = "# not yet supported in this kernel version\n# "
if not comment:
- status = os.system("/usr/sbin/smartctl -s on -i %s%s 2>&1 >/dev/null" %
+ status = os.system("/usr/sbin/smartctl -s on -i %s %s 2>&1 >/dev/null" %
(driver, drive.device))
if not os.WIFEXITED(status) or os.WEXITSTATUS(status) != 0:
comment = "# smartctl -i returns error for this drive\n# "
smartmontools-5.37-addrinfo.patch:
Index: smartmontools-5.37-addrinfo.patch
===================================================================
RCS file: /cvs/pkgs/rpms/smartmontools/devel/smartmontools-5.37-addrinfo.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- smartmontools-5.37-addrinfo.patch 12 Oct 2007 13:25:59 -0000 1.1
+++ smartmontools-5.37-addrinfo.patch 31 Oct 2007 07:42:56 -0000 1.2
@@ -1,38 +1,55 @@
---- smartmontools-5.37/smartd.cpp.addrinfo 2007-10-12 13:09:55.000000000 +0200
-+++ smartmontools-5.37/smartd.cpp 2007-10-12 13:11:41.000000000 +0200
-@@ -499,14 +499,28 @@
+Written-by: Tomas Smetana <tsmetana at redhat.com>
+Reviewed-by: Tomas Janousek <tjanouse at redhat.com>
+Reviewed-by: Karel Zak <kzak at redhat.com>
+
+--- smartmontools-5.37/smartd.cpp.addrinfo 2007-10-15 16:53:37.000000000 +0200
++++ smartmontools-5.37/smartd.cpp 2007-10-15 16:54:18.000000000 +0200
+@@ -498,7 +498,28 @@
+
char* dnsdomain(const char* hostname) {
char *p = NULL;
- #ifdef HAVE_GETHOSTBYNAME
-- struct hostent *hp;
--
-- if ((hp = gethostbyname(hostname))) {
-- // Does this work if gethostbyname() returns an IPv6 name in
-- // colon/dot notation? [BA]
-- if ((p = strchr(hp->h_name, '.')))
-- p++; // skip "."
-+ /* This is a Fedora specific patch. We KNOW that there is getaddrinfo
-+ * and getnameinfo. This part is not portable. */
+-#ifdef HAVE_GETHOSTBYNAME
++#ifdef HAVE_GETADDRINFO
+ static char canon_name[NI_MAXHOST];
-+ struct addrinfo *info;
++ struct addrinfo *info = NULL;
++ struct addrinfo hints;
+ int err;
+
-+ if (err = getaddrinfo(hostname, NULL, NULL, &info)) {
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_flags = AI_CANONNAME;
++ if ((err = getaddrinfo(hostname, NULL, &hints, &info)) || (!info)) {
+ PrintOut(LOG_CRIT, "Error retrieving info for %s: %s\n",
+ hostname, gai_strerror(err));
+ return NULL;
+ }
-+ canon_name[0] = '\0';
-+ if (err = getnameinfo(info->ai_addr, sizeof(struct sockaddr),
-+ canon_name, sizeof(canon_name), NULL, 0, 0)) {
-+ PrintOut(LOG_CRIT, "Error retrieving name info for %s: %s\n",
-+ hostname, gai_strerror(err));
-+ return NULL;
- }
++ if (info->ai_canonname) {
++ strncpy(canon_name, info->ai_canonname, sizeof(canon_name));
++ canon_name[NI_MAXHOST - 1] = '\0';
++ p = canon_name;
++ if((p = strchr(canon_name, '.')))
++ p++;
++ }
+ freeaddrinfo(info);
-+ p = canon_name;
-+ if ((p = strchr(p, '.')))
-+ p++;
++#elif HAVE_GETHOSTBYNAME
+ struct hostent *hp;
+
+ if ((hp = gethostbyname(hostname))) {
+@@ -506,7 +527,7 @@
+ // colon/dot notation? [BA]
+ if ((p = strchr(hp->h_name, '.')))
+ p++; // skip "."
+- }
++ }
#else
ARGUSED(hostname);
#endif
+--- smartmontools-5.37/configure.in.addrinfo 2006-12-20 21:39:25.000000000 +0100
++++ smartmontools-5.37/configure.in 2007-10-15 16:53:37.000000000 +0200
+@@ -70,6 +70,7 @@
+ AC_CHECK_FUNCS([getopt_long])
+ AC_CHECK_FUNCS([getdomainname])
+ AC_CHECK_FUNCS([gethostname])
++AC_CHECK_FUNCS([getaddrinfo])
+ AC_CHECK_FUNCS([gethostbyname])
+ AC_CHECK_FUNCS([sigset])
+ AC_CHECK_FUNCS([strtoull])
Index: smartmontools.spec
===================================================================
RCS file: /cvs/pkgs/rpms/smartmontools/devel/smartmontools.spec,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- smartmontools.spec 12 Oct 2007 13:25:59 -0000 1.36
+++ smartmontools.spec 31 Oct 2007 07:42:56 -0000 1.37
@@ -1,7 +1,7 @@
Summary: Tools for monitoring SMART capable hard disks
Name: smartmontools
Version: 5.37
-Release: 7%{?dist}
+Release: 8%{?dist}
Epoch: 1
Group: System Environment/Base
License: GPLv2+
@@ -45,6 +45,7 @@
%patch3 -p1 -b .addrinfo
%build
+./autogen.sh
%configure
make CFLAGS="$RPM_OPT_FLAGS -fpie" LDFLAGS="-fpie -Wl,-z,relro,-z,now"
@@ -93,6 +94,12 @@
%exclude %{_sbindir}/smartd-conf.py[co]
%changelog
+* Wed Oct 31 2007 Tomas Smetana <tsmetana at redhat.com> - 1:5.37-8
+- fix #359561 - typo in smartd-conf.py causes smartd to skip all disks
+
+* Mon Oct 15 2007 Tomas Smetana <tsmetana at redhat.com> - 1:5.37-7.1
+- improved patch for getaddrinfo
+
* Fri Oct 12 2007 Tomas Smetana <tsmetana at redhat.com> - 1:5.37-7
- replace gethostbyname with getaddrinfo
More information about the fedora-extras-commits
mailing list