X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fcompat%2Fgetenv.hpp;fp=src%2Fcommon%2Fcompat%2Fgetenv.hpp;h=18b5dee97d9ab750f79e0ee0c7f3c26fe1147927;hp=7a31fef9e0c2614481c52e1f5df11349d7fc4f9c;hb=cd9adb8b829564212158943a0d279bb35322ab30;hpb=e665dfbce25215d5ec77ff03a279c7163b337db1 diff --git a/src/common/compat/getenv.hpp b/src/common/compat/getenv.hpp index 7a31fef9e..18b5dee97 100644 --- a/src/common/compat/getenv.hpp +++ b/src/common/compat/getenv.hpp @@ -14,7 +14,7 @@ #include static inline -int lttng_is_setuid_setgid(void) +int lttng_is_setuid_setgid() { return geteuid() != getuid() || getegid() != getgid(); } @@ -25,7 +25,7 @@ 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 nullptr; } return getenv(name); }