xref: /freebsd/tools/build/cross-build/secure_getenv.c (revision 0ec03c0b10b125f5996d59fee904248978981898)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2023 Mark Johnston <markj@FreeBSD.org>
5  */
6 
7 #include <stdlib.h>
8 #include <unistd.h>
9 
10 char *
secure_getenv(const char * name)11 secure_getenv(const char *name)
12 {
13 	if (issetugid() != 0)
14 		return (NULL);
15 	return (getenv(name));
16 }
17