[yp-tools/f14/master] Fixed segmentation fault in yppoll used without hostname (rhbz#698619) Fixed man page typo

Jan Horak hhorak at fedoraproject.org
Thu May 5 08:15:41 UTC 2011


commit 9e38a661d907b446c1b60ead67f642eb7c3a133f
Author: Honza Horák <hhorak at redhat.com>
Date:   Thu May 5 10:15:20 2011 +0200

    Fixed segmentation fault in yppoll used without hostname
    (rhbz#698619)
    Fixed man page typo

 yp-tools-2.11-gethost.patch |   34 ++++++++++++++++++++++++++++++++++
 yp-tools-2.11-typo.patch    |   12 ++++++++++++
 yp-tools.spec               |   13 ++++++++++++-
 3 files changed, 58 insertions(+), 1 deletions(-)
---
diff --git a/yp-tools-2.11-gethost.patch b/yp-tools-2.11-gethost.patch
new file mode 100644
index 0000000..ec8bbdc
--- /dev/null
+++ b/yp-tools-2.11-gethost.patch
@@ -0,0 +1,34 @@
+diff -up yp-tools-2.11/.gethost.orig yp-tools-2.11/.gethost
+diff -up yp-tools-2.11/src/yppoll.c.orig yp-tools-2.11/src/yppoll.c
+--- yp-tools-2.11/src/yppoll.c.orig	2011-05-05 09:57:26.528805348 +0200
++++ yp-tools-2.11/src/yppoll.c	2011-05-05 10:00:28.256533438 +0200
+@@ -218,7 +218,10 @@ main (int argc, char **argv)
+ 
+       hent = gethostbyaddr ((char *)&clnt_saddr.sin_addr.s_addr,
+ 			    sizeof (clnt_saddr.sin_addr.s_addr), AF_INET);
+-      hostname = strdup (hent->h_name);
++      if (hent)
++        {
++          hostname = strdup (hent->h_name);
++        }
+     }
+   else
+     {
+@@ -261,7 +264,7 @@ main (int argc, char **argv)
+ 			   &clnt_sock);
+   if (client == NULL)
+     {
+-      fprintf (stderr, _("Can't create connection to %s.\n"), hostname);
++      fprintf (stderr, _("Can't create connection to %s.\n"), hostname ? hostname : "unknown");
+       return 1;
+     }
+ 
+@@ -279,7 +282,7 @@ main (int argc, char **argv)
+   if (clnt_res != TRUE)
+     {
+       fprintf (stdout, _("Domain %s is not supported by %s.\n"), domainname,
+-	       hostname);
++	       hostname ? hostname : "unknown");
+       return 1;
+     }
+ 
diff --git a/yp-tools-2.11-typo.patch b/yp-tools-2.11-typo.patch
new file mode 100644
index 0000000..ed50b88
--- /dev/null
+++ b/yp-tools-2.11-typo.patch
@@ -0,0 +1,12 @@
+diff -up yp-tools-2.11/man/ypmatch.1.in.typo yp-tools-2.11/man/ypmatch.1.in
+--- yp-tools-2.11/man/ypmatch.1.in.typo	2011-05-05 09:52:14.754703060 +0200
++++ yp-tools-2.11/man/ypmatch.1.in	2011-05-05 09:52:25.240571968 +0200
+@@ -5,7 +5,7 @@
+ .\"
+ .\" This program is free software; you can redistribute it and/or modify
+ .\" it under the terms of the GNU General Public License version 2 as
+-.\"  published bythe Free Software Foundation.
++.\" published by the Free Software Foundation.
+ .\"
+ .\" This program is distributed in the hope that it will be useful,
+ .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/yp-tools.spec b/yp-tools.spec
index ff68e65..b4acb8c 100644
--- a/yp-tools.spec
+++ b/yp-tools.spec
@@ -1,12 +1,14 @@
 Summary: NIS (or YP) client programs
 Name: yp-tools
 Version: 2.11
-Release: 4%{?dist}
+Release: 6%{?dist}
 License: GPLv2
 Group: System Environment/Base
 Source: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/yp-tools-%{version}.tar.bz2
 # Not sent to upstream
 Patch0: yp-tools-2.11-shadow.patch
+Patch1: yp-tools-2.11-typo.patch
+Patch2: yp-tools-2.11-gethost.patch
 Url: http://www.linux-nis.org/nis/yp-tools/index.html
 Requires: ypbind
 
@@ -33,6 +35,8 @@ you'll need to install the ypserv package on one machine on the network.
 %prep
 %setup -q
 %patch0 -p1 -b .shadow
+%patch1 -p1 -b .typo
+%patch2 -p1 -b .gethost
 
 %build
 %configure --disable-domainname
@@ -54,6 +58,13 @@ make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install
 /var/yp/nicknames
 
 %changelog
+* Thu May 05 2011 Honza Horak <hhorak at redhat.com> - 2.11-6
+- Fixed segmentation fault in yppoll used without hostname
+  (rhbz#698619)
+
+* Thu May 05 2011 Honza Horak <hhorak at redhat.com> - 2.11-5
+- Fixed man page typo
+
 * Tue Nov 23 2010 Karel Klic <kklic at redhat.com> - 2.11-4
 - Reverted previous change
 


More information about the scm-commits mailing list