From 94246e65e20b5390d53858447526b231ef1afd67 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Mon, 18 Aug 2014 07:56:08 -0400 Subject: libc: add issetugid() issetugid() returns 1 if the process environment or memory address space is considered tainted, and returns 0 otherwise. This happens, for example, when a process's privileges are elevated by the setuid or setgid flags on an executable belonging to root. This function first appeard in OpenBSD 2.0 and is needed for the LibreSSL. This patch follows the same logic as the equivalent musl commit. For more information see the commit message at http://git.musl-libc.org/cgit/musl/commit/?id=ddddec106fd17c3aca3287005d21e92f742aa9d4 Signed-off-by: Anthony G. Basile Signed-off-by: Bernhard Reutner-Fischer --- libc/misc/file/issetugid.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 libc/misc/file/issetugid.c (limited to 'libc/misc/file/issetugid.c') diff --git a/libc/misc/file/issetugid.c b/libc/misc/file/issetugid.c new file mode 100644 index 000000000..6756a1e85 --- /dev/null +++ b/libc/misc/file/issetugid.c @@ -0,0 +1,10 @@ +/* Copyright (C) 2013 Gentoo Foundation + * Licensed under LGPL v2.1 or later, see the file COPYING.LIB in this tarball. + */ + +#include + +int issetugid(void) +{ + return _pe_secure; +} -- cgit v1.2.3