Changeset 262


Ignore:
Timestamp:
Dec 8, 2009, 11:25:50 PM (15 years ago)
Author:
katerina
Message:

Fix for ticket #179, and some minor bugfixes.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.in

    r259 r262  
    17331733sh_nmail.o: $(srcsrc)/sh_nmail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/zAVLTree.h
    17341734sh_filter.o: $(srcsrc)/sh_filter.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_filter.h
    1735 sh_inotify.o: $(srcsrc)/sh_inotify.c Makefile config_xor.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/sh_mem.h $(srcinc)/slib.h $(srcinc)/sh_calls.h
     1735sh_inotify.o: $(srcsrc)/sh_inotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/sh_mem.h $(srcinc)/slib.h $(srcinc)/sh_calls.h
  • trunk/depend.dep

    r259 r262  
    7777sh_nmail.o: $(srcsrc)/sh_nmail.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_mem.h $(srcinc)/sh_mail.h $(srcinc)/sh_tiger.h $(srcinc)/sh_string.h $(srcinc)/sh_utils.h $(srcinc)/sh_fifo.h $(srcinc)/sh_filter.h $(srcinc)/sh_mail_int.h $(srcinc)/zAVLTree.h
    7878sh_filter.o: $(srcsrc)/sh_filter.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_mem.h $(srcinc)/sh_filter.h
    79 sh_inotify.o: $(srcsrc)/sh_inotify.c Makefile config_xor.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/sh_mem.h $(srcinc)/slib.h $(srcinc)/sh_calls.h
     79sh_inotify.o: $(srcsrc)/sh_inotify.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_inotify.h $(srcinc)/sh_mem.h $(srcinc)/slib.h $(srcinc)/sh_calls.h
  • trunk/depend.sum

    r259 r262  
    1 2870675903
     12976518268
  • trunk/docs/Changelog

    r259 r262  
    112.6.1:
    22        * use inotify to track login/logout (sh_inotify.c, sh_utmp.c)
    3 
     3        * support event correlation in log monitoring module
     4        * make sure host matching is done in a case insensitive way
     5       
    462.6.0:
    57        * don't use statvfs() for process checking on FreeBSD
  • trunk/src/sh_forward.c

    r252 r262  
    19901990#include "zAVLTree.h"
    19911991
     1992static char * sh_tolower (char * s)
     1993{
     1994  char * ret = s;
     1995  if (s)
     1996    {
     1997      for (; *s; ++s)
     1998        {
     1999          *s = tolower((unsigned char) *s);
     2000        }
     2001    }
     2002  return ret;
     2003}
     2004
    19922005/* Function to return the key for indexing
    19932006 * the argument
     
    21092122        newclt->status_arr[i] = CLT_INACTIVE;
    21102123      (void) sh_unix_time(0, newclt->timestamp[CLT_INACTIVE], TIM_MAX);
     2124
    21112125      /* truncate */
    21122126      sl_strlcpy(newclt->hostname,  &str[0],        sep[0]+1);
     2127      sh_tolower(newclt->hostname);
     2128
    21132129      /* truncate */
    21142130      sl_strlcpy(newclt->salt,      &str[sep[0]+1], sep[1]-sep[0]);
     
    26132629   */
    26142630  if (he != NULL && he->h_name != NULL)
    2615     sl_strlcpy(h_name, he->h_name, MAXHOSTNAMELEN + 1);
     2631    {
     2632      sl_strlcpy(h_name, he->h_name, MAXHOSTNAMELEN + 1);
     2633    }
    26162634  else
    26172635    {
     
    26842702    }
    26852703
     2704  sh_tolower(h_peer);
     2705  sh_tolower(h_name);
    26862706
    26872707  if ((0 == sl_strcmp(h_peer, h_name)) || (0 == sl_strcmp(h_peer_IP, h_name)))
     
    26942714      while (he->h_aliases[i] != NULL)
    26952715        {
    2696           if (0 == sl_strcmp(he->h_aliases[i], h_name))
     2716          if (0 == sl_strcmp(sh_tolower(he->h_aliases[i]), h_name))
    26972717            {
    26982718              flag = 1;
     
    27942814        }
    27952815    }
     2816
     2817  sh_tolower(search_string);
    27962818
    27972819  /* ----  search the register  -----
  • trunk/src/sh_log_evalrule.c

    r260 r262  
    682682
    683683  int           qpos = 0;
    684   int           rpos = 1;
     684  volatile int  rpos = 1;
    685685  unsigned long dsec = 0;
    686686  char *        dstr = NULL;
  • trunk/src/sh_utmp.c

    r259 r262  
    581581  int errnum = 0;
    582582 
    583   if (sh.flag.checkSum != SH_CHECK_INIT)
    584     sh_inotify_wait_for_change(mode_path[1], &inotify_watch,
    585                                &errnum, ShUtmpInterval);
    586 
     583  if ( (sh.flag.isdaemon == S_TRUE || sh.flag.loop == S_TRUE) &&
     584       sh.flag.checkSum != SH_CHECK_INIT )
     585    {
     586      sh_inotify_wait_for_change(mode_path[1], &inotify_watch,
     587                                 &errnum, ShUtmpInterval);
     588    }
     589 
    587590  lastcheck  = tcurrent;
     591
    588592  if (SH_INOTIFY_ERROR(errnum))
    589593    {
  • trunk/test/testrun_1b.sh

    r206 r262  
    225225    fi
    226226    tmp=`egrep "Checking.*(>|\")" $LOGFILE 2>/dev/null | wc -l`
    227     if [ $tmp -ne 8 ]; then
     227    if [ $tmp -ne 10 ]; then
    228228        [ -z "$verbose" ] || log_msg_fail "checking";
    229229        return 1
Note: See TracChangeset for help on using the changeset viewer.