Changeset 205 for trunk/src


Ignore:
Timestamp:
Dec 22, 2008, 10:05:34 PM (16 years ago)
Author:
katerina
Message:

New option LooseDirCheck (ticket #132). Also, replace _exit() with raise(SIGKILL).

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/samhain_stealth.c

    r34 r205  
    277277      fprintf(stdout, _("   -s hide file 'what' in PS image 'where'\n"));
    278278      fprintf(stdout, _("   -g get hidden data from PS image 'where'\n"));
    279       fprintf(stdout, _("      (output to stdout)\n\n"));
     279      fprintf(stdout, _("      (output to stdout)\n"));
    280280      fprintf(stdout, _("   -o size of file 'where' = offset to "\
    281281                        "end-of-file\n"));
    282       fprintf(stdout, _("      (same as wc -c).\n"));
     282      fprintf(stdout, _("      (same as wc -c).\n\n"));
     283      fprintf(stdout, _(" Example: let bar.ps be the ps file, and foo the config file\n"));
     284      fprintf(stdout, _("   1) extract with: samhain_stealth -g bar.ps >foo\n"));
     285      fprintf(stdout, _("   2) hide with:    samhain_stealth -s bar.ps foo\n\n"));
    283286
    284287      fprintf(stdout, _(" This program hides a file in an UNCOMPRESSED "\
     
    294297      fprintf(stdout, _(" The program does not check the compression type of "\
    295298              "the PS file.\n"));
    296       fprintf(stdout, _(" Just have a look at the result to check.\n\n"));
     299      fprintf(stdout, _(" Just have a look at the result to check.\n"));
    297300      return;
    298301}
  • trunk/src/sh_hash.c

    r199 r205  
    14401440}
    14411441
     1442static int sh_loosedircheck = S_FALSE;
     1443
     1444int sh_hash_loosedircheck(const char * str)
     1445{
     1446  return sh_util_flagval(str, &sh_loosedircheck);
     1447}
     1448
    14421449
    14431450static void sh_hash_pushdata_int (file_type * buf, char * fileHash)
     
    30563063    }
    30573064  change_code[10] = '\0';
     3065
     3066  /* --- Directories special case ---
     3067   */
     3068  if (p->theFile.c_mode[0] == 'd'                               &&
     3069      0 == (modi_mask & ~(MODI_SIZ|MODI_ATM|MODI_CTM|MODI_MTM)) &&
     3070      sh_loosedircheck == S_TRUE)
     3071    {
     3072      modi_mask = 0;
     3073    }
    30583074
    30593075  /* --- Report full details. ---
  • trunk/src/sh_processcheck.c

    r204 r205  
    10921092 * with PID = i + 1024
    10931093 */
     1094static size_t p_store = 0;
     1095
    10941096static int openvz_ok(short * res, size_t i)
    10951097{
     1098
    10961099  if (sh_prochk_openvz == S_FALSE) {
    10971100    return 0;
     
    11121115    }
    11131116
    1114   if (openvz_hidden)
    1115     {
     1117  if (openvz_hidden > 0)
     1118    {
     1119      p_store = i;
    11161120      --openvz_hidden;
     1121      return 1;
     1122    }
     1123  else if (i == p_store)
     1124    {
    11171125      return 1;
    11181126    }
     
    14091417  sh_prochk_interval = SH_PROCHK_INTERVAL;
    14101418  sh_prochk_openvz   = S_FALSE;
     1419  p_store            = 0;
     1420  openvz_hidden      = 0;
    14111421
    14121422  sh_prochk_free_list(process_check);
  • trunk/src/sh_readconf.c

    r199 r205  
    932932    sh_unix_setcheckacl },
    933933#endif
     934  { N_("loosedircheck"),      SH_SECTION_MISC,   SH_SECTION_NONE,
     935    sh_hash_loosedircheck },
    934936  { N_("addokchars"),         SH_SECTION_MISC,   SH_SECTION_NONE,
    935937    sh_util_obscure_ok },
  • trunk/src/sh_unix.c

    r203 r205  
    480480  sl_strlcat(msg, details, 128);
    481481  (void) safe_logger (thesignal, method, msg);
    482   _exit(EXIT_FAILURE);
     482  raise(SIGKILL);
    483483}
    484484
     
    526526          safe_logger (mysignal, 0, NULL);
    527527        }
    528       _exit(mysignal);
     528      raise(SIGKILL);
    529529    }
    530530  else
     
    582582  if (immediate_exit_fast < 2)
    583583    safe_logger (mysignal, 0, NULL);
    584   _exit(mysignal);
     584  raise(SIGKILL);
    585585#else
    586586
     
    610610  else if (immediate_exit_fast != 0)
    611611    {
    612       _exit(mysignal);
     612      raise(SIGKILL);
    613613    }
    614614
     
    14501450      }
    14511451  }
     1452
     1453#ifdef HAVE_TZSET
     1454  tzset();
     1455#endif
    14521456
    14531457  SL_RET0(_("sh_unix_zeroenv"));
     
    49754979    (tv.tv_usec - save_tv.tv_usec);
    49764980  if (difftv > 500000)
    4977     _exit(6);
     4981    raise(SIGKILL);
    49784982#endif
    49794983  sh_not_traced += signum;
Note: See TracChangeset for help on using the changeset viewer.