From ba4fef62091b90df5afda3cf41da5da492a7d793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Hor=C3=A1k?= Date: Wed, 4 May 2011 17:07:49 +0200 Subject: [PATCH] Applied -gethost patch to check return value (rhbz#698619) --- yp-tools-2.12-gethost.patch | 33 +++++++++++++++++++++++++++++++++ yp-tools.spec | 8 +++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 yp-tools-2.12-gethost.patch diff --git a/yp-tools-2.12-gethost.patch b/yp-tools-2.12-gethost.patch new file mode 100644 index 0000000..afe782d --- /dev/null +++ b/yp-tools-2.12-gethost.patch @@ -0,0 +1,33 @@ +diff -up yp-tools-2.12/src/yppoll.c.gethost yp-tools-2.12/src/yppoll.c +--- yp-tools-2.12/src/yppoll.c.gethost 2001-12-08 20:59:10.000000000 +0100 ++++ yp-tools-2.12/src/yppoll.c 2011-05-04 16:18:08.371772310 +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.spec b/yp-tools.spec index 6394cff..c705a15 100644 --- a/yp-tools.spec +++ b/yp-tools.spec @@ -1,13 +1,14 @@ Summary: NIS (or YP) client programs Name: yp-tools Version: 2.12 -Release: 5%{?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.12-typo.patch +Patch2: yp-tools-2.12-gethost.patch Url: http://www.linux-nis.org/nis/yp-tools/index.html Requires: ypbind @@ -35,6 +36,7 @@ you'll need to install the ypserv package on one machine on the network. %setup -q %patch0 -p1 -b .shadow %patch1 -p1 -b .typo +%patch2 -p1 -b .gethost %build %configure --disable-domainname @@ -56,6 +58,10 @@ make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install /var/yp/nicknames %changelog +* Wed May 04 2011 Honza Horak - 2.12-6 +- Applied -gethost patch to check return value + (rhbz#698619) + * Fri Mar 18 2011 Honza Horak - 2.12-5 - Applied -typo patch to fix a grammar mistake (rhbz#668743)