From 5f4ec478badbf6191859d5b1ded324b565cc8015 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 6 Apr 1997 07:55:04 +0000 Subject: [PATCH] issetugid() this last getenv based open --- lib/libc/net/res_query.c | 6 +++--- 1 file 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'; -- 2.20.1