Changeset 491


Ignore:
Timestamp:
Oct 31, 2015, 10:36:55 PM (9 years ago)
Author:
katerina
Message:

Fix for ticket #389 (libwrap) and #390 (update on FreeBSD).

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/config.h.in

    r481 r491  
    540540/* Define to 1 if you have the <fnmatch.h> header file. */
    541541#undef HAVE_FNMATCH_H
     542
     543/* Define to 1 if you have the `fpurge' function. */
     544#undef HAVE_FPURGE
    542545
    543546/* Define to 1 if you have the `getaddrinfo' function. */
  • trunk/configure.ac

    r483 r491  
    1212dnl start
    1313dnl
    14 AM_INIT_AUTOMAKE(samhain, 4.1.0)
     14AM_INIT_AUTOMAKE(samhain, 4.1.1)
    1515AC_DEFINE([SAMHAIN], 1, [Application is samhain])
    1616AC_CANONICAL_HOST
     
    378378dnl *****************************************
    379379AC_FUNC_STRFTIME
    380 AC_CHECK_FUNCS(memcmp memcpy memmove memset getpwent endpwent \
     380AC_CHECK_FUNCS(memcmp memcpy memmove memset getpwent endpwent fpurge \
    381381        gettimeofday strlcat strlcpy strstr strchr strerror strsignal \
    382382        seteuid setreuid setresuid lstat getwd getcwd ptrace \
  • trunk/docs/Changelog

    r488 r491  
     14.1.1:
     2        * fix problem with baseline update on FreeBSD and probably other
     3        non-GNU/Linux systems (reported by L.Vasiliev)
     4        * fix bad check_libwrap() call in sh_xfer_server.c
     5        (reported by L.Vasiliev)
     6
    174.1.0:
    28        * fix quirks with Linux audit support
  • trunk/src/sh_dbIO.c

    r483 r491  
    156156{
    157157  FILE * fdp;
    158 
     158 
    159159  SL_ENTER(_("sh_dbIO_setdataent_old"));
    160160
     
    163163  if (0 != seek_sof(fdp, line, size, file))
    164164    SL_RETURN( SL_EREAD, _("sh_dbIO_setdataent_old"));
     165
     166  lseek(fileno(fdp), ftello(fdp), SEEK_SET);
     167
    165168  if (0 != ftruncate(fileno(fdp), ftello(fdp)))
    166169    {
     
    406409       _("There is a record with a bad version number in the file signature database: %s\n"),
    407410       (NULL == filepath) ? _("(null)") : filepath);
    408   sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
     411  sh_error_handle((-1), file, line, 0, MSG_E_SUBGPATH,
    409412                  _("Record with bad version number in file signature database"),
    410413                  _("sh_dbIO_getdataent"),
     
    13311334  if (pushdata_stdout == S_FALSE)
    13321335    {
    1333       sl_write           (fd,        p, sizeof(sh_filestore_t));
    1334       sl_write_line_fast (fd, fullpath, sl_strlen(fullpath));
    1335       sl_write_line_fast (fd,    lpath, sl_strlen(lpath));
     1336      if (SL_ENONE != sl_write (fd,        p, sizeof(sh_filestore_t)))
     1337        {
     1338          char * tmp = sh_util_safe_name(fullpath);
     1339          sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
     1340                          _("Failed to write record to baseline database"),
     1341                          _("write_record"),
     1342                          tmp);
     1343          SH_FREE(tmp);
     1344          aud_exit(FIL__, __LINE__,  EXIT_FAILURE );
     1345        }
     1346      if (SL_ENONE != sl_write_line_fast (fd, fullpath, sl_strlen(fullpath)))
     1347        {
     1348          char * tmp = sh_util_safe_name(fullpath);
     1349          sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
     1350                          _("Failed to write path to baseline database"),
     1351                          _("write_record"),
     1352                          tmp);
     1353          SH_FREE(tmp);
     1354          aud_exit(FIL__, __LINE__,  EXIT_FAILURE );
     1355        }
     1356      if (SL_ENONE != sl_write_line_fast (fd,    lpath, sl_strlen(lpath)))
     1357        {
     1358          char * tmp = sh_util_safe_name(fullpath);
     1359          sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGPATH,
     1360                          _("Failed to write lpath to baseline database"),
     1361                          _("write_record"),
     1362                          tmp);
     1363          SH_FREE(tmp);
     1364          aud_exit(FIL__, __LINE__,  EXIT_FAILURE );
     1365        }
    13361366      if (attr_string)
    13371367        sl_write_line_fast (fd, attr_string, sl_strlen(attr_string));
  • trunk/src/sh_extern.c

    r481 r491  
    978978    */
    979979   new_act.sa_handler = SIG_IGN;
     980   new_act.sa_flags   = 0;
     981   sigemptyset( &new_act.sa_mask );
     982   
    980983   (void) retry_sigaction (FIL__, __LINE__, SIGPIPE, &new_act, &old_act);
    981984   
  • trunk/src/sh_sub.c

    r481 r491  
    184184           */
    185185          act.sa_handler = SIG_DFL;
    186           for (i = 0; i < NSIG; ++i)
     186          act.sa_flags   = 0;
     187          sigemptyset( &act.sa_mask );
     188         
     189          for (i = 1; i < NSIG; ++i)
    187190            sigaction(i, &act, NULL);
    188191          SH_SETSIGMASK(SIG_UNBLOCK, &signal_set_new, NULL);
  • trunk/src/sh_xfer_server.c

    r481 r491  
    28582858
    28592859#ifdef SH_USE_LIBWRAP
    2860   if (check_libwrap(rc) < 0)
     2860  if (check_libwrap(rc, newconn) < 0)
    28612861    SL_RETURN( (-1), _("sh_xfer_accept"));
    28622862#endif
  • trunk/test/testhash.sh

    r487 r491  
    6363        fi
    6464        #
    65         ${TOP_SRCDIR}/configure --enable-debug=gdb --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-db-reload '--enable-login-watch' '--enable-mounts-check' ${C_LOGFILE} '--enable-port-check' '--enable-message-queue'
     65        ${TOP_SRCDIR}/configure --enable-debug=gdb --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-db-reload '--enable-login-watch' '--enable-mounts-check' ${C_LOGFILE} '--enable-port-check' '--enable-message-queue' '--enable-suidcheck' '--disable-dnmalloc'
    6666        #
    6767        fail=0
Note: See TracChangeset for help on using the changeset viewer.