Jump to content

[10138] FreeBSD OpenSSL Library Fix


antiroot

Recommended Posts

MaNGOS Revisions early 9xxx - HEAD [10130]

Under FreeBSD OpenSSL is not linked properly

The includes are set correct, and the library flags are correct, but the library path is never passed (ie -L/usr/local/lib on my system) this causes warnings in logs and also means the wrong libs are being used.

This results in building with correct includes/headers but incorrect libs

2010-06-30 11:30:47 OpenSSL 1.0.0a 1 Jun 2010 (Library: OpenSSL 0.9.8e 23 Feb 2007)
2010-06-30 11:30:47 WARNING: Outdated version of OpenSSL lib. Logins to server may not work!
2010-06-30 11:30:47 WARNING: Minimal required version [OpenSSL 0.9.8k]

If you installed OpenSSL and overwrite the base system openssl this problem never occurs, however if done the FreeBSD recommended way, you install OpenSSL from ports than the (older) base libraries are being used while only the (newer) ports includes are used which is where the problem is coming from.

Here is a git-diff patch to fix the configure file

Also there is a space between -L and the path to the libs in m4/ax_check_openssl.m4, I have changed this to follow the same syntax where we do other linking

diff --git a/configure.ac b/configure.ac
index 1fc4248..810233e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -254,7 +254,7 @@ AM_CONDITIONAL([MANGOS_BUILD_ACE], [test X$enable_builtin_ace_support = Xyes])
## Unify all additional includes/libs in one variable.
# TODO this looks kinda ugly, but when we add m4 folder I will make it look very pritey ( by Derex ).
MANGOS_INCLUDES="$ACE_INCLUDES $POSTGRE_INCLUDES $MYSQL_INCLUDES $OPENSSL_INCLUDES $MANGOS_INCLUDES"
-MANGOS_LIBS="$ACE_LIBS $POSTGRE_LIBS $MYSQL_LIBS $ZLIB $COMPATLIB $OPENSSL_LIBS $MANGOS_LIBS"
+MANGOS_LIBS="$ACE_LIBS $POSTGRE_LIBS $MYSQL_LIBS $ZLIB $COMPATLIB $OPENSSL_LDFLAGS $OPENSSL_LIBS $MANGOS_LIBS"

## Export defined variables
AC_SUBST(DOXYGEN)
diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4
index 7f5c319..8c8740d 100644
--- a/m4/ax_check_openssl.m4
+++ b/m4/ax_check_openssl.m4
@@ -76,7 +76,7 @@ AC_DEFUN([AX_CHECK_OPENSSL], [
            AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
            if test -f "$ssldir/include/openssl/ssl.h"; then
                OPENSSL_INCLUDES="-I$ssldir/include"
-                OPENSSL_LDFLAGS="-L $ssldir/lib"
+                OPENSSL_LDFLAGS="-L$ssldir/lib"
                OPENSSL_LIBS="-lssl -lcrypto"
                found=true
                AC_MSG_RESULT([yes])

@Vladimir would you test this and commit if its correct since I know you use FreeBSD as well.

@Community please test to make sure works under linux/windows still.

I'm working on a FreeBSD + MaNGOS install/configure/upgrade guide and because of this issue I've not yet posted it to the forums, but I will once this has been committed.

EDIT: my logs after applying these changes

2010-07-01 08:53:01 OpenSSL 1.0.0a 1 Jun 2010 (Library: OpenSSL 1.0.0a 1 Jun 2010)

Edit: Should I have posted this in "... Under Review"? I assumed this is where this should have been by reading the description of the Bug Report forum

"You found a bug? Written a patch? Then this section is for you" Sorry if this is the wrong place if this is the case

Link to comment
Share on other sites

Also Logins in-game and RA/SOAP still work the same as before, nothing noticeable has been affected by this patch since I applied it to my server, other than the Logs no longer having Warning complaints :)

No unexplained crashes, no strange warnings or errors in logs at LogLevel 3

Just tested this with FreeBSD 8.0 64bit in a virtual machine and it works there as well as my server FreeBSD 7.2 32bit

Link to comment
Share on other sites

Edit: Should I have posted this in "... Under Review"?

I recommend post patches to under review. Because in bug section it easy lost in history if not seen in first day and will not posts.

Bug section for bug reports without sollutions.

Ofc, this patch not need repost already, i already look at it ;)

[added]In [10138]. Thank you :)

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use