mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-03 01:23:49 +00:00
- Fix build
- Style PR: ports/101178 Submitted by: Michael Bushkov <bushman@rsu.ru> (maintainer)
This commit is contained in:
parent
24dbe06218
commit
3ec03bb237
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=174790
@ -12,30 +12,22 @@ MASTER_SITES= http://www.rsu.ru/~bushman/lookupd/downloads/
|
||||
MAINTAINER= bushman@rsu.ru
|
||||
COMMENT= Lookupd daemon - IPC nsswitch implementation with system-wide caching
|
||||
|
||||
INSTALLS_SHLIB= yes
|
||||
USE_RC_SUBR= yes
|
||||
USE_LDCONFIG= yes
|
||||
USE_RC_SUBR= lookupd
|
||||
SUB_FILES= pkg-message
|
||||
|
||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||
STARTUPSCRIPT= ${WRKDIR}/lookupd.sh
|
||||
MAKE_ENV= WARNS=0
|
||||
|
||||
MAN5= lookupd.conf.5
|
||||
MAN8= lookupd.8
|
||||
|
||||
post-install:
|
||||
@${SED} -e 's|%%PREFIX%%|${PREFIX}|g' ${FILESDIR}/lookupd.sh > ${STARTUPSCRIPT}
|
||||
${INSTALL_SCRIPT} ${STARTUPSCRIPT} ${PREFIX}/etc/rc.d/lookupd.sh
|
||||
@${SED} -e "s|%%PREFIX%%|${PREFIX}|g" ${.CURDIR}/pkg-message > ${PKGMESSAGE}
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${OSVERSION} < 500112
|
||||
IGNORE= This version of lookupd is only supported on FreeBSD 5.1 or later
|
||||
.endif
|
||||
|
||||
.if ${OSVERSION} >= 601104
|
||||
BROKEN= Does not compile on FreeBSD >= 6.x
|
||||
IGNORE= is only supported on FreeBSD 5.1 or later
|
||||
.endif
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
@ -15,7 +15,7 @@
|
||||
# See lookupd(8) for flags
|
||||
#
|
||||
|
||||
. /etc/rc.subr
|
||||
. %%RC_SUBR%%
|
||||
|
||||
name=lookupd
|
||||
rcvar=`set_rcvar`
|
11
sysutils/lookupd/files/patch-modules-dns-Makefile
Normal file
11
sysutils/lookupd/files/patch-modules-dns-Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
--- modules/dns/Makefile.orig Tue Aug 1 18:10:57 2006
|
||||
+++ modules/dns/Makefile Tue Aug 1 18:11:07 2006
|
||||
@@ -6,7 +6,7 @@
|
||||
STRIP=
|
||||
SRCS= dns_ht.c dns_htinfo.c
|
||||
WARNS?=2
|
||||
-CFLAGS+=-pthread -I${.CURDIR}/../../include
|
||||
+CFLAGS+=-pthread -I${.CURDIR}/../../include -DINET6
|
||||
LDFLAGS+=-nostdlib
|
||||
NOMAN= 1
|
||||
|
117
sysutils/lookupd/files/patch-modules-dns-dns_ht.c
Normal file
117
sysutils/lookupd/files/patch-modules-dns-dns_ht.c
Normal file
@ -0,0 +1,117 @@
|
||||
--- modules/dns/dns_ht.c.orig Tue Aug 1 18:10:57 2006
|
||||
+++ modules/dns/dns_ht.c Tue Aug 1 18:11:07 2006
|
||||
@@ -32,7 +32,11 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "dns_ht.h"
|
||||
-#include "resolv/resolv.h"
|
||||
+
|
||||
+#ifndef res_hostalias
|
||||
+extern const char *_res_hostalias(const char *, char *, size_t);
|
||||
+#define res_hostalias(a, b, c, d) _res_hostalias(b, c, d)
|
||||
+#endif
|
||||
|
||||
#define SPRINTF(x) ((size_t)sprintf x)
|
||||
|
||||
@@ -58,6 +62,7 @@
|
||||
char ac;
|
||||
} align;
|
||||
|
||||
+#if 0
|
||||
pthread_key_t _res_key;
|
||||
pthread_key_t _res_ext_key;
|
||||
pthread_key_t _herrno_key;
|
||||
@@ -99,15 +104,18 @@
|
||||
}
|
||||
|
||||
extern void lookupd_res_send_init_keys();
|
||||
+#endif
|
||||
|
||||
void
|
||||
_init()
|
||||
{
|
||||
+#if 0
|
||||
pthread_key_create(&_res_key, NULL);
|
||||
pthread_key_create(&_res_ext_key, NULL);
|
||||
pthread_key_create(&_herrno_key, NULL);
|
||||
|
||||
lookupd_res_send_init_keys();
|
||||
+#endif
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -168,10 +176,10 @@
|
||||
switch (qtype) {
|
||||
case T_A:
|
||||
case T_AAAA:
|
||||
- name_ok = lookupd_res_hnok;
|
||||
+ name_ok = res_hnok;
|
||||
break;
|
||||
case T_PTR:
|
||||
- name_ok = lookupd_res_dnok;
|
||||
+ name_ok = res_dnok;
|
||||
break;
|
||||
default:
|
||||
h_errno = NO_RECOVERY;
|
||||
@@ -320,7 +328,7 @@
|
||||
continue; /* XXX - had_error++ ? */
|
||||
}
|
||||
n = dn_expand(answer->buf, eom, cp, bp, buflen);
|
||||
- if ((n < 0) || !lookupd_res_hnok(bp)) {
|
||||
+ if ((n < 0) || !res_hnok(bp)) {
|
||||
had_error++;
|
||||
break;
|
||||
}
|
||||
@@ -473,8 +481,9 @@
|
||||
char *bp;
|
||||
int n, size, type, len;
|
||||
struct hostent *hp;
|
||||
+ char abuf[MAXDNAME];
|
||||
|
||||
- if ((_res.options & RES_INIT) == 0 && lookupd_res_init() == -1) {
|
||||
+ if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
h_errno = NETDB_INTERNAL;
|
||||
return (NULL);
|
||||
}
|
||||
@@ -499,7 +508,8 @@
|
||||
/*
|
||||
* if there aren't any dots, it could be a user-level alias. this is also done in res_query() since we are not the only function that looks up host names.
|
||||
*/
|
||||
- if (!strchr(name, '.') && (cp = lookupd_hostalias(name)))
|
||||
+ if (!strchr(name, '.') &&
|
||||
+ (cp = res_hostalias(&_res, name, abuf, sizeof abuf)))
|
||||
name = cp;
|
||||
|
||||
/*
|
||||
@@ -572,7 +582,7 @@
|
||||
h_errno = NETDB_INTERNAL;
|
||||
return (NULL);
|
||||
}
|
||||
- n = lookupd_res_search(name, C_IN, type, buf->buf, sizeof(buf->buf));
|
||||
+ n = res_search(name, C_IN, type, buf->buf, sizeof(buf->buf));
|
||||
if (n < 0) {
|
||||
free(buf);
|
||||
dprintf("res_search failed %s %d (%d)\n", name, type, n);
|
||||
@@ -604,7 +614,7 @@
|
||||
char hname2[MAXDNAME + 1];
|
||||
#endif /* SUNSECURITY */
|
||||
|
||||
- if ((_res.options & RES_INIT) == 0 && lookupd_res_init() == -1) {
|
||||
+ if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
h_errno = NETDB_INTERNAL;
|
||||
return (NULL);
|
||||
}
|
||||
@@ -659,11 +669,11 @@
|
||||
h_errno = NETDB_INTERNAL;
|
||||
return (NULL);
|
||||
}
|
||||
- n = lookupd_res_query(qbuf, C_IN, T_PTR, (u_char *) buf->buf, sizeof buf->buf);
|
||||
+ n = res_query(qbuf, C_IN, T_PTR, (u_char *) buf->buf, sizeof buf->buf);
|
||||
if (n < 0 && af == AF_INET6) {
|
||||
*qp = '\0';
|
||||
strlcat(qbuf, "ip6.int", sizeof(qbuf));
|
||||
- n = lookupd_res_query(qbuf, C_IN, T_PTR, (u_char *) buf->buf,
|
||||
+ n = res_query(qbuf, C_IN, T_PTR, (u_char *) buf->buf,
|
||||
sizeof buf->buf);
|
||||
}
|
||||
if (n < 0) {
|
10
sysutils/lookupd/files/patch-modules-dns-resolv-Makefile.inc
Normal file
10
sysutils/lookupd/files/patch-modules-dns-resolv-Makefile.inc
Normal file
@ -0,0 +1,10 @@
|
||||
--- modules/dns/resolv/Makefile.inc.orig Tue Aug 1 18:10:57 2006
|
||||
+++ modules/dns/resolv/Makefile.inc Tue Aug 1 18:11:07 2006
|
||||
@@ -1,6 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/resolv
|
||||
-SRCS+=getaddrinfo.c res_comp.c res_mkquery.c res_send.c herror.c \
|
||||
- res_data.c res_mkupdate.c res_update.c \
|
||||
- name6.c res_init.c res_query.c
|
||||
+SRCS+=getaddrinfo.c name6.c
|
File diff suppressed because it is too large
Load Diff
97
sysutils/lookupd/files/patch-modules-dns-resolv-name6.c
Normal file
97
sysutils/lookupd/files/patch-modules-dns-resolv-name6.c
Normal file
@ -0,0 +1,97 @@
|
||||
--- modules/dns/resolv/name6.c.orig Tue Aug 1 18:10:57 2006
|
||||
+++ modules/dns/resolv/name6.c Tue Aug 1 18:11:07 2006
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <arpa/nameser.h>
|
||||
|
||||
#include <errno.h>
|
||||
+#include <resolv.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -54,7 +55,6 @@
|
||||
#include "namespace.h"
|
||||
#include "un-namespace.h"
|
||||
#include "../dns_ht.h"
|
||||
-#include "resolv.h"
|
||||
|
||||
|
||||
#ifndef _PATH_HOSTS
|
||||
@@ -103,6 +103,11 @@
|
||||
#define map_inaddr map_addr_un.mau_inaddr
|
||||
};
|
||||
|
||||
+#ifndef res_hostalias
|
||||
+extern const char *_res_hostalias(const char *, char *, size_t);
|
||||
+#define res_hostalias(a, b, c, d) _res_hostalias(b, c, d)
|
||||
+#endif
|
||||
+
|
||||
static struct hostent *_hpcopy(struct hostent * hp);
|
||||
static struct hostent *_hpmerge(struct hostent * hp1, struct hostent * hp2);
|
||||
#ifdef INET6
|
||||
@@ -284,7 +289,7 @@
|
||||
hp6->h_addrtype = AF_INET6;
|
||||
hp6->h_length = sizeof(struct in6_addr);
|
||||
hp6->h_addr_list = NULL;
|
||||
- return _hpmerge(hp6, hp, errp);
|
||||
+ return _hpmerge(hp6, hp);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -358,10 +363,10 @@
|
||||
switch (qtype) {
|
||||
case T_A:
|
||||
case T_AAAA:
|
||||
- name_ok = lookupd_res_hnok;
|
||||
+ name_ok = res_hnok;
|
||||
break;
|
||||
case T_PTR:
|
||||
- name_ok = lookupd_res_dnok;
|
||||
+ name_ok = res_dnok;
|
||||
break;
|
||||
default:
|
||||
return (NULL); /* XXX should be abort(); */
|
||||
@@ -450,7 +455,7 @@
|
||||
}
|
||||
if (qtype == T_PTR && type == T_CNAME) {
|
||||
n = dn_expand(answer->buf, eom, cp, tbuf, sizeof tbuf);
|
||||
- if (n < 0 || !lookupd_res_dnok(tbuf)) {
|
||||
+ if (n < 0 || !res_dnok(tbuf)) {
|
||||
had_error++;
|
||||
continue;
|
||||
}
|
||||
@@ -476,7 +481,7 @@
|
||||
DNS_ASSERT(strcasecmp(tname, bp) == 0);
|
||||
n = dn_expand(answer->buf, eom, cp, bp, ep - bp);
|
||||
DNS_FATAL(n >= 0);
|
||||
- DNS_FATAL(lookupd_res_hnok(bp));
|
||||
+ DNS_FATAL(res_hnok(bp));
|
||||
#if MULTI_PTRS_ARE_ALIASES
|
||||
cp += n;
|
||||
if (cp != erdata) {
|
||||
@@ -574,6 +579,7 @@
|
||||
int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
|
||||
struct __res_type_list *rtl0 = rtl;
|
||||
querybuf *buf;
|
||||
+ char abuf[MAXDNAME];
|
||||
|
||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
|
||||
h_errno = NETDB_INTERNAL;
|
||||
@@ -592,7 +598,8 @@
|
||||
return NULL;
|
||||
}
|
||||
/* If there aren't any dots, it could be a user-level alias */
|
||||
- if (!dots && (cp = lookupd_hostalias(name)) != NULL) {
|
||||
+ if (!dots &&
|
||||
+ (cp = res_hostalias(&_res, name, abuf, sizeof(abuf))) != NULL) {
|
||||
for (rtl = rtl0; rtl != NULL;
|
||||
rtl = SLIST_NEXT(rtl, rtl_entry)) {
|
||||
ret = res_query(cp, C_IN, rtl->rtl_type, buf->buf,
|
||||
@@ -866,7 +873,7 @@
|
||||
break;
|
||||
}
|
||||
|
||||
- n = lookupd_res_query(qbuf, C_IN, T_PTR, buf->buf, sizeof buf->buf);
|
||||
+ n = res_query(qbuf, C_IN, T_PTR, buf->buf, sizeof buf->buf);
|
||||
if (n < 0) {
|
||||
err = NS_UNAVAIL;
|
||||
continue;
|
@ -1,5 +1,5 @@
|
||||
--- modules/dns/resolv/res_send.c.orig Fri Jul 2 15:31:44 2004
|
||||
+++ modules/dns/resolv/res_send.c Wed Aug 10 18:09:22 2005
|
||||
--- modules/dns/resolv/res_send.c.orig Tue Aug 1 18:10:57 2006
|
||||
+++ modules/dns/resolv/res_send.c Tue Aug 1 18:11:02 2006
|
||||
@@ -201,7 +201,7 @@
|
||||
if (_res.options & RES_DEBUG) {
|
||||
if (getnameinfo(address, address->sa_len, abuf, sizeof(abuf),
|
||||
|
11
sysutils/lookupd/files/patch-modules-files-Makefile
Normal file
11
sysutils/lookupd/files/patch-modules-files-Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
--- modules/files/Makefile.orig Tue Aug 1 18:10:57 2006
|
||||
+++ modules/files/Makefile Tue Aug 1 18:11:07 2006
|
||||
@@ -6,7 +6,7 @@
|
||||
STRIP=
|
||||
SRCS= files_grp.c files_ht.c files_htinfo.c files_htnode.c files_pwd.c
|
||||
WARNS?=2
|
||||
-CFLAGS+=-pthread -I${.CURDIR}/../../include
|
||||
+CFLAGS+=-pthread -I${.CURDIR}/../../include -DINET6
|
||||
LDFLAGS+=-nostdlib
|
||||
NOMAN= 1
|
||||
|
@ -1,5 +1,4 @@
|
||||
sbin/lookupd
|
||||
etc/rc.d/lookupd.sh
|
||||
lib/lkpd_files.so
|
||||
lib/lkpd_files.so.1
|
||||
lib/lkpd_dns.so
|
||||
|
Loading…
Reference in New Issue
Block a user