Applied -gethost patch to check return value
(rhbz#698619)
This commit is contained in:
parent
79b5fd34e0
commit
ba4fef6209
33
yp-tools-2.12-gethost.patch
Normal file
33
yp-tools-2.12-gethost.patch
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -1,13 +1,14 @@
|
|||||||
Summary: NIS (or YP) client programs
|
Summary: NIS (or YP) client programs
|
||||||
Name: yp-tools
|
Name: yp-tools
|
||||||
Version: 2.12
|
Version: 2.12
|
||||||
Release: 5%{?dist}
|
Release: 6%{?dist}
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Source: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/yp-tools-%{version}.tar.bz2
|
Source: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/yp-tools-%{version}.tar.bz2
|
||||||
# Not sent to upstream
|
# Not sent to upstream
|
||||||
Patch0: yp-tools-2.11-shadow.patch
|
Patch0: yp-tools-2.11-shadow.patch
|
||||||
Patch1: yp-tools-2.12-typo.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
|
Url: http://www.linux-nis.org/nis/yp-tools/index.html
|
||||||
Requires: ypbind
|
Requires: ypbind
|
||||||
|
|
||||||
@ -35,6 +36,7 @@ you'll need to install the ypserv package on one machine on the network.
|
|||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1 -b .shadow
|
%patch0 -p1 -b .shadow
|
||||||
%patch1 -p1 -b .typo
|
%patch1 -p1 -b .typo
|
||||||
|
%patch2 -p1 -b .gethost
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure --disable-domainname
|
%configure --disable-domainname
|
||||||
@ -56,6 +58,10 @@ make DESTDIR="$RPM_BUILD_ROOT" INSTALL_PROGRAM=install install
|
|||||||
/var/yp/nicknames
|
/var/yp/nicknames
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed May 04 2011 Honza Horak <hhorak@redhat.com> - 2.12-6
|
||||||
|
- Applied -gethost patch to check return value
|
||||||
|
(rhbz#698619)
|
||||||
|
|
||||||
* Fri Mar 18 2011 Honza Horak <hhorak@redhat.com> - 2.12-5
|
* Fri Mar 18 2011 Honza Horak <hhorak@redhat.com> - 2.12-5
|
||||||
- Applied -typo patch to fix a grammar mistake
|
- Applied -typo patch to fix a grammar mistake
|
||||||
(rhbz#668743)
|
(rhbz#668743)
|
||||||
|
Loading…
Reference in New Issue
Block a user