Changeset 491 for trunk/src


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/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.