From 6f0e598bd57dcfb6625f73ef7931a5a064d5a201 Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 13 Jan 1997 21:23:35 +0000 Subject: [PATCH] egid for open; spotted by oliver@secnet.com --- sbin/ccdconfig/ccdconfig.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c index 3e2964b615f..633a38292bf 100644 --- a/sbin/ccdconfig/ccdconfig.c +++ b/sbin/ccdconfig/ccdconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ccdconfig.c,v 1.6 1996/12/22 03:00:47 deraadt Exp $ */ +/* $OpenBSD: ccdconfig.c,v 1.7 1997/01/13 21:23:35 deraadt Exp $ */ /* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */ /*- @@ -319,11 +319,16 @@ do_all(action) char line[_POSIX2_LINE_MAX]; char *cp, **argv; int argc, rval; + gid_t egid; + egid = getegid(); + setegid(getgid()); if ((f = fopen(ccdconf, "r")) == NULL) { + setegid(egid); warn("fopen: %s", ccdconf); return (1); } + setegid(egid); while (fgets(line, sizeof(line), f) != NULL) { argc = 0; -- 2.20.1