- update to 3.1.0 (#187372)

This commit is contained in:
Nalin Dahyabhai 2006-03-30 18:58:28 +00:00
parent 2fd330f35e
commit 7a7f463bbb
6 changed files with 104 additions and 24 deletions

View File

@ -1 +1,2 @@
hesiod-3.0.2.tar.gz
hesiod-3.1.0.tar.gz

View File

@ -0,0 +1,49 @@
If the response is larger than 1024 bytes, go ahead and retry.
--- hesiod-3.1.0/hesiod.c 2006-03-30 13:22:57.000000000 -0500
+++ hesiod-3.1.0/hesiod.c 2006-03-30 13:28:16.000000000 -0500
@@ -327,7 +327,8 @@
*/
static char **get_txt_records(struct hesiod_p *ctx, const char *name)
{
- unsigned char qbuf[PACKETSZ], abuf[MAX_HESRESP];
+ unsigned char qbuf[PACKETSZ], *abuf;
+ char **tmp;
- int n;
+ int n, i, len;
/* Make sure the resolver is initialized. */
@@ -343,14 +344,30 @@
}
/* Send the query. */
- n = res_send(qbuf, n, abuf, MAX_HESRESP);
- if (n < 0)
+ abuf = NULL;
+ len = 1024;
+ i = n;
+ do
+ {
+ abuf = realloc(abuf, len);
+ n = res_send(qbuf, i, abuf, len);
+ if (n < len)
+ {
+ break;
+ }
+ len = n + 1024;
+ } while(1);
+ if (n < sizeof(HEADER))
{
errno = ECONNREFUSED;
return NULL;
}
- return hesiod_parse_result(ctx, abuf, n);
+ tmp = hesiod_parse_result(ctx, abuf, n);
+
+ free(abuf);
+
+ return tmp;
}
char **hesiod_parse_result(void *ctx, const unsigned char *abuf, int alen)

View File

@ -0,0 +1,17 @@
Try to correctly find res_mkquery in libresolv, even in cases where a
preprocessor-based rename in <resolv.h> may screw us up.
--- hesiod-3.1.0/configure.in 2006-03-30 11:22:11.000000000 -0500
+++ hesiod-3.1.0/configure.in 2006-03-30 13:31:02.000000000 -0500
@@ -12,7 +12,11 @@
AC_EGREP_HEADER(pw_change, pwd.h, AC_DEFINE(HAVE_PW_CHANGE))
AC_EGREP_HEADER(pw_expire, pwd.h, AC_DEFINE(HAVE_PW_EXPIRE))
-AC_CHECK_FUNC(res_mkquery, :, [AC_CHECK_LIB(resolv, res_mkquery)])
+AC_CHECK_FUNC(res_mkquery, :, [AC_CHECK_LIB(resolv, res_mkquery,,[
+saveLIBS="$LIBS"
+LIBS="-lresolv $LIBS"
+AC_TRY_LINK([#include <resolv.h>],[res_mkquery(0,NULL,0,0,NULL,0,NULL,NULL,0);],[AC_DEFINE(HAVE_RES_MKQUERY,1,[Define if your libresolv provides res_mkquery.])],[LIBS="$saveLIBS"])
+])])
AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)

25
hesiod-3.1.0-str.patch Normal file
View File

@ -0,0 +1,25 @@
One or both strings is supplied through a configuration file, so we have no
guarantees about its length.
--- hesiod-3.1.0/hesservbyname.c 2006-03-30 11:22:11.000000000 -0500
+++ hesiod-3.1.0/hesservbyname.c 2006-03-30 13:13:50.000000000 -0500
@@ -187,7 +187,7 @@
static int cistrcmp(const char *s1, const char *s2)
{
- while (*s1 && tolower(*s1) == tolower(*s2))
+ while (*s1 && *s2 && tolower(*s1) == tolower(*s2))
{
s1++;
s2++;
--- hesiod-3.1.0/hesiod.c 2006-03-30 13:13:50.000000000 -0500
+++ hesiod-3.1.0/hesiod.c 2006-03-30 13:19:03.000000000 -0500
@@ -465,7 +465,7 @@
static int cistrcmp(const char *s1, const char *s2)
{
- while (*s1 && tolower(*s1) == tolower(*s2))
+ while (*s1 && *s2 && tolower(*s1) == tolower(*s2))
{
s1++;
s2++;

View File

@ -1,17 +1,16 @@
Name: hesiod
Version: 3.0.2
Release: 31.2.1
Version: 3.1.0
Release: 1
Source: ftp://athena-dist.mit.edu/pub/ATHENA/hesiod/hesiod-%{version}.tar.gz
Patch0: hesiod-3.0.2-shlib.patch
Patch1: hesiod-3.0.2-env.patch
Patch2: hesiod-3.0.2-str.patch
Patch3: hesiod-3.0.2-dnsparse.patch
Patch4: hesiod-3.0.2-libresolv.patch
Patch2: hesiod-3.1.0-str.patch
Patch3: hesiod-3.1.0-dnsparse.patch
Patch4: hesiod-3.1.0-libresolv.patch
Summary: Hesiod libraries and sample programs.
Group: System Environment/Libraries
License: MIT
Buildroot: %{_tmppath}/hesiod-root
BuildPrereq: autoconf
BuildRequires: autoconf
%description
Hesiod is a system which uses existing DNS functionality to provide access
@ -33,6 +32,9 @@ ensure synchronize the files among multiple hosts. This package contains
the header files and libraries required for building programs which use Hesiod.
%changelog
* Thu Mar 30 2006 Nalin Dahyabhai <nalin@redhat.com> - 3.1.0-1
- update to 3.1.0 (#187372)
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 3.0.2-31.2.1
- bump again for double-long bug on ppc(64)
@ -148,24 +150,11 @@ the header files and libraries required for building programs which use Hesiod.
%prep
%setup -q
%patch0 -p1 -b .shlib
%patch1 -p1 -b .env
%patch2 -p1 -b .str
%patch3 -p1 -b .dnsparse
%patch4 -p1 -b .libresolv
autoconf
for manpage in *.3; do
if grep -q '^\.so man3/hesiod.3' $manpage ; then
echo .so hesiod.3 > $manpage
elif grep -q '^\.so man3/hesiod_getmailhost.3' $manpage ; then
echo .so hesiod_getmailhost.3 > $manpage
elif grep -q '^\.so man3/hesiod_getpwnam.3' $manpage ; then
echo .so hesiod_getpwnam.3 > $manpage
elif grep -q '^\.so man3/hesiod_getservbyname.3' $manpage ; then
echo .so hesiod_getservbyname.3 > $manpage
fi
done
%build
%configure
@ -173,7 +162,8 @@ make
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%makeinstall
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
%clean
rm -rf $RPM_BUILD_ROOT
@ -185,9 +175,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README NEWS
%{_bindir}/hesinfo
%{_libdir}/libhesiod.so.*
%{_mandir}/man1/*
%{_mandir}/man5/*
%files devel

View File

@ -1 +1 @@
0362311e80fb1e029a1588cbbd09ad57 hesiod-3.0.2.tar.gz
89c785d350e75d6628754659ee4583e8 hesiod-3.1.0.tar.gz