Changeset 290 for trunk


Ignore:
Timestamp:
Aug 15, 2010, 12:27:47 PM (14 years ago)
Author:
katerina
Message:

Fixes for tickets #215, #216, #217, #218, version bumped to 2.7.2

Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.in

    r286 r290  
    17511751dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h
    17521752t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h
    1753 sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h
     1753sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h
    17541754sh_log_parse_syslog.o: $(srcsrc)/sh_log_parse_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h
    17551755sh_log_parse_pacct.o: $(srcsrc)/sh_log_parse_pacct.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h
  • trunk/aclocal.m4

    r255 r290  
    11961196      ])
    11971197    if test $pie_cv_cc = yes; then
     1198      case "$host_os" in
     1199      *cygwin*)
     1200      ;;
     1201      *)
    11981202      PIE_CFLAGS="-fPIE"
    11991203      PIE_LDFLAGS="-pie"
     1204      ;;
     1205      esac
    12001206    fi
    12011207  fi
  • trunk/configure.ac

    r286 r290  
    1212dnl start
    1313dnl
    14 AM_INIT_AUTOMAKE(samhain, 2.7.1)
     14AM_INIT_AUTOMAKE(samhain, 2.7.2)
    1515AC_DEFINE([SAMHAIN], 1, [Application is samhain])
    1616AC_CANONICAL_HOST
     
    232232        elf.h linux/elf.h \
    233233        paths.h arpa/nameser.h arpa/nameser_compat.h \
    234         rpc/rpcent.h sys/statvfs.h,
     234        rpc/rpcent.h rpc/rpc.h sys/statvfs.h,
    235235        [],
    236236        [],
  • trunk/depend.dep

    r286 r290  
    6868dnmalloc-portable.o: $(srcsrc)/dnmalloc-portable.c Makefile config.h
    6969dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h
    70 sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_error_min.h $(srcinc)/sh_utils.h $(srcinc)/sh_pthread.h
     70sh_port2proc.o: $(srcsrc)/sh_port2proc.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_utils.h $(srcinc)/sh_error_min.h $(srcinc)/sh_pthread.h
    7171sh_log_parse_syslog.o: $(srcsrc)/sh_log_parse_syslog.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h
    7272sh_log_parse_pacct.o: $(srcsrc)/sh_log_parse_pacct.c Makefile config_xor.h $(srcinc)/samhain.h $(srcinc)/sh_pthread.h $(srcinc)/sh_log_check.h $(srcinc)/sh_utils.h $(srcinc)/sh_string.h
  • trunk/depend.sum

    r286 r290  
    1 3590773370
     13512130170
  • trunk/docs/Changelog

    r289 r290  
    112.7.2:
     2        * sh_utils.c: fixed an endianess issue that prevented cross-verification
     3          of email signatures (reported by A. Zangerl)
     4        * sh_login_track.c: fix compiler warning (ignored return value
     5          of fwrite)
     6        * sh_readconf.c: fix comparison of SeverityUserX string
     7          (reported by max__)
     8        * sh_processcheck.c: sh_prochk_set_maxpid: set retval on success
     9          (reported by max__)
     10        * fixed some compiler warnings on cygwin
    211        * sh_extern.c: As reported by T. Luettgert, gcc 4.4.4 on Fedora 13
    312          will throw a warning if execve is called with a NULL argv pointer.
  • trunk/src/sh_login_track.c

    r279 r290  
    285285          while (entry)
    286286            {
    287               fwrite(&(entry->data), sizeof(struct sh_track_entry_data), 1, fp);
     287              n = fwrite(&(entry->data), sizeof(struct sh_track_entry_data), 1, fp);
    288288              entry = entry->next;
    289289            }
  • trunk/src/sh_mail.c

    r275 r290  
    228228            }
    229229         
    230 
    231           theSig = sh_util_siggen (key2, bufc, sl_strlen(bufc), sigbuf, sizeof(sigbuf));
     230          theSig = sh_util_siggen (key2, bufc, sl_strlen(bufc),
     231                                   sigbuf, sizeof(sigbuf));
     232
    232233          if (sl_strncmp (key,
    233234                          theSig,
  • trunk/src/sh_port2proc.c

    r279 r290  
    2424#include <string.h>
    2525#include <sys/types.h>
     26#include <netinet/in.h>
     27#include <arpa/inet.h>
    2628#include <unistd.h>
    2729
     
    4850/* #define DEBUG_P2P 1 */
    4951
     52#include "samhain.h"
     53#include "sh_utils.h"
     54
    5055/****************************************************************************
    5156 *
     
    5560#if defined(__linux__) || defined(__FreeBSD__)
    5661 
    57 #include "samhain.h"
    5862#include "sh_error_min.h"
    59 #include "sh_utils.h"
    6063#include "sh_pthread.h"
    6164
  • trunk/src/sh_portcheck.c

    r257 r290  
    4747
    4848#define PORTMAP
     49#ifdef  HAVE_RPC_RPC_H
    4950#include <rpc/rpc.h>
    5051#ifdef  HAVE_RPC_RPCENT_H
     
    5354#include <rpc/pmap_clnt.h>
    5455#include <rpc/pmap_prot.h>
     56#endif
    5557#include <netdb.h>
    5658
     
    284286#endif
    285287
     288#ifdef  HAVE_RPC_RPC_H
    286289static char * sh_getrpcbynumber (int number, char * buf, size_t len)
    287290{
     
    324327  return NULL;
    325328}
     329#endif
    326330
    327331static char * sh_getservbyport (int port, const char * proto_in, char * buf, size_t len)
     
    756760                              unsigned long prot)
    757761{
     762#ifdef  HAVE_RPC_RPC_H
    758763  struct pmaplist * head;
    759764  char *r;
     
    786791      while (head != NULL);
    787792    }
    788 
     793#else
     794  (void) port;
     795  (void) address;
     796  (void) prot;
     797#endif
    789798  return NULL;
    790799}
     
    16651674  char * p;
    16661675
     1676#ifdef HAVE_RPC_RPC_H
    16671677  p = sh_getrpcbynumber(0, buf, sizeof(buf));
    16681678  CuAssertTrue(tc, p == NULL);
     
    16771687  CuAssertTrue(tc, 0 == strcmp(p, "ypbind"));
    16781688  CuAssertTrue(tc, 0 == strcmp(buf, "ypbind"));
     1689#endif
    16791690
    16801691  p = sh_getservbyport(0, SH_PROTO_STR(IPPROTO_TCP), buf, sizeof(buf));
    16811692  CuAssertTrue(tc, p == NULL);
    16821693
     1694#if !defined(HOST_IS_CYGWIN)
    16831695  p = sh_getservbyport(22, SH_PROTO_STR(IPPROTO_TCP), buf, sizeof(buf));
    16841696  CuAssertPtrNotNull(tc, p);
    16851697  CuAssertTrue(tc, 0 == strcmp(p, "ssh"));
    16861698  CuAssertTrue(tc, 0 == strcmp(buf, "ssh"));
     1699#endif
    16871700
    16881701  p = sh_getservbyport(13, SH_PROTO_STR(IPPROTO_UDP), buf, sizeof(buf));
  • trunk/src/sh_prelude.c

    r283 r290  
    705705#if defined(SH_WITH_SERVER)
    706706        /* when using yule, theres a msg=<... msg=<...> >*/
    707         do {
    708                 msg = ptr;
    709                 ptr = get_value(msg, _("msg"), NULL);
    710                 if ( ! ptr ) {
    711                         ptr = msg;
    712                         break;
    713                 } else {
    714                         free(msg);
    715                 }
    716         } while (1);
     707        while ( (msg = get_value(ptr, _("msg"), NULL)) ) {
     708                free(ptr);
     709                ptr = msg;
     710        }
    717711#endif       
    718712
     
    12311225        if ( inet_peer_ip != NULL){
    12321226                ret = idmef_target_new_node(target, &node);
     1227                if ( ret < 0 )
     1228                          goto err;
    12331229       
    12341230                ret = node_set_address(node, inet_peer_ip);
     
    12391235        }
    12401236        else
     1237#endif       
    12411238        if ( idmef_analyzer_get_node(prelude_client_get_analyzer(client)) ) {
    12421239                idmef_node_ref(idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
    12431240                idmef_target_set_node(target, idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
    12441241        }
    1245 #else       
    1246         if ( idmef_analyzer_get_node(prelude_client_get_analyzer(client)) ) {
    1247                 idmef_node_ref(idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
    1248                 idmef_target_set_node(target, idmef_analyzer_get_node(prelude_client_get_analyzer(client)));
    1249         }
    1250 #endif       
     1242
    12511243        if ( strstr(message, _("path=")) ) {
    12521244#if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE)
  • trunk/src/sh_processcheck.c

    r258 r290  
    611611    sh_prochk_maxpid = value + 1;
    612612    userdef_maxpid   = 1;
     613    retval = 0;
    613614  }
    614615
  • trunk/src/sh_readconf.c

    r286 r290  
    13931393      i = 0;
    13941394      while (ident[i] != NULL) {
    1395         if (sl_strncmp (key, _(ident[i]), sl_strlen(ident[i])-1) == 0)
     1395        if (sl_strncmp (key, _(ident[i]), sl_strlen(ident[i])) == 0)
    13961396          {
    13971397            good_opt = 0;
  • trunk/src/sh_schedule.c

    r131 r290  
    212212        /*@+charint@*//* Incompatible types for == (char, char): ??? */
    213213        for (k = 0; k < 3; ++k)
    214           if (p[k] != '\0' && tolower(p[k]) == MonNames[j][k]) ++l;
     214          if (p[k] != '\0' && tolower((int) p[k]) == MonNames[j][k]) ++l;
    215215        /*@-charint@*/
    216216        if (l == 3)
     
    224224        /*@+charint@*//* Incompatible types for == (char, char): ??? */
    225225        for (k = 0; k < 3; ++k)
    226           if (p[k] != '\0' && tolower(p[k]) == DayNames[j][k]) ++l;
     226          if (p[k] != '\0' && tolower((int) p[k]) == DayNames[j][k]) ++l;
    227227        /*@-charint@*/
    228228        if (l == 3)
  • trunk/src/sh_unix.c

    r279 r290  
    35083508        }
    35093509  }
     3510#else
     3511  (void) buf;
    35103512#endif
    35113513
  • trunk/src/sh_utils.c

    r248 r290  
    871871    char c[sizeof(long)];
    872872  } u;
     873#ifdef WORDS_BIGENDIAN
     874  unsigned char swap;
     875  unsigned char * ii = (unsigned char *) dest;
     876#endif
    873877
    874878  SL_ENTER(_("sh_util_cpylong"));   
     
    893897      ++i;
    894898    }
     899#ifdef WORDS_BIGENDIAN
     900  swap = ii[0]; ii[0] = ii[3]; ii[3] = swap;
     901  swap = ii[1]; ii[1] = ii[2]; ii[2] = swap;
     902#endif
    895903  SL_RET0(_("sh_util_cpylong"));
    896904}
  • trunk/src/sh_utmp.c

    r279 r290  
    916916#ifdef HAVE_UTADDR
    917917      /*@-type@*//* ut_addr does exist !!! */
    918       (void) sl_strlcpy((char*)(user->ut_ship),
    919                         my_inet_ntoa(*(struct in_addr*)&(ut->ut_addr)), 16);
     918      {
     919        struct in_addr saddr;
     920        memcpy (&saddr, &(ut->ut_addr), sizeof(struct in_addr));
     921        (void) sl_strlcpy((char*)(user->ut_ship),
     922                          my_inet_ntoa(saddr), 16);
     923      }
    920924      /*@+type@*/
    921925#endif
  • trunk/src/slib.c

    r279 r290  
    10281028        if (*one && *two)
    10291029          {
    1030             if (tolower(*one) == tolower(*two))
     1030            if (tolower((int) *one) == tolower((int) *two))
    10311031              {
    10321032                ++one; ++two;
    10331033              }
    1034             else if (tolower(*one) < tolower(*two))
     1034            else if (tolower((int) *one) < tolower((int) *two))
    10351035              return -1;
    10361036            else
Note: See TracChangeset for help on using the changeset viewer.