Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if it has been defined before defining _GNU_SOURCE #7958

Closed
wants to merge 1 commit into from

Conversation

rdmark
Copy link

@rdmark rdmark commented Sep 7, 2024

Description

Do a check for the _GNU_SOURCE macro before defining it.

Fixes #7957

Testing

Tested by building WolfSSL 5.7.2 against Netatalk.

Checklist

N/A

@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@dgarske
Copy link
Contributor

dgarske commented Sep 9, 2024

Okay to test. Contributor agreement in progress.

@dgarske
Copy link
Contributor

dgarske commented Sep 9, 2024

Retest this please:

dtls.txt_57
SSL_read input error -501, can't match cipher suite
client failed! Suite = DHE-RSA-AES128-SHA256 version = 3

Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not merge until contributor agreement has been approved.

Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the problem this addresses is when a system header defines _GNU_SOURCE to 1, then this is undone by the code in bio.c and ssl.c. Seems like a good fix.

I'd like to see the #undef _GNU_SOURCE clauses removed from inside the conditions, now that the outer gates have made them frivolous.

@@ -24,7 +24,7 @@
#endif

#include <wolfssl/wolfcrypt/settings.h>
#if defined(OPENSSL_EXTRA) && !defined(_WIN32)
#if defined(OPENSSL_EXTRA) && !defined(_WIN32) && !defined(_GNU_SOURCE)
/* turn on GNU extensions for XVASPRINTF with wolfSSL_BIO_printf */
#undef _GNU_SOURCE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this now that it's frivolous

@@ -25,7 +25,7 @@
#endif

#include <wolfssl/wolfcrypt/settings.h>
#if defined(OPENSSL_EXTRA) && !defined(_WIN32)
#if defined(OPENSSL_EXTRA) && !defined(_WIN32) && !defined(_GNU_SOURCE)
/* turn on GNU extensions for XISASCII */
#undef _GNU_SOURCE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

@douzzer
Copy link
Contributor

douzzer commented Sep 12, 2024

superseded by #7971

@douzzer douzzer closed this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: _GNU_SOURCE macro defined twice in the codebase
4 participants