summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-06 07:55:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-06 07:55:05 +0000
commita162b2e594b78db25670bfe93ea86a3ed9445829 (patch)
treea707548300c4ace6b51211865c2b1aff86ce663a
parent74b742ab98349c7c7425a82020573cec5165f378 (diff)
issetugid() this last getenv based open
-rw-r--r--lib/libc/net/res_query.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/net/res_query.c b/lib/libc/net/res_query.c
index fcb39540099..4f3665f2765 100644
--- a/lib/libc/net/res_query.c
+++ b/lib/libc/net/res_query.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_query.c,v 1.8 1997/03/13 19:07:40 downsj Exp $ */
+/* $OpenBSD: res_query.c,v 1.9 1997/04/06 07:55:04 deraadt Exp $ */
/*
* ++Copyright++ 1988, 1993
@@ -60,7 +60,7 @@
static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: res_query.c,v 1.8 1997/03/13 19:07:40 downsj Exp $";
+static char rcsid[] = "$OpenBSD: res_query.c,v 1.9 1997/04/06 07:55:04 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -362,7 +362,7 @@ hostalias(name)
if (_res.options & RES_NOALIASES)
return (NULL);
file = getenv("HOSTALIASES");
- if (file == NULL || (fp = fopen(file, "r")) == NULL)
+ if (issetugid() != 0 || file == NULL || (fp = fopen(file, "r")) == NULL)
return (NULL);
setbuf(fp, NULL);
buf[sizeof(buf) - 1] = '\0';