From 9b59ada7ca95a7ab42c49ae7b7cd6ff713b1bea0 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 5 Nov 2005 16:56:52 +1100 Subject: - (djm) [openbsd-compat/getrrsetbyname.c] Sync to latest OpenBSD version, resolving memory leak bz#1111 reported by kremenek AT cs.stanford.edu; ok dtucker@ --- openbsd-compat/getrrsetbyname.c | 112 ++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 50 deletions(-) (limited to 'openbsd-compat/getrrsetbyname.c') diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 2016ffe31..973e480b4 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -1,6 +1,6 @@ /* OPENBSD ORIGINAL: lib/libc/net/getrrsetbyname.c */ -/* $OpenBSD: getrrsetbyname.c,v 1.7 2003/03/07 07:34:14 itojun Exp $ */ +/* $OpenBSD: getrrsetbyname.c,v 1.10 2005/03/30 02:58:28 tedu Exp $ */ /* * Copyright (c) 2001 Jakob Schlyter. All rights reserved. @@ -51,48 +51,18 @@ #include "getrrsetbyname.h" -#define ANSWER_BUFFER_SIZE 1024*64 - #if defined(HAVE_DECL_H_ERRNO) && !HAVE_DECL_H_ERRNO extern int h_errno; #endif -struct dns_query { - char *name; - u_int16_t type; - u_int16_t class; - struct dns_query *next; -}; - -struct dns_rr { - char *name; - u_int16_t type; - u_int16_t class; - u_int16_t ttl; - u_int16_t size; - void *rdata; - struct dns_rr *next; -}; - -struct dns_response { - HEADER header; - struct dns_query *query; - struct dns_rr *answer; - struct dns_rr *authority; - struct dns_rr *additional; -}; - -static struct dns_response *parse_dns_response(const u_char *, int); -static struct dns_query *parse_dns_qsection(const u_char *, int, - const u_char **, int); -static struct dns_rr *parse_dns_rrsection(const u_char *, int, const u_char **, - int); - -static void free_dns_query(struct dns_query *); -static void free_dns_rr(struct dns_rr *); -static void free_dns_response(struct dns_response *); +/* We don't need multithread support here */ +#ifdef _THREAD_PRIVATE +# undef _THREAD_PRIVATE +#endif +#define _THREAD_PRIVATE(a,b,c) (c) +struct __res_state _res; -static int count_dns_rr(struct dns_rr *, u_int16_t, u_int16_t); +/* Necessary functions and macros */ /* * Inline versions of get/put short/long. Pointer is advanced. @@ -162,14 +132,56 @@ _getlong(msgp) u_int32_t _getlong(register const u_char *); #endif +/* ************** */ + +#define ANSWER_BUFFER_SIZE 1024*64 + +struct dns_query { + char *name; + u_int16_t type; + u_int16_t class; + struct dns_query *next; +}; + +struct dns_rr { + char *name; + u_int16_t type; + u_int16_t class; + u_int16_t ttl; + u_int16_t size; + void *rdata; + struct dns_rr *next; +}; + +struct dns_response { + HEADER header; + struct dns_query *query; + struct dns_rr *answer; + struct dns_rr *authority; + struct dns_rr *additional; +}; + +static struct dns_response *parse_dns_response(const u_char *, int); +static struct dns_query *parse_dns_qsection(const u_char *, int, + const u_char **, int); +static struct dns_rr *parse_dns_rrsection(const u_char *, int, const u_char **, + int); + +static void free_dns_query(struct dns_query *); +static void free_dns_rr(struct dns_rr *); +static void free_dns_response(struct dns_response *); + +static int count_dns_rr(struct dns_rr *, u_int16_t, u_int16_t); + int getrrsetbyname(const char *hostname, unsigned int rdclass, unsigned int rdtype, unsigned int flags, struct rrsetinfo **res) { + struct __res_state *_resp = _THREAD_PRIVATE(_res, _res, &_res); int result; struct rrsetinfo *rrset = NULL; - struct dns_response *response; + struct dns_response *response = NULL; struct dns_rr *rr; struct rdatainfo *rdata; int length; @@ -195,19 +207,19 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, } /* initialize resolver */ - if ((_res.options & RES_INIT) == 0 && res_init() == -1) { + if ((_resp->options & RES_INIT) == 0 && res_init() == -1) { result = ERRSET_FAIL; goto fail; } #ifdef DEBUG - _res.options |= RES_DEBUG; + _resp->options |= RES_DEBUG; #endif /* DEBUG */ #ifdef RES_USE_DNSSEC /* turn on DNSSEC if EDNS0 is configured */ - if (_res.options & RES_USE_EDNS0) - _res.options |= RES_USE_DNSSEC; + if (_resp->options & RES_USE_EDNS0) + _resp->options |= RES_USE_DNSSEC; #endif /* RES_USE_DNSEC */ /* make query */ @@ -250,20 +262,16 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, rrset->rri_ttl = response->answer->ttl; rrset->rri_nrdatas = response->header.ancount; -#ifdef HAVE_HEADER_AD /* check for authenticated data */ if (response->header.ad == 1) rrset->rri_flags |= RRSET_VALIDATED; -#endif /* copy name from answer section */ - length = strlen(response->answer->name); - rrset->rri_name = malloc(length + 1); + rrset->rri_name = strdup(response->answer->name); if (rrset->rri_name == NULL) { result = ERRSET_NOMEMORY; goto fail; } - strlcpy(rrset->rri_name, response->answer->name, length + 1); /* count answers */ rrset->rri_nrdatas = count_dns_rr(response->answer, rrset->rri_rdclass, @@ -281,7 +289,7 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, /* allocate memory for signatures */ rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo)); - if (rrset->rri_nsigs > 0 && rrset->rri_sigs == NULL) { + if (rrset->rri_sigs == NULL) { result = ERRSET_NOMEMORY; goto fail; } @@ -311,6 +319,7 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, memcpy(rdata->rdi_data, rr->rdata, rr->size); } } + free_dns_response(response); *res = rrset; return (ERRSET_SUCCESS); @@ -318,6 +327,8 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, fail: if (rrset != NULL) freerrset(rrset); + if (response != NULL) + free_dns_response(response); return (result); } @@ -467,7 +478,8 @@ parse_dns_qsection(const u_char *answer, int size, const u_char **cp, int count) } static struct dns_rr * -parse_dns_rrsection(const u_char *answer, int size, const u_char **cp, int count) +parse_dns_rrsection(const u_char *answer, int size, const u_char **cp, + int count) { struct dns_rr *head, *curr, *prev; int i, length; -- cgit v1.2.3 From 7f24a0e64774e6566242f44b0f06ab06607d0c97 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 10 Nov 2005 16:18:56 +1100 Subject: - (dtucker) [openbsd-compat/{LOTS}] Move the "OPENBSD ORIGINAL" markers to after the copyright notices. Having them at the top next to the CVSIDs guarantees a conflict for each and every sync. --- ChangeLog | 5 ++++- openbsd-compat/base64.c | 4 ++-- openbsd-compat/basename.c | 4 ++-- openbsd-compat/daemon.c | 4 ++-- openbsd-compat/dirname.c | 4 ++-- openbsd-compat/getcwd.c | 4 ++-- openbsd-compat/getgrouplist.c | 4 ++-- openbsd-compat/getopt.c | 4 ++-- openbsd-compat/getrrsetbyname.c | 4 ++-- openbsd-compat/glob.c | 4 ++-- openbsd-compat/glob.h | 4 ++-- openbsd-compat/inet_aton.c | 4 ++-- openbsd-compat/inet_ntoa.c | 4 ++-- openbsd-compat/inet_ntop.c | 4 ++-- openbsd-compat/mktemp.c | 4 ++-- openbsd-compat/readpassphrase.c | 4 ++-- openbsd-compat/readpassphrase.h | 4 ++-- openbsd-compat/realpath.c | 4 ++-- openbsd-compat/rresvport.c | 4 ++-- openbsd-compat/setenv.c | 4 ++-- openbsd-compat/sigact.c | 4 ++-- openbsd-compat/strlcat.c | 4 ++-- openbsd-compat/strlcpy.c | 4 ++-- openbsd-compat/strmode.c | 4 ++-- openbsd-compat/strsep.c | 4 ++-- openbsd-compat/strtoll.c | 4 ++-- openbsd-compat/strtonum.c | 4 ++-- openbsd-compat/strtoul.c | 4 ++-- openbsd-compat/sys-queue.h | 4 ++-- openbsd-compat/sys-tree.h | 4 ++-- openbsd-compat/vis.c | 4 ++-- openbsd-compat/vis.h | 4 ++-- 32 files changed, 66 insertions(+), 63 deletions(-) (limited to 'openbsd-compat/getrrsetbyname.c') diff --git a/ChangeLog b/ChangeLog index 0ea4054f9..367127ebc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,9 @@ prototypes, removal of "register"). - (dtucker) [openbsd-compat/strlcat.c] Sync OpenBSD revs 1.11 - 1.12 (removal of "register"). + - (dtucker) [openbsd-compat/{LOTS}] Move the "OPENBSD ORIGINAL" markers to + after the copyright notices. Having them at the top next to the CVSIDs + guarantees a conflict for each and every sync. 20051105 - (djm) OpenBSD CVS Sync @@ -3256,4 +3259,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3961 2005/11/10 05:05:37 dtucker Exp $ +$Id: ChangeLog,v 1.3962 2005/11/10 05:18:56 dtucker Exp $ diff --git a/openbsd-compat/base64.c b/openbsd-compat/base64.c index dcaa03e5d..6eadb5c10 100644 --- a/openbsd-compat/base64.c +++ b/openbsd-compat/base64.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/net/base64.c */ - /* $OpenBSD: base64.c,v 1.4 2002/01/02 23:00:10 deraadt Exp $ */ /* @@ -44,6 +42,8 @@ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ +/* OPENBSD ORIGINAL: lib/libc/net/base64.c */ + #include "includes.h" #if (!defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)) || (!defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON)) diff --git a/openbsd-compat/basename.c b/openbsd-compat/basename.c index 552dc1e1c..5171cd64c 100644 --- a/openbsd-compat/basename.c +++ b/openbsd-compat/basename.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/basename.c */ - /* $OpenBSD: basename.c,v 1.11 2003/06/17 21:56:23 millert Exp $ */ /* @@ -18,6 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* OPENBSD ORIGINAL: lib/libc/gen/basename.c */ + #include "includes.h" #ifndef HAVE_BASENAME diff --git a/openbsd-compat/daemon.c b/openbsd-compat/daemon.c index c0be5fff9..89e75a99e 100644 --- a/openbsd-compat/daemon.c +++ b/openbsd-compat/daemon.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/daemon.c */ - /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -29,6 +27,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/gen/daemon.c */ + #include "includes.h" #ifndef HAVE_DAEMON diff --git a/openbsd-compat/dirname.c b/openbsd-compat/dirname.c index 25ab34dd6..e2cf81db3 100644 --- a/openbsd-compat/dirname.c +++ b/openbsd-compat/dirname.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/dirname.c */ - /* $OpenBSD: dirname.c,v 1.10 2003/06/17 21:56:23 millert Exp $ */ /* @@ -18,6 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* OPENBSD ORIGINAL: lib/libc/gen/dirname.c */ + #include "includes.h" #ifndef HAVE_DIRNAME diff --git a/openbsd-compat/getcwd.c b/openbsd-compat/getcwd.c index 19be59172..d58c03e0e 100644 --- a/openbsd-compat/getcwd.c +++ b/openbsd-compat/getcwd.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/getcwd.c */ - /* * Copyright (c) 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -29,6 +27,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/gen/getcwd.c */ + #include "includes.h" #if !defined(HAVE_GETCWD) diff --git a/openbsd-compat/getgrouplist.c b/openbsd-compat/getgrouplist.c index 2a2b8878b..a57d7d388 100644 --- a/openbsd-compat/getgrouplist.c +++ b/openbsd-compat/getgrouplist.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/getgrouplist.c */ - /* $OpenBSD: getgrouplist.c,v 1.12 2005/08/08 08:05:34 espie Exp $ */ /* * Copyright (c) 1991, 1993 @@ -30,6 +28,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/gen/getgrouplist.c */ + #include "includes.h" #ifndef HAVE_GETGROUPLIST diff --git a/openbsd-compat/getopt.c b/openbsd-compat/getopt.c index f5ee6778d..5450e43d9 100644 --- a/openbsd-compat/getopt.c +++ b/openbsd-compat/getopt.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/stdlib/getopt.c */ - /* * Copyright (c) 1987, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -29,6 +27,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/stdlib/getopt.c */ + #include "includes.h" #if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET) diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 973e480b4..8d571beea 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/net/getrrsetbyname.c */ - /* $OpenBSD: getrrsetbyname.c,v 1.10 2005/03/30 02:58:28 tedu Exp $ */ /* @@ -45,6 +43,8 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* OPENBSD ORIGINAL: lib/libc/net/getrrsetbyname.c */ + #include "includes.h" #ifndef HAVE_GETRRSETBYNAME diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index 7fafc8c40..e00db7079 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/glob.c */ - /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -32,6 +30,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/gen/glob.c */ + #include "includes.h" #include diff --git a/openbsd-compat/glob.h b/openbsd-compat/glob.h index 3428b2013..5d80073d3 100644 --- a/openbsd-compat/glob.h +++ b/openbsd-compat/glob.h @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: include/glob.h */ - /* $OpenBSD: glob.h,v 1.8 2003/06/02 19:34:12 millert Exp $ */ /* $NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp $ */ @@ -37,6 +35,8 @@ * @(#)glob.h 8.1 (Berkeley) 6/2/93 */ +/* OPENBSD ORIGINAL: include/glob.h */ + #if !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) || \ !defined(GLOB_HAS_GL_MATCHC) diff --git a/openbsd-compat/inet_aton.c b/openbsd-compat/inet_aton.c index c141bcc68..355bf6bc9 100644 --- a/openbsd-compat/inet_aton.c +++ b/openbsd-compat/inet_aton.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/net/inet_addr.c */ - /* $OpenBSD: inet_addr.c,v 1.7 2003/06/02 20:18:35 millert Exp $ */ /* @@ -51,6 +49,8 @@ * --Copyright-- */ +/* OPENBSD ORIGINAL: lib/libc/net/inet_addr.c */ + #include "includes.h" #if !defined(HAVE_INET_ATON) diff --git a/openbsd-compat/inet_ntoa.c b/openbsd-compat/inet_ntoa.c index dc010dc53..16390b178 100644 --- a/openbsd-compat/inet_ntoa.c +++ b/openbsd-compat/inet_ntoa.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/net/inet_ntoa.c */ - /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -29,6 +27,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/net/inet_ntoa.c */ + #include "includes.h" #if defined(BROKEN_INET_NTOA) || !defined(HAVE_INET_NTOA) diff --git a/openbsd-compat/inet_ntop.c b/openbsd-compat/inet_ntop.c index 47796c370..c75a80d2b 100644 --- a/openbsd-compat/inet_ntop.c +++ b/openbsd-compat/inet_ntop.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/net/inet_ntop.c */ - /* $OpenBSD: inet_ntop.c,v 1.5 2002/08/23 16:27:31 itojun Exp $ */ /* Copyright (c) 1996 by Internet Software Consortium. @@ -18,6 +16,8 @@ * SOFTWARE. */ +/* OPENBSD ORIGINAL: lib/libc/net/inet_ntop.c */ + #include "includes.h" #ifndef HAVE_INET_NTOP diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index 969f69580..8071aa184 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/stdio/mktemp.c */ - /* THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL OPENBSD SOURCE */ /* Changes: Removed mktemp */ @@ -32,6 +30,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/stdio/mktemp.c */ + #include "includes.h" #if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c index eb060bdbf..2c84f8021 100644 --- a/openbsd-compat/readpassphrase.c +++ b/openbsd-compat/readpassphrase.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/readpassphrase.c */ - /* $OpenBSD: readpassphrase.c,v 1.16 2003/06/17 21:56:23 millert Exp $ */ /* @@ -22,6 +20,8 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ +/* OPENBSD ORIGINAL: lib/libc/gen/readpassphrase.c */ + #if defined(LIBC_SCCS) && !defined(lint) static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.16 2003/06/17 21:56:23 millert Exp $"; #endif /* LIBC_SCCS and not lint */ diff --git a/openbsd-compat/readpassphrase.h b/openbsd-compat/readpassphrase.h index 178edf346..faab47182 100644 --- a/openbsd-compat/readpassphrase.h +++ b/openbsd-compat/readpassphrase.h @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: include/readpassphrase.h */ - /* $OpenBSD: readpassphrase.h,v 1.3 2002/06/28 12:32:22 millert Exp $ */ /* @@ -29,6 +27,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: include/readpassphrase.h */ + #ifndef _READPASSPHRASE_H_ #define _READPASSPHRASE_H_ diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c index 8430bec24..8c889db3e 100644 --- a/openbsd-compat/realpath.c +++ b/openbsd-compat/realpath.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/stdlib/realpath.c */ - /* * Copyright (c) 2003 Constantin S. Svintsoff * @@ -28,6 +26,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/stdlib/realpath.c */ + #include "includes.h" #if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) diff --git a/openbsd-compat/rresvport.c b/openbsd-compat/rresvport.c index 75167065c..aa72f4ba2 100644 --- a/openbsd-compat/rresvport.c +++ b/openbsd-compat/rresvport.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/net/rresvport.c */ - /* * Copyright (c) 1995, 1996, 1998 Theo de Raadt. All rights reserved. * Copyright (c) 1983, 1993, 1994 @@ -30,6 +28,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/net/rresvport.c */ + #include "includes.h" #ifndef HAVE_RRESVPORT_AF diff --git a/openbsd-compat/setenv.c b/openbsd-compat/setenv.c index 93a681152..b52a99c2c 100644 --- a/openbsd-compat/setenv.c +++ b/openbsd-compat/setenv.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/stdlib/setenv.c */ - /* $OpenBSD: setenv.c,v 1.9 2005/08/08 08:05:37 espie Exp $ */ /* * Copyright (c) 1987 Regents of the University of California. @@ -30,6 +28,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/stdlib/setenv.c */ + #include "includes.h" #if !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV) diff --git a/openbsd-compat/sigact.c b/openbsd-compat/sigact.c index 2772ac574..d1431a0d9 100644 --- a/openbsd-compat/sigact.c +++ b/openbsd-compat/sigact.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libcurses/base/sigaction.c */ - /* $OpenBSD: sigaction.c,v 1.3 1999/06/27 08:14:21 millert Exp $ */ /**************************************************************************** @@ -35,6 +33,8 @@ * and: Eric S. Raymond * ****************************************************************************/ +/* OPENBSD ORIGINAL: lib/libcurses/base/sigaction.c */ + #include "includes.h" #include #include "sigact.h" diff --git a/openbsd-compat/strlcat.c b/openbsd-compat/strlcat.c index 8252f31af..bcc1b61ad 100644 --- a/openbsd-compat/strlcat.c +++ b/openbsd-compat/strlcat.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/string/strlcat.c */ - /* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */ /* @@ -18,6 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* OPENBSD ORIGINAL: lib/libc/string/strlcat.c */ + #include "includes.h" #ifndef HAVE_STRLCAT diff --git a/openbsd-compat/strlcpy.c b/openbsd-compat/strlcpy.c index ccfa12a0a..736421202 100644 --- a/openbsd-compat/strlcpy.c +++ b/openbsd-compat/strlcpy.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */ - /* $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $ */ /* @@ -18,6 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */ + #include "includes.h" #ifndef HAVE_STRLCPY diff --git a/openbsd-compat/strmode.c b/openbsd-compat/strmode.c index ea8d515e3..0dbb23733 100644 --- a/openbsd-compat/strmode.c +++ b/openbsd-compat/strmode.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/string/strmode.c */ - /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -29,6 +27,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/string/strmode.c */ + #include "includes.h" #ifndef HAVE_STRMODE diff --git a/openbsd-compat/strsep.c b/openbsd-compat/strsep.c index 330d84ce1..9e81980c7 100644 --- a/openbsd-compat/strsep.c +++ b/openbsd-compat/strsep.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/string/strsep.c */ - /* $OpenBSD: strsep.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $ */ /*- @@ -31,6 +29,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/string/strsep.c */ + #include "includes.h" #if !defined(HAVE_STRSEP) diff --git a/openbsd-compat/strtoll.c b/openbsd-compat/strtoll.c index 60c276f8a..653f572fe 100644 --- a/openbsd-compat/strtoll.c +++ b/openbsd-compat/strtoll.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/stdlib/strtoll.c */ - /*- * Copyright (c) 1992 The Regents of the University of California. * All rights reserved. @@ -29,6 +27,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/stdlib/strtoll.c */ + #include "includes.h" #ifndef HAVE_STRTOLL diff --git a/openbsd-compat/strtonum.c b/openbsd-compat/strtonum.c index b681ed83b..8ad0d0058 100644 --- a/openbsd-compat/strtonum.c +++ b/openbsd-compat/strtonum.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/stdlib/strtonum.c */ - /* $OpenBSD: strtonum.c,v 1.6 2004/08/03 19:38:01 millert Exp $ */ /* @@ -19,6 +17,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* OPENBSD ORIGINAL: lib/libc/stdlib/strtonum.c */ + #include "includes.h" #ifndef HAVE_STRTONUM #include diff --git a/openbsd-compat/strtoul.c b/openbsd-compat/strtoul.c index 24d0e253d..7c093c48f 100644 --- a/openbsd-compat/strtoul.c +++ b/openbsd-compat/strtoul.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/stdlib/strtoul.c */ - /* * Copyright (c) 1990 Regents of the University of California. * All rights reserved. @@ -29,6 +27,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/stdlib/strtoul.c */ + #include "includes.h" #ifndef HAVE_STRTOUL diff --git a/openbsd-compat/sys-queue.h b/openbsd-compat/sys-queue.h index c49a94650..402343324 100644 --- a/openbsd-compat/sys-queue.h +++ b/openbsd-compat/sys-queue.h @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: sys/sys/queue.h */ - /* $OpenBSD: queue.h,v 1.25 2004/04/08 16:08:21 henning Exp $ */ /* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ @@ -34,6 +32,8 @@ * @(#)queue.h 8.5 (Berkeley) 8/20/94 */ +/* OPENBSD ORIGINAL: sys/sys/queue.h */ + #ifndef _FAKE_QUEUE_H_ #define _FAKE_QUEUE_H_ diff --git a/openbsd-compat/sys-tree.h b/openbsd-compat/sys-tree.h index 73cfbe72a..c80b90b21 100644 --- a/openbsd-compat/sys-tree.h +++ b/openbsd-compat/sys-tree.h @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: sys/sys/tree.h */ - /* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */ /* * Copyright 2002 Niels Provos @@ -26,6 +24,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: sys/sys/tree.h */ + #ifndef _SYS_TREE_H_ #define _SYS_TREE_H_ diff --git a/openbsd-compat/vis.c b/openbsd-compat/vis.c index 52d19ac55..3a087b341 100644 --- a/openbsd-compat/vis.c +++ b/openbsd-compat/vis.c @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: lib/libc/gen/vis.c */ - /* $OpenBSD: vis.c,v 1.19 2005/09/01 17:15:49 millert Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -30,6 +28,8 @@ * SUCH DAMAGE. */ +/* OPENBSD ORIGINAL: lib/libc/gen/vis.c */ + #include "includes.h" #if !defined(HAVE_STRNVIS) diff --git a/openbsd-compat/vis.h b/openbsd-compat/vis.h index 0588f68da..3898a9e70 100644 --- a/openbsd-compat/vis.h +++ b/openbsd-compat/vis.h @@ -1,5 +1,3 @@ -/* OPENBSD ORIGINAL: include/vis.h */ - /* $OpenBSD: vis.h,v 1.11 2005/08/09 19:38:31 millert Exp $ */ /* $NetBSD: vis.h,v 1.4 1994/10/26 00:56:41 cgd Exp $ */ @@ -34,6 +32,8 @@ * @(#)vis.h 5.9 (Berkeley) 4/3/91 */ +/* OPENBSD ORIGINAL: include/vis.h */ + #include "includes.h" #if !defined(HAVE_STRNVIS) -- cgit v1.2.3 From 16fd99c72702049030901b15a158a2159fe8f428 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 12 Nov 2005 14:06:29 +1100 Subject: - (dtucker) [openbsd-compat/getrrsetbyname.c] Restore Portable-specific ifdef lost during sync. Spotted by tim@. --- ChangeLog | 6 +++++- openbsd-compat/getrrsetbyname.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'openbsd-compat/getrrsetbyname.c') diff --git a/ChangeLog b/ChangeLog index 291bf970a..e87996bb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20051112 + - (dtucker) [openbsd-compat/getrrsetbyname.c] Restore Portable-specific + ifdef lost during sync. Spotted by tim@. + 20051110 - (dtucker) [openbsd-compat/setenv.c] Merge changes for __findenv from OpenBSD getenv.c revs 1.4 - 1.8 (ANSIfication of arguments, removal of @@ -3292,4 +3296,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3989 2005/11/10 10:30:36 dtucker Exp $ +$Id: ChangeLog,v 1.3990 2005/11/12 03:06:29 dtucker Exp $ diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 8d571beea..bea6aea3b 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -262,9 +262,11 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, rrset->rri_ttl = response->answer->ttl; rrset->rri_nrdatas = response->header.ancount; +#ifdef HAVE_HEADER_AD /* check for authenticated data */ if (response->header.ad == 1) rrset->rri_flags |= RRSET_VALIDATED; +#endif /* copy name from answer section */ rrset->rri_name = strdup(response->answer->name); -- cgit v1.2.3