aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/resolv
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/resolv')
-rw-r--r--lib/libc/resolv/Makefile.inc2
-rw-r--r--lib/libc/resolv/Symbol.map4
-rw-r--r--lib/libc/resolv/h_errno.c4
-rw-r--r--lib/libc/resolv/herror.c7
-rw-r--r--lib/libc/resolv/mtctxres.c3
-rw-r--r--lib/libc/resolv/res_comp.c7
-rw-r--r--lib/libc/resolv/res_data.c6
-rw-r--r--lib/libc/resolv/res_debug.c7
-rw-r--r--lib/libc/resolv/res_debug.h4
-rw-r--r--lib/libc/resolv/res_findzonecut.c6
-rw-r--r--lib/libc/resolv/res_init.c15
-rw-r--r--lib/libc/resolv/res_mkquery.c12
-rw-r--r--lib/libc/resolv/res_mkupdate.c10
-rw-r--r--lib/libc/resolv/res_private.h1
-rw-r--r--lib/libc/resolv/res_query.c16
-rw-r--r--lib/libc/resolv/res_send.c56
-rw-r--r--lib/libc/resolv/res_state.c4
-rw-r--r--lib/libc/resolv/res_update.c6
18 files changed, 15 insertions, 155 deletions
diff --git a/lib/libc/resolv/Makefile.inc b/lib/libc/resolv/Makefile.inc
index 9bb7bbe46d29..be900e942435 100644
--- a/lib/libc/resolv/Makefile.inc
+++ b/lib/libc/resolv/Makefile.inc
@@ -1,5 +1,3 @@
-# $FreeBSD$
-
# resolv sources
.PATH: ${LIBC_SRCTOP}/resolv
diff --git a/lib/libc/resolv/Symbol.map b/lib/libc/resolv/Symbol.map
index 170333343cf0..6b9c43298fb5 100644
--- a/lib/libc/resolv/Symbol.map
+++ b/lib/libc/resolv/Symbol.map
@@ -1,7 +1,3 @@
-/*
- * $FreeBSD$
- */
-
FBSD_1.0 {
/* h_nerr; */ /* Why is this not staticized in net/herror.c? */
h_errlist;
diff --git a/lib/libc/resolv/h_errno.c b/lib/libc/resolv/h_errno.c
index 06ea60390d40..5ac0494ebc06 100644
--- a/lib/libc/resolv/h_errno.c
+++ b/lib/libc/resolv/h_errno.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2006 The FreeBSD Project. All rights reserved.
*
@@ -23,8 +23,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#include <sys/types.h>
diff --git a/lib/libc/resolv/herror.c b/lib/libc/resolv/herror.c
index aa6d61496621..def4057b3c18 100644
--- a/lib/libc/resolv/herror.c
+++ b/lib/libc/resolv/herror.c
@@ -46,13 +46,6 @@
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: herror.c,v 1.4 2005/04/27 04:56:41 sra Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "port_before.h"
#include "namespace.h"
diff --git a/lib/libc/resolv/mtctxres.c b/lib/libc/resolv/mtctxres.c
index c2aea381761d..beb2b6b3f5dd 100644
--- a/lib/libc/resolv/mtctxres.c
+++ b/lib/libc/resolv/mtctxres.c
@@ -1,6 +1,3 @@
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <port_before.h>
#ifdef DO_PTHREADS
#include <pthread.h>
diff --git a/lib/libc/resolv/res_comp.c b/lib/libc/resolv/res_comp.c
index 1048ef453fe0..55b71266b4ae 100644
--- a/lib/libc/resolv/res_comp.c
+++ b/lib/libc/resolv/res_comp.c
@@ -66,13 +66,6 @@
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_comp.c,v 1.5 2005/07/28 06:51:50 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "port_before.h"
#include <sys/param.h>
#include <netinet/in.h>
diff --git a/lib/libc/resolv/res_data.c b/lib/libc/resolv/res_data.c
index a04749b9a3f5..b6e3008c4e35 100644
--- a/lib/libc/resolv/res_data.c
+++ b/lib/libc/resolv/res_data.c
@@ -17,12 +17,6 @@
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: res_data.c,v 1.7 2008/12/11 09:59:00 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "port_before.h"
#include <sys/param.h>
diff --git a/lib/libc/resolv/res_debug.c b/lib/libc/resolv/res_debug.c
index 218056d51f81..520fe4986c80 100644
--- a/lib/libc/resolv/res_debug.c
+++ b/lib/libc/resolv/res_debug.c
@@ -91,13 +91,6 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_debug.c,v 1.19 2009/02/26 11:20:20 tbox Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "port_before.h"
#include <sys/param.h>
diff --git a/lib/libc/resolv/res_debug.h b/lib/libc/resolv/res_debug.h
index 088046ad0d5e..ccae03e625aa 100644
--- a/lib/libc/resolv/res_debug.h
+++ b/lib/libc/resolv/res_debug.h
@@ -15,8 +15,6 @@
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $FreeBSD$
*/
#ifndef _RES_DEBUG_H_
@@ -25,7 +23,7 @@
#ifndef DEBUG
# define Dprint(cond, args) /*empty*/
# define DprintQ(cond, args, query, size) /*empty*/
-# define Aerror(statp, file, string, error, address) /*empty*/
+# define Aerror(statp, file, string, error, address, alen) /*empty*/
# define Perror(statp, file, string, error) /*empty*/
#else
# define Dprint(cond, args) if (cond) {fprintf args;} else {}
diff --git a/lib/libc/resolv/res_findzonecut.c b/lib/libc/resolv/res_findzonecut.c
index d08f6dbe7dbd..a78b08302057 100644
--- a/lib/libc/resolv/res_findzonecut.c
+++ b/lib/libc/resolv/res_findzonecut.c
@@ -1,6 +1,3 @@
-#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_findzonecut.c,v 1.10 2005/10/11 00:10:16 marka Exp $";
-#endif /* not lint */
/*-
* SPDX-License-Identifier: ISC
@@ -21,9 +18,6 @@ static const char rcsid[] = "$Id: res_findzonecut.c,v 1.10 2005/10/11 00:10:16 m
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
/* Import. */
#include "port_before.h"
diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c
index 274ffbf999d6..71ab2dcb7038 100644
--- a/lib/libc/resolv/res_init.c
+++ b/lib/libc/resolv/res_init.c
@@ -66,13 +66,6 @@
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 1.26 2008/12/11 09:59:00 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "port_before.h"
#include "namespace.h"
@@ -115,12 +108,6 @@ __FBSDID("$FreeBSD$");
#include "res_private.h"
-/*% Options. Should all be left alone. */
-#define RESOLVSORT
-#ifndef DEBUG
-#define DEBUG
-#endif
-
#ifdef SOLARIS2
#include <sys/systeminfo.h>
#endif
@@ -277,7 +264,7 @@ __res_vinit(res_state statp, int preinit) {
#endif /* SOLARIS2 */
/* Allow user to override the local domain definition */
- if (issetugid() == 0 && (cp = getenv("LOCALDOMAIN")) != NULL) {
+ if ((cp = secure_getenv("LOCALDOMAIN")) != NULL) {
(void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
statp->defdname[sizeof(statp->defdname) - 1] = '\0';
haveenv++;
diff --git a/lib/libc/resolv/res_mkquery.c b/lib/libc/resolv/res_mkquery.c
index 6cf6e0864390..f6767a92375c 100644
--- a/lib/libc/resolv/res_mkquery.c
+++ b/lib/libc/resolv/res_mkquery.c
@@ -66,13 +66,6 @@
* SOFTWARE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_mkquery.c,v 1.10 2008/12/11 09:59:00 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "port_before.h"
#include <sys/param.h>
#include <netinet/in.h>
@@ -83,11 +76,6 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include "port_after.h"
-/* Options. Leave them on. */
-#ifndef DEBUG
-#define DEBUG
-#endif
-
extern const char *_res_opcodes[];
/*%
diff --git a/lib/libc/resolv/res_mkupdate.c b/lib/libc/resolv/res_mkupdate.c
index 80e8ab2b0e0f..3f595dc4ec08 100644
--- a/lib/libc/resolv/res_mkupdate.c
+++ b/lib/libc/resolv/res_mkupdate.c
@@ -23,12 +23,6 @@
* &lt;viraj_bais@ccm.fm.intel.com>
*/
-#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_mkupdate.c,v 1.10 2008/12/11 09:59:00 marka Exp $";
-#endif /* not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "port_before.h"
#include <sys/param.h>
@@ -54,10 +48,6 @@ __FBSDID("$FreeBSD$");
#include "port_after.h"
-/* Options. Leave them on. */
-#ifndef DEBUG
-#define DEBUG
-#endif
#define MAXPORT 1024
static int getnum_str(u_char **, u_char *);
diff --git a/lib/libc/resolv/res_private.h b/lib/libc/resolv/res_private.h
index a986e95ce2eb..0b86f6c742a1 100644
--- a/lib/libc/resolv/res_private.h
+++ b/lib/libc/resolv/res_private.h
@@ -1,4 +1,3 @@
-/* $FreeBSD$ */
#ifndef res_private_h
#define res_private_h
diff --git a/lib/libc/resolv/res_query.c b/lib/libc/resolv/res_query.c
index 8270e26ecdfb..f26d59e522b4 100644
--- a/lib/libc/resolv/res_query.c
+++ b/lib/libc/resolv/res_query.c
@@ -66,13 +66,6 @@
* SOFTWARE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_query.c,v 1.11 2008/11/14 02:36:51 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "port_before.h"
#include <sys/param.h>
#include <netinet/in.h>
@@ -88,11 +81,6 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "port_after.h"
-/* Options. Leave them on. */
-#ifndef DEBUG
-#define DEBUG
-#endif
-
#if PACKETSZ > 1024
#define MAXPACKET PACKETSZ
#else
@@ -457,9 +445,7 @@ res_hostalias(const res_state statp, const char *name, char *dst, size_t siz) {
if (statp->options & RES_NOALIASES)
return (NULL);
- if (issetugid())
- return (NULL);
- file = getenv("HOSTALIASES");
+ file = secure_getenv("HOSTALIASES");
if (file == NULL || (fp = fopen(file, "re")) == NULL)
return (NULL);
setbuf(fp, NULL);
diff --git a/lib/libc/resolv/res_send.c b/lib/libc/resolv/res_send.c
index 366ec394a59e..08c3aed7f934 100644
--- a/lib/libc/resolv/res_send.c
+++ b/lib/libc/resolv/res_send.c
@@ -66,13 +66,6 @@
* SOFTWARE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_send.c,v 1.22 2009/01/22 23:49:23 tbox Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
/*! \file
* \brief
* Send query to name server and wait for reply.
@@ -119,10 +112,6 @@ __FBSDID("$FreeBSD$");
#include "un-namespace.h"
-/* Options. Leave them on. */
-#ifndef DEBUG
-#define DEBUG
-#endif
#include "res_debug.h"
#include "res_private.h"
@@ -145,15 +134,12 @@ static int send_dg(res_state,
const u_char *, int,
u_char *, int, int *, int, int,
int *, int *);
+#ifdef DEBUG
static void Aerror(const res_state, FILE *, const char *, int,
const struct sockaddr *, int);
static void Perror(const res_state, FILE *, const char *, int);
-static int sock_eq(struct sockaddr *, struct sockaddr *);
-#if defined(NEED_PSELECT) && !defined(USE_POLL) && !defined(USE_KQUEUE)
-static int pselect(int, void *, void *, void *,
- struct timespec *,
- const sigset_t *);
#endif
+static int sock_eq(struct sockaddr *, struct sockaddr *);
void res_pquery(const res_state, const u_char *, int, FILE *);
static const int niflags = NI_NUMERICHOST | NI_NUMERICSERV;
@@ -309,7 +295,9 @@ res_nsend(res_state statp,
#ifdef USE_KQUEUE
int kq;
#endif
+#ifdef DEBUG
char abuf[NI_MAXHOST];
+#endif
/* No name servers or res_init() failure */
if (statp->nscount == 0 || EXT(statp).ext == NULL) {
@@ -425,10 +413,10 @@ res_nsend(res_state statp,
*/
for (tries = 0; tries < statp->retry; tries++) {
for (ns = 0; ns < statp->nscount; ns++) {
- struct sockaddr *nsap;
- int nsaplen;
- nsap = get_nsaddr(statp, ns);
- nsaplen = get_salen(nsap);
+ struct sockaddr *nsap = get_nsaddr(statp, ns);
+#ifdef DEBUG
+ int nsaplen = get_salen(nsap);
+#endif
statp->_flags &= ~RES_F_LASTMASK;
statp->_flags |= (ns << RES_F_LASTSHIFT);
same_ns:
@@ -1095,6 +1083,7 @@ send_dg(res_state statp,
return (resplen);
}
+#ifdef DEBUG
static void
Aerror(const res_state statp, FILE *file, const char *string, int error,
const struct sockaddr *address, int alen)
@@ -1126,6 +1115,7 @@ Perror(const res_state statp, FILE *file, const char *string, int error) {
string, strerror(error));
errno = save;
}
+#endif
static int
sock_eq(struct sockaddr *a, struct sockaddr *b) {
@@ -1152,29 +1142,3 @@ sock_eq(struct sockaddr *a, struct sockaddr *b) {
return 0;
}
}
-
-#if defined(NEED_PSELECT) && !defined(USE_POLL) && !defined(USE_KQUEUE)
-/* XXX needs to move to the porting library. */
-static int
-pselect(int nfds, void *rfds, void *wfds, void *efds,
- struct timespec *tsp, const sigset_t *sigmask)
-{
- struct timeval tv, *tvp;
- sigset_t sigs;
- int n;
-
- if (tsp) {
- tvp = &tv;
- tv = evTimeVal(*tsp);
- } else
- tvp = NULL;
- if (sigmask)
- sigprocmask(SIG_SETMASK, sigmask, &sigs);
- n = select(nfds, rfds, wfds, efds, tvp);
- if (sigmask)
- sigprocmask(SIG_SETMASK, &sigs, NULL);
- if (tsp)
- *tsp = evTimeSpec(tv);
- return (n);
-}
-#endif
diff --git a/lib/libc/resolv/res_state.c b/lib/libc/resolv/res_state.c
index 976d09c2cbaf..9a0226a05ace 100644
--- a/lib/libc/resolv/res_state.c
+++ b/lib/libc/resolv/res_state.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2006 The FreeBSD Project. All rights reserved.
*
@@ -23,8 +23,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#include <sys/types.h>
diff --git a/lib/libc/resolv/res_update.c b/lib/libc/resolv/res_update.c
index 388f643996dc..f8f13bf495f9 100644
--- a/lib/libc/resolv/res_update.c
+++ b/lib/libc/resolv/res_update.c
@@ -1,6 +1,3 @@
-#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_update.c,v 1.13 2005/04/27 04:56:43 sra Exp $";
-#endif /* not lint */
/*-
* SPDX-License-Identifier: ISC
@@ -27,9 +24,6 @@ static const char rcsid[] = "$Id: res_update.c,v 1.13 2005/04/27 04:56:43 sra Ex
* &lt;viraj_bais@ccm.fm.intel.com>
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "port_before.h"
#include <sys/param.h>