Patch for building libassuan with GCC4, _FORTIFY_SOURCE
Closed, ResolvedPublic

Description

Release: 0.6.9

Environment

Fedora Core 4 (test1), GCC4

Description

The attached patch fixes a libassuan build failure with GCC4, using _FORTIFY_SOURCE.

How To Repeat

Build libassuan 0.6.9 with GCC4, using -Wp,-D_FORTIFY_SOURCE=2

Fix

Attached.

Release Note

Fixed in libassuan and gpgme CVS by renaming the read adn write elements.

Related Objects

werner closed this task as Resolved.Mar 22 2005, 11:00 AM
werner added a subscriber: werner.

From: Werner Koch <wk@gnupg.org>
To: ville.skytta@iki.fi
Cc: bug-any@bugs.gnupg.org
Subject: Re: gnupg/439
Date: Mon, 21 Mar 2005 20:26:08 +0100

  • ssize_t n = ctx->io->read (ctx, buf, nleft);

+ ssize_t n = (ctx->io->read) (ctx, buf, nleft);

I don't look the use these parenthesis as it makes the code harder to
read.

Shalom-Salam,

Werner

From: Ville =?ISO-8859-1?Q?Skytt=E4?= <ville.skytta@iki.fi>
To: Werner Koch <wk@gnupg.org>
Cc: bug-any@bugs.gnupg.org
Subject: Re: gnupg/439
Date: Mon, 21 Mar 2005 21:52:02 +0200

On Mon, 2005-03-21 at 20:26 +0100, Werner Koch wrote:

  • ssize_t n = ctx->io->read (ctx, buf, nleft); + ssize_t n = (ctx->io->read) (ctx, buf, nleft);

    I don't look the use these parenthesis as it makes the code harder to read.

Hm, could you clarify what you mean by "don't look"? Some kind of
change is required anyway if one wants to build with _FORTIFY_SOURCE.

The info about _FORTIFY_SOURCE is somewhat scarce, but here's something:
http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=150429

Also, from /usr/include/features.h:
_FORTIFY_SOURCE If set to numeric value > 0 additional security

measures are defined, according to level.

__USE_FORTIFY_LEVEL Additional security measures used, according to level.

The same issue is present in gpgme, by the way.

From: Werner Koch <wk@gnupg.org>
To: =?utf-8?q?Ville_Skytt=C3=A4?= <ville.skytta@iki.fi>
Cc: bug-any@bugs.gnupg.org
Subject: Re: gnupg/439
Date: Tue, 22 Mar 2005 09:50:39 +0100

On Mon, 21 Mar 2005 21:52:02 +0200, Ville Skytt=C3=A4 said:

I don't look the use these parenthesis as it makes the code harder to
read.

Hm, could you clarify what you mean by "don't look"? Some kind of

Oops I meant "like".

change is required anyway if one wants to build with _FORTIFY_SOURCE.

It has nothing to do with _FORTIFY_SOURCE tough. The code is simply
not correct accroing to the latest POSIX. I'll fix it.

Thanks,

Werner

Fixed. Thanks for reporting.