GNU bug report logs - #30176
readlinkat and _FORTIFY_SOURCE on Cygwin

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Fri, 19 Jan 2018 20:47:01 UTC

Severity: important

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 30176 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ken Brown <kbrown <at> cornell.edu>, 30176 <at> debbugs.gnu.org
Subject: Re: bug#30176: readlinkat and _FORTIFY_SOURCE on Cygwin
Date: Fri, 19 Jan 2018 15:25:02 -0800
On 01/19/2018 12:46 PM, Ken Brown wrote:
> I can think of three possibilities, but maybe there's something better:
>
> 1. Add "#define _FORTIFY_SOURCE 0' at the top of fileio.c (Cygwin only).
>
> 2. Pretend like Cygwin doesn't have readlinkat.  Then gnulib will 
> create its own definition, which will be found by the linker in 
> libegnu.a.
>
> 3. Ask gnulib to come up with a fix.

(2) is presumably not good, since the substitute readlinkat will have to 
execute several system calls and this will be problematic.

(1) should work but kind of misses the point of fortification.

I don't know what would be involved in (3).

How about a better option, like this:

4. Fix Cygwin readlinkat so that it can be used as a function pointer 
even when _FORTIFY_SOURCE is used.

Why not do what glibc does with readlinkat? It fortifies readlinkat, and 
doesn't run into this problem.




This bug report was last modified 7 years and 127 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.