fix: relayd: unaligned access in trace_chunk_registry_ht_key_hash
[lttng-tools.git] / src / common / compat / getenv.h
diff --git a/src/common/compat/getenv.h b/src/common/compat/getenv.h
deleted file mode 100644 (file)
index 83feaee..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _COMPAT_GETENV_H
-#define _COMPAT_GETENV_H
-
-/*
- * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * SPDX-License-Identifier: GPL-2.0-only
- *
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <common/error.h>
-
-static inline
-int lttng_is_setuid_setgid(void)
-{
-       return geteuid() != getuid() || getegid() != getgid();
-}
-
-static inline
-char *lttng_secure_getenv(const char *name)
-{
-       if (lttng_is_setuid_setgid()) {
-               WARN("Getting environment variable '%s' from setuid/setgid binary refused for security reasons.",
-                       name);
-               return NULL;
-       }
-       return getenv(name);
-}
-
-#endif /* _COMPAT_GETENV_H */
This page took 0.023486 seconds and 4 git commands to generate.