Skip to contentSkip to conversation

OpenVPN 2.1_rc15 GCC 2.96 incompatibility

Openvpn-devel Jos Vos 3 participants 5 messages Jan 27, 2009

lore
Share & tools
lore

Jos Vos

author
#0 lore raw

Hi,

While there were some incompatibilities with older GCC releases resolved from RC9 to RC15 (I didn't try the releases RC10-RC14), a new incompatibility was introduced concerning the C preprocessor in ssl.c: #ifdef's in macro calls do not seem to be allowed with GCC 2.96.

Attached a brute-force patch to fix that. This patch was tested on Red Hat Linux 7.3 with GCC 2.96.

Regards,

Signature · 3 lines
--    Jos Vos <[email protected]...>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204
ssl.c renamed from ssl.c.orig +5 -2
@@ -3398,14 +3398,17 @@
 	    
 	  if ((session->opt->ssl_flags & SSLF_USERNAME_AS_COMMON_NAME))
 	    set_common_name (session, up->username);
-	  msg (D_HANDSHAKE, "TLS: Username/Password authentication %s for username '%s' %s",
 #ifdef ENABLE_DEF_AUTH
+	  msg (D_HANDSHAKE, "TLS: Username/Password authentication %s for username '%s' %s",
 	       ks->auth_deferred ? "deferred" : "succeeded",
+	       up->username,
+	       (session->opt->ssl_flags & SSLF_USERNAME_AS_COMMON_NAME) ? "[CN SET]" : "");
 #else
+	  msg (D_HANDSHAKE, "TLS: Username/Password authentication %s for username '%s' %s",
 	       "succeeded",
-#endif
 	       up->username,
 	       (session->opt->ssl_flags & SSLF_USERNAME_AS_COMMON_NAME) ? "[CN SET]" : "");
+#endif
 	}
       else
 	{
#1 lore raw
Quoted 8 lines · Jos Vos

While there were some incompatibilities with older GCC releases resolved from RC9 to RC15 (I didn't try the releases RC10-RC14), a new incompatibility was introduced concerning the C preprocessor in ssl.c: #ifdef's in macro calls do not seem to be allowed with GCC 2.96.

Attached a brute-force patch to fix that. This patch was tested on Red Hat Linux 7.3 with GCC 2.96.

Come on, nobody needs support for outdated operating systems and rogue releases of GCC. There has never been a GCC 2.96, and Redhat 7.3 has been out of security support for more than half a decade now, and if OpenVPN 2.1 breaks on such systems, that's perhaps some more incentive for their users to upgrade. See:

* <http://gcc.gnu.org/gcc-2.96.html>
* <http://www.redhat.com/security/updates/eol/>

Signature · 1 line
Matthias Andree
author
#2 lore raw
Quoted 8 lines · Matthias Andree

Come on, nobody needs support for outdated operating systems and rogue releases of GCC. There has never been a GCC 2.96, and Redhat 7.3 has been out of security support for more than half a decade now, and if OpenVPN 2.1 breaks on such systems, that's perhaps some more incentive for their users to upgrade. See:

* <http://gcc.gnu.org/gcc-2.96.html>
* <http://www.redhat.com/security/updates/eol/>

The rc10 ChangeLog says

* Fixed separate compile errors in options.c and ntlm.c that occur on strict C compilers (such as old versions of gcc) that require that C variable declarations occur at the start of a {} block, not in the middle.

so I thought this might fall into the same category (although I don't know if this way of using the C preprocessor is formally allowed or not). But I don't mind *not* sharing this kind of patches anymore in the future, if that bothers people too much.

And yes, I do know the status of old RH and GCC releases and I do know that this patch is not necessary for "normal" use.

Signature · 3 lines
--    Jos Vos <[email protected]...>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204
#4 lore raw
In reply to Jos Vos

Added to:
http://svn.openvpn.net/projects/openvpn/contrib/alon/BETA21-oldgcc

Up to james to merge.

Quoted 31 lines · Jos Vos

Hi,

While there were some incompatibilities with older GCC releases resolved from RC9 to RC15 (I didn't try the releases RC10-RC14), a new incompatibility was introduced concerning the C preprocessor in ssl.c: #ifdef's in macro calls do not seem to be allowed with GCC 2.96.

Attached a brute-force patch to fix that. This patch was tested on Red Hat Linux 7.3 with GCC 2.96.

Regards,

--

 --    Jos Vos <[email protected]...>
 --    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
 --    Amsterdam, The Netherlands        |     Fax: +31 20 6948204

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#3 lore raw
In reply to Jos Vos
Quoted 18 lines · Jos Vos
Quoted 8 lines · Matthias Andree

Come on, nobody needs support for outdated operating systems and rogue releases of GCC. There has never been a GCC 2.96, and Redhat 7.3 has been out of security support for more than half a decade now, and if OpenVPN 2.1 breaks on such systems, that's perhaps some more incentive for their users to upgrade. See:

* <http://gcc.gnu.org/gcc-2.96.html>
* <http://www.redhat.com/security/updates/eol/>

The rc10 ChangeLog says

* Fixed separate compile errors in options.c and ntlm.c that occur on strict C compilers (such as old versions of gcc) that require that C variable declarations occur at the start of a {} block, not in the middle.

Quoted 4 lines

so I thought this might fall into the same category (although I don't know if this way of using the C preprocessor is formally allowed or not). But I don't mind *not* sharing this kind of patches anymore in the future, if that bothers people too much.

Sorry, I didn't mean to offend you, <lang='nl'>en dank je wel voor jouw patch</lang>; I was merely stumbling across "gcc-2.96/RH 7.3" which made me misinterpret the real motivation. The official gcc 2.95.3 doesn't compile ssl.c either, and apparently it's rightfully refusing to (I checked the opencsw.org compiler on Solaris 8 SPARC).

I checked around a bit, and for not having a current C standard handy, I'll relay this Apple developer document instead, without checking it:

http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/cpp/Directives-Within-Macro-Arguments.html#Directives-Within-Macro-Arguments

where Apple effectively state that the behaviour OpenVPN requests is undefined. If they're right, the behaviour used in ssl.c that you fixed was a GCC 3.2+ extension, so your patch fixes a real bug rather than compability with ancient compilers. I stand corrected.

Sorry for the harsh tone.

Take care,

Signature · 1 line
Matthias Andree