Changeset 203


Ignore:
Timestamp:
Dec 7, 2008, 7:26:17 PM (16 years ago)
Author:
katerina
Message:

Fix compile failures on RHEL3 (ticket #130) and FreeBSD7 amd64 (ticket #131).

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r202 r203  
    3535AC_SUBST(BUILD_CC)
    3636
    37 if test "x$GCC" = "xyes"; then
    38    GCC_STACK_PROTECT_LIB
    39    GCC_STACK_PROTECT_CC
    40    GCC_PIE_CC
    41 fi
    42 
    4337AC_HEADER_STDC
    4438dnl
     
    4943
    5044
    51 AC_MSG_CHECKING([for host-specific issues])
     45AC_MSG_CHECKING([for OS specific issues])
    5246mydebugflag=no
    5347myneedg3=no
     
    5751sh_use_lcaps="undef"
    5852dnmalloc_ok=yes
     53sh_use_pie=yes
    5954
    6055case "$host_os" in
     
    6459        AC_DEFINE(HOST_IS_LINUX)
    6560        AC_DEFINE(HAVE_EXT2_IOCTLS)
    66         AC_MSG_RESULT(LINUX use ioctl to get e2fs flags)
     61        AC_MSG_RESULT(use ioctl to get e2fs flags)
    6762        case "$host_cpu" in
    6863           i*86*)
     
    8075          CFLAGS="$CFLAGS -O2 -assume noaligned_objects"
    8176          myneedg3=yes
    82           AC_MSG_RESULT(OSF1 compiler needs assume noaligned_objects)
     77          AC_MSG_RESULT(compiler needs assume noaligned_objects)
    8378        else
    8479          AC_MSG_RESULT(none)
     
    8984        AC_DEFINE(HOST_IS_CYGWIN)
    9085        dnmalloc_ok=no
    91         AC_MSG_RESULT(CYGWIN no trusted paths and no dnmalloc)
     86        AC_MSG_RESULT(no trusted paths and no dnmalloc)
    9287        ;;
    9388
    9489        *darwin*)
    9590        AC_DEFINE(HOST_IS_DARWIN)
    96         AC_MSG_RESULT(DARWIN check resource forks)
     91        AC_MSG_RESULT(check resource forks)
    9792        ;;
    9893
     94        *freebsd7*)
     95        AC_DEFINE(HOST_IS_FREEBSD)
     96        selectconfig=freebsd
     97        case "$host_cpu" in
     98                amd64)
     99                sh_use_pie=no
     100                dnmalloc_ok=no
     101                AC_MSG_RESULT([no dnmalloc and broken compiler toolchain])
     102                ;;
     103                *)
     104                AC_MSG_RESULT(none)
     105                ;;
     106        esac
     107        ;;
     108       
    99109        *freebsd*)
    100110        AC_DEFINE(HOST_IS_FREEBSD)
     
    107117        selectconfig=freebsd
    108118        dnmalloc_ok=no
    109         AC_MSG_RESULT(OpenBSD dnmalloc does not work with pthreads)
     119        AC_MSG_RESULT(dnmalloc does not work with pthreads)
    110120        ;;
    111121
     
    113123        mynetbsd=yes
    114124        selectconfig=netbsd
    115         AC_MSG_RESULT(NETBSD bug with libresolve)
     125        AC_MSG_RESULT(bug with libresolve)
    116126        ;;
    117127
     
    122132                i*86)
    123133                AC_DEFINE(HOST_IS_I86SOLARIS)
    124                 AC_MSG_RESULT(SOLARIS I86 vsnprintf prototype)
     134                AC_MSG_RESULT(vsnprintf prototype)
    125135                ;;
    126136                *)
     
    195205AC_DEFINE_UNQUOTED(UID_CAST, ${uid_cast})
    196206
    197 dnl Test whether gcc supports -Wno-empty-body
    198 dnl Suppresses warnings from glibc pthread_cleanup_pop
    199 dnl
    200 GCC_WEMPTY_BODY
    201207
    202208
     
    316322                AC_HEADER_EGREP(comp_t,   sys/acct.h, AC_DEFINE(HAVE_COMP_T, ,
    317323                                                                [Define if <sys/acct.h> uses the COMP_T type.]))
     324                AC_HEADER_EGREP([struct acct_v3],   sys/acct.h, AC_DEFINE(HAVE_ACCT_V3, ,
     325                                                                [Define if <sys/acct.h> has struct acct_v3.]))
    318326 )
    319327
     
    624632
    625633AM_SA_SIGACTION_WORKS
     634
     635if test "x$GCC" = "xyes"; then
     636   GCC_STACK_PROTECT_LIB
     637   GCC_STACK_PROTECT_CC
     638   GCC_PIE_CC
     639fi
    626640
    627641dnl *****************************************
     
    975989)
    976990
    977 if test x$enable_static = xyes; then
    978    :
    979 else
    980    LDFLAGS="$LDFLAGS $PIE_LDFLAGS"
    981    CFLAGS="$CFLAGS $PIE_CFLAGS"
    982 fi
    983 
    984991if test x"${mytclient}" = x-DSH_STANDALONE -o x"${mytclient}" = x-DSH_WITH_CLIENT;
    985992then
     
    9931000        CHECK_ZLIB()
    9941001fi
     1002
     1003if test x$enable_static = xyes; then
     1004   :
     1005else
     1006   if test x$sh_use_pie = xyes; then
     1007      LDFLAGS="$LDFLAGS $PIE_LDFLAGS"
     1008      CFLAGS="$CFLAGS $PIE_CFLAGS"
     1009   fi
     1010fi
     1011
    9951012       
    9961013#
     
    14401457                           LIBS="-lpcre $LIBS"
    14411458                           ],
    1442                            AC_MSG_ERROR([The --enable-logfile-monitor option requires libpcre. For compiling the pcre development package is needed.])
     1459                           [
     1460                                AC_CHECK_HEADER(pcre/pcre.h,
     1461                                [
     1462                                AC_DEFINE(USE_LOGFILE_MONITOR, 1, [Define if you want the logfile monitor module.])
     1463                                AC_DEFINE(HAVE_PCRE_PCRE_H, 1, [Define if you have pcre/pcre.h.])
     1464                                LIBS="-lpcre $LIBS"
     1465                                ],
     1466                                AC_MSG_ERROR([The --enable-logfile-monitor option requires libpcre. For compiling the pcre development package is needed.])
     1467                                )
     1468                          ]
    14431469           )
    14441470        fi
     
    15841610
    15851611fi
     1612
     1613dnl Test whether gcc supports -Wno-empty-body
     1614dnl Suppresses warnings from glibc pthread_cleanup_pop
     1615dnl
     1616GCC_WEMPTY_BODY
    15861617
    15871618AC_MSG_CHECKING([which random module to use])
  • trunk/docs/Changelog

    r202 r203  
    112.5.1:
     2        * workaround for freebsd7 amd64 lossage (compiler toolchain,
     3          no mmap to 32bit address space)
     4        * samhain-install.sh: check for presence of stealth_template.ps
     5          before trying to create it
    26        * use -Wno-empty-body if supported to suppress warnings about
    37          glibc pthread_cleanup_pop implementation
  • trunk/samhain-install.sh.in

    r191 r203  
    14151415        IFS=${OIFS}
    14161416
    1417         if test x"${CONVERT}" = x
    1418         then
    1419             echo "${0}: cannot find ImageMagick convert utility in PATH=${PATH}"
    1420             exit 1
    1421         fi
    1422 
    1423         PATH=${OPATH}
    1424 
    1425         if test -f stealth_template.jpg
    1426         then
    1427             test -z "$verbose" || echo "  ${CONVERT} +compress stealth_template.jpg stealth_template.ps"
    1428             "${CONVERT}" +compress stealth_template.jpg stealth_template.ps
    1429         else
    1430             echo "${0}: cannot find file stealth_template.jpg"
    1431             exit 1
    1432         fi
     1417        if test -f stealth_template.ps
     1418        then
     1419            PATH=${OPATH}
     1420        else
     1421            if test x"${CONVERT}" = x
     1422            then
     1423                echo "${0}: cannot find ImageMagick convert utility in PATH=${PATH}"
     1424                exit 1
     1425            fi
     1426
     1427            PATH=${OPATH}
     1428
     1429            if test -f stealth_template.jpg
     1430            then
     1431                test -z "$verbose" || echo "  ${CONVERT} +compress stealth_template.jpg stealth_template.ps"
     1432                "${CONVERT}" +compress stealth_template.jpg stealth_template.ps
     1433            else
     1434                echo "${0}: cannot find file stealth_template.jpg"
     1435                exit 1
     1436            fi
     1437        fi
    14331438
    14341439
  • trunk/src/make-tests.sh

    r172 r203  
    2020#include <stdio.h>
    2121#include "CuTest.h"
     22#include "config.h"
    2223
    2324'
  • trunk/src/samhain.c

    r174 r203  
    824824  ino = (long) buf.st_ino;
    825825   
    826   if (NULL == (dp = opendir("/proc")))
     826  if (NULL == (dp = opendir(_("/proc"))))
    827827    {
    828828      return NULL;
  • trunk/src/sh_gpg.c

    r198 r203  
    257257  char   cc3[32];
    258258  char   cc4[SH_PATHBUF+32];
    259   char   cc5[32] = "--no-tty";
     259  char   cc5[32];
    260260#endif
    261261
     
    283283  /* sl_strlcpy (cc4,   sh.effective.home, SH_PATHBUF+32); */
    284284  sl_strlcpy (cc4,   homedir,           SH_PATHBUF+32);
    285   sl_strlcat (cc4,   _("/.gnupg"),      SH_PATHBUF+32);
     285  sl_strlcat (cc4,   _("/.gnupg"),      SH_PATHBUF+32);
     286  sl_strlcpy (cc5,   _("--no-tty"),     32);
    286287
    287288  /* fprintf(stderr, "YULE: homedir=%s\n", homedir); */
     
    416417      envp[0] = malloc (len); /* free() ok   */
    417418      if (envp[0] != NULL)
    418         sl_snprintf (envp[0], len, "HOME=%s", sh.effective.home);
     419        sl_snprintf (envp[0], len, _("HOME=%s"), sh.effective.home);
    419420      envp[1] = NULL;
    420421    }
  • trunk/src/sh_log_check.c

    r199 r203  
    1414
    1515/* Debian/Ubuntu: libpcre3-dev */
     16#ifdef HAVE_PCRE_PCRE_H
     17#include <pcre/pcre.h>
     18#else
    1619#include <pcre.h>
     20#endif
    1721
    1822#include "samhain.h"
  • trunk/src/sh_log_evalrule.c

    r186 r203  
    1515
    1616/* Debian/Ubuntu: libpcre3-dev */
     17#ifdef HAVE_PCRE_PCRE_H
     18#include <pcre/pcre.h>
     19#else
    1720#include <pcre.h>
     21#endif
     22
     23#ifndef PCRE_NO_AUTO_CAPTURE
     24#define PCRE_NO_AUTO_CAPTURE 0
     25#endif
    1826
    1927#include "samhain.h"
  • trunk/src/sh_log_parse_apache.c

    r186 r203  
    2929
    3030/* Debian/Ubuntu: libpcre3-dev */
     31#ifdef HAVE_PCRE_PCRE_H
     32#include <pcre/pcre.h>
     33#else
    3134#include <pcre.h>
     35#endif
    3236
    3337#include "samhain.h"
  • trunk/src/sh_log_parse_pacct.c

    r199 r203  
    227227sh_string * sh_read_pacct (sh_string * record, struct sh_logfile * logfile)
    228228{
    229 #if defined(__linux__)
     229#if defined(__linux__) && defined(HAVE_ACCT_V3)
    230230#  define STRUCT_ACCT struct acct_v3
    231231#else
  • trunk/src/sh_processcheck.c

    r183 r203  
    196196  char *      tmp;
    197197
    198   sl_snprintf (path, sizeof(path), "/proc/%ld/exe", (unsigned long) pid);
     198  sl_snprintf (path, sizeof(path), _("/proc/%ld/exe"), (unsigned long) pid);
    199199
    200200  if (0 == retry_lstat(FIL__, __LINE__, path, &sbuf) && S_ISLNK(sbuf.st_mode))
     
    203203    }
    204204
    205   sl_snprintf (path, sizeof(path), "/proc/%ld/file", (unsigned long) pid);
     205  sl_snprintf (path, sizeof(path), _("/proc/%ld/file"), (unsigned long) pid);
    206206
    207207  if (0 == retry_lstat(FIL__, __LINE__, path, &sbuf) && S_ISLNK(sbuf.st_mode))
     
    210210    }
    211211
    212   sl_snprintf (path, sizeof(path), "/proc/%ld/path/a.out", (unsigned long) pid);
     212  sl_snprintf (path, sizeof(path), _("/proc/%ld/path/a.out"), (unsigned long) pid);
    213213
    214214  if (0 == retry_lstat(FIL__, __LINE__, path, &sbuf) && S_ISLNK(sbuf.st_mode))
  • trunk/src/sh_unix.c

    r200 r203  
    20832083      int r;
    20842084
    2085       while((r = waitpid(pid, &status, WCONTINUED|WUNTRACED)) != pid && r != -1) ;
     2085      while((r = waitpid(pid, &status, WUNTRACED)) != pid && r != -1) ;
    20862086
    20872087#if !defined(USE_UNO)
  • trunk/src/sh_userfiles.c

    r149 r203  
    215215     * So, compare longest strings first */
    216216    if( s == NULL ) /* The default */          new->level = default_level;
    217     else if ( strstr(s, "attributes")!= NULL ) new->level = SH_LEVEL_ATTRIBUTES;
    218     else if ( strstr(s, "allignore") != NULL ) new->level = SH_LEVEL_ALLIGNORE;
    219     else if ( strstr(s, "noignore")  != NULL ) new->level = SH_LEVEL_NOIGNORE;
    220     else if ( strstr(s, "logfiles")  != NULL ) new->level = SH_LEVEL_LOGFILES;
    221     else if ( strstr(s, "readonly")  != NULL ) new->level = SH_LEVEL_READONLY;
    222     else if ( strstr(s, "loggrow")   != NULL ) new->level = SH_LEVEL_LOGGROW;
    223     else if ( strstr(s, "user0")     != NULL ) new->level = SH_LEVEL_USER0;
    224     else if ( strstr(s, "user1")     != NULL ) new->level = SH_LEVEL_USER1;
    225     else if ( strstr(s, "user2")     != NULL ) new->level = SH_LEVEL_USER2;
    226     else if ( strstr(s, "user3")     != NULL ) new->level = SH_LEVEL_USER3;
    227     else if ( strstr(s, "user4")     != NULL ) new->level = SH_LEVEL_USER4;
    228     else if ( strstr(s, "prelink")   != NULL ) new->level = SH_LEVEL_PRELINK;
     217    else if ( strstr(s, _("attributes"))!= NULL ) new->level = SH_LEVEL_ATTRIBUTES;
     218    else if ( strstr(s, _("allignore")) != NULL ) new->level = SH_LEVEL_ALLIGNORE;
     219    else if ( strstr(s, _("noignore"))  != NULL ) new->level = SH_LEVEL_NOIGNORE;
     220    else if ( strstr(s, _("logfiles"))  != NULL ) new->level = SH_LEVEL_LOGFILES;
     221    else if ( strstr(s, _("readonly"))  != NULL ) new->level = SH_LEVEL_READONLY;
     222    else if ( strstr(s, _("loggrow"))   != NULL ) new->level = SH_LEVEL_LOGGROW;
     223    else if ( strstr(s, _("user0"))     != NULL ) new->level = SH_LEVEL_USER0;
     224    else if ( strstr(s, _("user1"))     != NULL ) new->level = SH_LEVEL_USER1;
     225    else if ( strstr(s, _("user2"))     != NULL ) new->level = SH_LEVEL_USER2;
     226    else if ( strstr(s, _("user3"))     != NULL ) new->level = SH_LEVEL_USER3;
     227    else if ( strstr(s, _("user4"))     != NULL ) new->level = SH_LEVEL_USER4;
     228    else if ( strstr(s, _("prelink"))   != NULL ) new->level = SH_LEVEL_PRELINK;
    229229    else            /* The default */          new->level = default_level;
    230230
  • trunk/src/slib.c

    r200 r203  
    10941094{
    10951095#ifndef HAVE_STRSTR
    1096   insigned int    i;
     1096  unsigned int    i;
    10971097  size_t          needle_len;
    10981098  size_t          haystack_len;
  • trunk/test/testhash.sh

    r196 r203  
    3737        fi
    3838        #
    39         ${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug --enable-logfile-monitor
     39        ${TOP_SRCDIR}/configure --quiet $TRUST --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=$RCFILE --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --with-data-file=$PW_DIR/.samhain_file --enable-debug
    4040        #
    4141        fail=0
Note: See TracChangeset for help on using the changeset viewer.