Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/lib/libc/gmon Pull up revision 1.18 (requested by chris...
details: https://anonhg.NetBSD.org/src/rev/0980fbbe60df
branches: netbsd-1-5
changeset: 493088:0980fbbe60df
user: he <he%NetBSD.org@localhost>
date: Fri Apr 26 17:09:51 2002 +0000
description:
Pull up revision 1.18 (requested by christos):
Refuse to open gmon.out file if we are set{u,g}id, and not executing
as the owner/group.
diffstat:
lib/libc/gmon/gmon.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diffs (36 lines):
diff -r 098ddf2b5a40 -r 0980fbbe60df lib/libc/gmon/gmon.c
--- a/lib/libc/gmon/gmon.c Fri Apr 26 17:01:13 2002 +0000
+++ b/lib/libc/gmon/gmon.c Fri Apr 26 17:09:51 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gmon.c,v 1.15 1999/01/14 22:48:19 kleink Exp $ */
+/* $NetBSD: gmon.c,v 1.15.10.1 2002/04/26 17:09:51 he Exp $ */
/*-
* Copyright (c) 1983, 1992, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)gmon.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: gmon.c,v 1.15 1999/01/14 22:48:19 kleink Exp $");
+__RCSID("$NetBSD: gmon.c,v 1.15.10.1 2002/04/26 17:09:51 he Exp $");
#endif
#endif
@@ -157,6 +157,17 @@
char buf2[200];
#endif
+ /*
+ * We disallow writing to the profiling file, if we are a
+ * set{u,g}id program and our effective {u,g}id does not match
+ * our real one.
+ */
+ if (issetugid() && (geteuid() != getuid() || getegid() != getgid())) {
+ warnx("mcount: Profiling of set{u,g}id binaries is not"
+ " allowed");
+ return;
+ }
+
if (p->state == GMON_PROF_ERROR)
ERR("_mcleanup: tos overflow\n");
Home |
Main Index |
Thread Index |
Old Index