1 #ifndef _COMPAT_GETENV_H
2 #define _COMPAT_GETENV_H
5 * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 * SPDX-License-Identifier: GPL-2.0-only
13 #include <sys/types.h>
14 #include <common/error.h>
17 int lttng_is_setuid_setgid(void)
19 return geteuid() != getuid() || getegid() != getgid();
23 char *lttng_secure_getenv(const char *name
)
25 if (lttng_is_setuid_setgid()) {
26 WARN("Getting environment variable '%s' from setuid/setgid binary refused for security reasons.",
33 #endif /* _COMPAT_GETENV_H */
This page took 0.031139 seconds and 5 git commands to generate.