This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't assume __secure_getenv is available
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jerry DeLisle <jvdelisle at charter dot net>
- Date: Fri, 12 May 2017 10:26:59 +0300
- Subject: Re: [PATCH] Don't assume __secure_getenv is available
- Authentication-results: sourceware.org; auth=none
- References: <20170427125804.GZ1809@tucnak> <1493319051-25795-1-git-send-email-blomqvist.janne@gmail.com> <877f1mzggt.fsf@euler.schwinge.homeip.net>
On Fri, May 12, 2017 at 10:23 AM, Thomas Schwinge
<thomas@codesourcery.com> wrote:
> Hi!
>
> On Thu, 27 Apr 2017 21:50:51 +0300, Janne Blomqvist <blomqvist.janne@gmail.com> wrote:
>> [...], retain the support for __secure_getenv but call it only via a
>> weak reference.
>>
>> Regtested on x86_64-pc-linux-gnu, Ok for trunk, 7.x when it reopens,
>> 6, 5?
>
> Hmm, how has this been tested? Because:
>
>> --- a/libgfortran/runtime/environ.c
>> +++ b/libgfortran/runtime/environ.c
>
>> #ifdef FALLBACK_SECURE_GETENV
>> +
>> +#if SUPPORTS_WEAKREF && defined(HAVE___SECURE_GETENV)
>> +static char* weak_secure_getenv (const char*)
>> + __attribute__((__weakref__("__secure_gettime")));
>> +#endif
>
> "gettime" vs. "getenv"? ;-)
Oops. I'm not at my gcc development box now, please consider a patch
to fix this pre-approved.
As for testing, I regtested, but my gcc development machine has glibc
2.23 which has secure_getenv so it doesn't exercise the fallback
path..
--
Janne Blomqvist