From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#30176: readlinkat and _FORTIFY_SOURCE on Cygwin Date: Fri, 19 Jan 2018 15:25:02 -0800 Organization: UCLA Computer Science Department Message-ID: <884dbad2-610c-63c5-679d-4b1549afac32@cs.ucla.edu> References: <27a80447-e39b-0099-6063-1ab3517f668c@cornell.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1516404259 31748 195.159.176.226 (19 Jan 2018 23:24:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 19 Jan 2018 23:24:19 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 To: Ken Brown , 30176@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 20 00:24:15 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecg12-0007aj-K6 for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Jan 2018 00:24:08 +0100 Original-Received: from localhost ([::1]:52927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecg32-00022M-ON for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jan 2018 18:26:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecg2w-000228-2M for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 18:26:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecg2t-0001De-4f for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 18:26:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55683) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ecg2s-0001Cv-S3 for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 18:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ecg2s-0003RT-F5 for bug-gnu-emacs@gnu.org; Fri, 19 Jan 2018 18:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Jan 2018 23:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30176 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30176-submit@debbugs.gnu.org id=B30176.151640431313152 (code B ref 30176); Fri, 19 Jan 2018 23:26:02 +0000 Original-Received: (at 30176) by debbugs.gnu.org; 19 Jan 2018 23:25:13 +0000 Original-Received: from localhost ([127.0.0.1]:35347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecg24-0003Q4-G8 for submit@debbugs.gnu.org; Fri, 19 Jan 2018 18:25:12 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:43702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecg21-0003Pl-Vr for 30176@debbugs.gnu.org; Fri, 19 Jan 2018 18:25:10 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D3E6E1615E2; Fri, 19 Jan 2018 15:25:03 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id DaRxJ3MB3y5V; Fri, 19 Jan 2018 15:25:03 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 29E6C1616A5; Fri, 19 Jan 2018 15:25:03 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nl_7FkEUCmZ6; Fri, 19 Jan 2018 15:25:03 -0800 (PST) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id F107A1615E2; Fri, 19 Jan 2018 15:25:02 -0800 (PST) In-Reply-To: <27a80447-e39b-0099-6063-1ab3517f668c@cornell.edu> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142307 Archived-At: 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.=C2=A0 Then gnulib will=20 > create its own definition, which will be found by the linker in=20 > libegnu.a. > > 3. Ask gnulib to come up with a fix. (2) is presumably not good, since the substitute readlinkat will have to=20 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=20 even when _FORTIFY_SOURCE is used. Why not do what glibc does with readlinkat? It fortifies readlinkat, and=20 doesn't run into this problem.