This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use secure_getenv for GOMP_DEBUG
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Thomas Schwinge <thomas at codesourcery dot com>
- Date: Mon, 3 Jul 2017 15:42:07 +0200
- Subject: Re: [PATCH] Use secure_getenv for GOMP_DEBUG
- Authentication-results: sourceware.org; auth=none
- References: <2413b0f6-9cb2-243f-d805-08323a9c9a0a@mentor.com> <1de94c83-96da-f380-9964-1472f63270c9@mentor.com> <alpine.DEB.2.20.1706261525160.30222@digraph.polyomino.org.uk> <20170626152911.GK2123@tucnak> <9110a6a9-43dc-52ca-aabf-20c73ac73775@mentor.com> <20170627073805.GP2123@tucnak> <46104e74-3bac-13b1-54ca-025eb5c48920@mentor.com> <1fbc8af9-e152-0315-3074-5c4839fd3c1b@lauterbach.com>
On 07/03/2017 02:26 PM, Franz Sirl wrote:
Am 27.06.17 um 13:10 schrieb Tom de Vries:
--- a/libgomp/plugin/plugin-hsa.c
+++ b/libgomp/plugin/plugin-hsa.c
@@ -39,32 +39,7 @@
#include <dlfcn.h>
#include "libgomp-plugin.h"
#include "gomp-constants.h"
-
-/* Secure getenv() which returns NULL if running as SUID/SGID. */
-#ifndef HAVE_SECURE_GETENV
-#ifdef HAVE___SECURE_GETENV
-#define secure_getenv __secure_getenv
-#elif defined (HAVE_UNISTD_H) && defined(HAVE_GETUID) &&
defined(HAVE_GETEUID) \
- && defined(HAVE_GETGID) && defined(HAVE_GETEGID)
-
-#include <unistd.h>
-
-/* Implementation of secure_getenv() for targets where it is not
provided but
- we have at least means to test real and effective IDs. */
-
-static char *
-secure_getenv (const char *name)
-{
- if ((getuid () == geteuid ()) && (getgid () == getegid ()))
- return getenv (name);
- else
- return NULL;
-}
-
-#else
-#define secure_getenv getenv
-#endif
-#endif
+#include "secure-getenv.h"
Hi,
that should be secure_getenv.h (underscore instead of dash).
Hi Franz,
sorry for the breakage.
Fixed in attached patch.
Committed.
Thanks,
- Tom
Fix secure_getenv.h include in plugin-hsa.c
2017-07-03 Tom de Vries <tom@codesourcery.com>
* plugin/plugin-hsa.c: Fix secure_getenv.h include.
---
libgomp/plugin/plugin-hsa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgomp/plugin/plugin-hsa.c b/libgomp/plugin/plugin-hsa.c
index adb07ac..fc08f5d 100644
--- a/libgomp/plugin/plugin-hsa.c
+++ b/libgomp/plugin/plugin-hsa.c
@@ -39,7 +39,7 @@
#include <dlfcn.h>
#include "libgomp-plugin.h"
#include "gomp-constants.h"
-#include "secure-getenv.h"
+#include "secure_getenv.h"
/* As an HSA runtime is dlopened, following structure defines function
pointers utilized by the HSA plug-in. */