xref: /freebsd/tools/build/cross-build/secure_getenv.c (revision a8089ea5aee578e08acab2438e82fc9a9ae50ed8)
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 *
11 secure_getenv(const char *name)
12 {
13 	if (issetugid() != 0)
14 		return (NULL);
15 	return (getenv(name));
16 }
17