Message ID | 87r2zu33ks.fsf@hertz.schwinge.homeip.net |
---|---|
State | New |
Headers | show |
On Fri, May 12, 2017 at 11:02 AM, Thomas Schwinge <thomas@codesourcery.com> wrote: > Hi! > > On Fri, 12 May 2017 10:26:59 +0300, Janne Blomqvist <blomqvist.janne@gmail.com> wrote: >> On Fri, May 12, 2017 at 10:23 AM, Thomas Schwinge >> <thomas@codesourcery.com> wrote: >> > 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.. > > Then, that clearly isn't an appropriate testing methodology? What I do > in such cases is manually induce the expected environment (for example, > here I'd probably try hacking out "HAVE_SECURE_GETENV" and > "HAVE___SECURE_GETENV" from the generated "config.h" or even > "libgfortran/configure"), and then manually run something that is > expected to behave differently in an environment relevant to > "secure_getenv" Yes, I've done something like that in the past to test different branches of #ifdeffy code. Here it was simple enough that I thought "what could possibly go wrong?"; Plenty, apparently! ;) > Still untested -- ;-) -- but including another typo fix, committed to > trunk in r247952: Thanks. I had actually fixed the HAVE___SECURE_GETENV typo myself in my git tree, but then I committed the wrong patch to svn. Aagh.. Moar coffee needed...
diff --git libgfortran/ChangeLog libgfortran/ChangeLog index 337daaf..6b7da0a 100644 --- libgfortran/ChangeLog +++ libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2017-05-12 Thomas Schwinge <thomas@codesourcery.com> + + * runtime/environ.c (weak_secure_getenv): Fix "__secure_gettime" + vs. "__secure_getenv" typo. + (secure_getenv): Fix "HAVE__SECURE_GETENV" + vs. "HAVE___SECURE_GETENV" typo. + 2017-05-11 Janne Blomqvist <jb@gcc.gnu.org> * libgfortran.h: HAVE_SECURE_GETENV: Don't check diff --git libgfortran/runtime/environ.c libgfortran/runtime/environ.c index 969dcdf..f0a593e 100644 --- libgfortran/runtime/environ.c +++ libgfortran/runtime/environ.c @@ -40,13 +40,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if SUPPORTS_WEAKREF && defined(HAVE___SECURE_GETENV) static char* weak_secure_getenv (const char*) - __attribute__((__weakref__("__secure_gettime"))); + __attribute__((__weakref__("__secure_getenv"))); #endif char * secure_getenv (const char *name) { -#if SUPPORTS_WEAKREF && defined(HAVE__SECURE_GETENV) +#if SUPPORTS_WEAKREF && defined(HAVE___SECURE_GETENV) if (weak_secure_getenv) return weak_secure_getenv (name); #endif