Skip to content

Commit

Permalink
Fix some problems on old platforms like Solaris 8 and 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed May 21, 2014
1 parent 49cf904 commit 910a219
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
29 changes: 29 additions & 0 deletions autoconf/configure.in
Expand Up @@ -1049,6 +1049,16 @@ if test "x$support_crypto" != "xno" -o "x$support_tls" != "xno"; then
CFLAGS="${saved_CFLAGS} ${OPENSSL_INC}"
CPPFLAGS="${saved_CPPFLAGS} ${OPENSSL_INC}"

AC_TRY_LINK(
[
#include <openssl/engine.h>
], [
ENGINE_load_pk11();
], [
AC_DEFINE(HAVE_ENGINE_LOAD_PK11, 1, [Define to 1 if OpenSSL library has ENGINE_load_pk11 available])
]
)

AC_TRY_LINK(
[
#include <openssl/ssl.h>
Expand Down Expand Up @@ -2700,6 +2710,20 @@ CPPFLAGS="${saved_CPPFLAGS} ${ZLIB_INC}"

AC_CHECK_HEADERS(zlib.h)

AC_MSG_CHECKING(for compressBound in zlib library)
AC_TRY_LINK(
[
#include <zlib.h>
], [
compressBound(0);
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_COMPRESS_BOUND, 1, [Define to 1 if you have compressBound])
], [
AC_MSG_RESULT(no)
]
)

AC_MSG_CHECKING(for deflate in zlib library)
AC_TRY_LINK(
[
Expand Down Expand Up @@ -3854,9 +3878,14 @@ solaris)
5.5|5.6)
AC_DEFINE(HAVE_OLD_SOCKOPT, 1, [Define to 1 to use the old sockopt option])
AC_DEFINE(USE_THR_SETCONCURRENCY, 1, [Define to 1 to use the thr_setconcurrency function])
AC_DEFINE(HAVE_NON_WORKING_WALKCONTEXT, 1, [Define to 1 to when walkcontext does not work])
;;
5.7|5.8)
AC_DEFINE(USE_THR_SETCONCURRENCY, 1, [Define to 1 to use the thr_setconcurrency function])
AC_DEFINE(HAVE_NON_WORKING_WALKCONTEXT, 1, [Define to 1 to when walkcontext does not work])
;;
5.9)
AC_DEFINE(HAVE_NON_WORKING_WALKCONTEXT, 1, [Define to 1 to when walkcontext does not work])
;;
*)
;;
Expand Down
2 changes: 1 addition & 1 deletion src/findlib/acl.c
Expand Up @@ -2056,7 +2056,7 @@ static bacl_exit_code solaris_build_acl_streams(JCR *jcr,
char *acl_text;

n = acl(acl_data->last_fname, GETACLCNT, 0, NULL);
if (n < MIN_ACL_ENTRIES)
if (n < MIN_ACL_ENTRIES) {
return bacl_exit_error;
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/bsys.c
Expand Up @@ -1054,6 +1054,7 @@ void stack_trace()
* Support strack_trace support on Solaris when using the SUNPRO_CC compiler.
*/
#elif defined(HAVE_SUN_OS) && \
!defined(HAVE_NON_WORKING_WALKCONTEXT) && \
defined(HAVE_UCONTEXT_H) && \
defined(HAVE_DEMANGLE_H) && \
defined(HAVE_CPLUS_DEMANGLE) && \
Expand Down
5 changes: 5 additions & 0 deletions src/lib/compression.c
Expand Up @@ -49,6 +49,11 @@
#endif

#ifdef HAVE_LIBZ

#ifndef HAVE_COMPRESS_BOUND
#define compressBound(sourceLen) (sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13)
#endif

/*
* Convert ZLIB error code into an ASCII message
*/
Expand Down
9 changes: 6 additions & 3 deletions src/lib/crypto_openssl.c
Expand Up @@ -1384,14 +1384,17 @@ int init_crypto(void)
Jmsg0(NULL, M_ERROR_TERM, 0, _("Failed to seed OpenSSL PRNG\n"));
}

#ifndef HAVE_SUN_OS /* FIXME: Until https://www.illumos.org/issues/1667 is solved. */
#ifdef HAVE_ENGINE_LOAD_PK11
/*
* FIXME: Until https://www.illumos.org/issues/1667 is solved.
*/
ENGINE_load_pk11();
#else
/*
* Load all the builtin engines.
*/
ENGINE_load_builtin_engines();
ENGINE_register_all_complete();
#else
ENGINE_load_pk11();
#endif

crypto_initialized = true;
Expand Down

0 comments on commit 910a219

Please sign in to comment.