Changeset 52 for trunk/src


Ignore:
Timestamp:
Jul 24, 2006, 11:01:29 PM (18 years ago)
Author:
rainer
Message:

Fix stealth mode (regression in parser), add test for regression test suite

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/samhain.c

    r34 r52  
    14491449
    14501450#if (defined(WITH_GPG) || defined(WITH_PGP))
    1451   /* do nothing -- we exit earlier if error
    1452   if (0 != sh_gpg_check_sign (1))
    1453     aud_exit(FIL__, __LINE__, EXIT_FAILURE);
    1454   */
     1451  /* do nothing -- we exit earlier if error */
    14551452#else
    14561453  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_1H,
     
    14741471    {
    14751472#if (defined(WITH_GPG) || defined(WITH_PGP))
    1476       /* do nothing -- we exit earlier if error
    1477          if (0 != sh_gpg_check_sign (2))
    1478          aud_exit(FIL__, __LINE__, EXIT_FAILURE);
    1479       */
    1480       ;
     1473      /* do nothing -- we exit earlier if error */
    14811474#else
    14821475      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_2H,
     
    14891482    {
    14901483#if (defined(WITH_GPG) || defined(WITH_PGP))
    1491       /* do nothing -- we exit earlier if error
    1492       if (0 != sh_gpg_check_sign (1))
    1493         aud_exit(FIL__, __LINE__, EXIT_FAILURE);
    1494       */
    1495       ;
     1484      /* do nothing -- we exit earlier if error */
    14961485#else
    14971486      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_1H,
  • trunk/src/sh_unix.c

    r49 r52  
    41224122int sh_unix_getline_stealth (SL_TICKET fd, char * str, int len)
    41234123{
    4124   int           add_off, llen;
    4125   unsigned long off_data = 0;
    4126   unsigned long max_data = 0;
    4127   static int    stealth_init = BAD;
     4124  int                  add_off, llen;
     4125  static unsigned long off_data = 0;
     4126  static unsigned long max_data = 0;
     4127  static int           stealth_init = BAD;
    41284128
    41294129  SL_ENTER(_("sh_unix_getline_stealth"));
     
    41444144        }
    41454145      stealth_init = GOOD;
     4146      max_data += off_data;
    41464147    }
    41474148 
    41484149  /* --- Seek to proper position. ---
    41494150   */
     4151  if (off_data >= max_data)
     4152    {
     4153      dlog(1, FIL__, __LINE__,
     4154           _("The capacity of the container image file for the stealth config file seems to be too small. Your config file is likely truncated.\n"));
     4155      sh_error_handle ((-1), FIL__, __LINE__,  EIO, MSG_P_NODATA,
     4156                       _("Stealth config file."));
     4157      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
     4158    }
    41504159  sl_seek(fd, off_data);
    41514160     
     
    41544163  add_off   = hideout_hex_block(fd, (unsigned char *) str, len);
    41554164  off_data += add_off;
    4156 
    41574165
    41584166  llen = sl_strlen(str);
Note: See TracChangeset for help on using the changeset viewer.