summaryrefslogtreecommitdiff
path: root/sbin/ccdconfig/ccdconfig.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-01-13 21:23:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-01-13 21:23:36 +0000
commit57b15eb2bb48bd7c5ffab81fe8939dd47a5e94dc (patch)
tree46869ce2bb32beadbda0f750854f15b885ddc724 /sbin/ccdconfig/ccdconfig.c
parentd511f7c1e7124d533764b8d8026c7e3f04419789 (diff)
egid for open; spotted by oliver@secnet.com
Diffstat (limited to 'sbin/ccdconfig/ccdconfig.c')
-rw-r--r--sbin/ccdconfig/ccdconfig.c7
1 files changed, 6 insertions, 1 deletions
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;