From 97c46584575c23fb060b72f3a32c31e216886756 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 16 Jul 2020 17:47:10 +0000 Subject: allow setenv LIBC_NOUSERTC to disable userland timekeeping, for ktrace. ok deraadt pirofti --- lib/libc/dlfcn/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libc/dlfcn/init.c b/lib/libc/dlfcn/init.c index 3df61076dff..c8e0542995c 100644 --- a/lib/libc/dlfcn/init.c +++ b/lib/libc/dlfcn/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.8 2020/07/06 13:33:05 pirofti Exp $ */ +/* $OpenBSD: init.c,v 1.9 2020/07/16 17:47:09 tedu Exp $ */ /* * Copyright (c) 2014,2015 Philip Guenther * @@ -114,6 +114,8 @@ _libc_preinit(int argc, char **argv, char **envp, dl_cb_cb *cb) _timekeep->tk_version != TK_VERSION) _timekeep = NULL; } + if (issetugid() == 0 && getenv("LIBC_NOUSERTC")) + _timekeep = NULL; break; } } -- cgit v1.2.3