This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: secure getenv testcase...
On 09/03/2012 10:16 PM, David Miller wrote:
Can you provide more details about the failure? I'm not sure where to
start looking.
SGID failed: GID and EGID match (1000)
Unexpected exit status 512 from child process
Looks like your /tmp is mounted nosuid. The attached patch ignores this
failure and prints a warning.
--
Florian Weimer / Red Hat Product Security Team
2012-09-04 Florian Weimer <fweimer@redhat.com>
* stdlib/tst-secure-getenv.c (alternative_main): Only warn on SGID
failures.
diff --git a/stdlib/tst-secure-getenv.c b/stdlib/tst-secure-getenv.c
index 276b0af..b52aaf0 100644
--- a/stdlib/tst-secure-getenv.c
+++ b/stdlib/tst-secure-getenv.c
@@ -228,9 +228,10 @@ alternative_main (int argc, char **argv)
{
if (getgid () == getegid ())
{
- printf ("SGID failed: GID and EGID match (%jd)\n",
+ /* This can happen if the file system is mounted nosuid. */
+ fprintf (stderr, "SGID failed: GID and EGID match (%jd)\n",
(intmax_t) getgid ());
- exit (2);
+ exit (MAGIC_STATUS);
}
if (getenv ("PATH") == NULL)
{