Ignore:
Timestamp:
Jul 18, 2015, 5:06:52 PM (6 years ago)
Author:
katerina
Message:

Enhancements and fixes for tickets #374, #375, #376, #377, #378, and #379.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/samhain.h

    r459 r481  
    2828#endif
    2929
     30#if defined(__GNUC__) && (__GNUC__ >= 4)
     31#define SH_GNUC_SENTINEL __attribute__((__sentinel__))
     32#else
     33#define SH_GNUC_SENTINEL
     34#endif
     35
     36#if defined(__GNUC__) && (__GNUC__ >= 3)
     37#undef  SH_GNUC_PURE
     38#define SH_GNUC_PURE     __attribute__((pure))
     39#undef  SH_GNUC_CONST
     40#define SH_GNUC_CONST    __attribute__((const))
     41#undef  SH_GNUC_NORETURN
     42#define SH_GNUC_NORETURN __attribute__((noreturn))
     43#undef  SH_GNUC_MALLOC
     44#define SH_GNUC_MALLOC   __attribute__((malloc))
     45#else
     46#undef  SH_GNUC_PURE
     47#define SH_GNUC_PURE
     48#undef  SH_GNUC_CONST
     49#define SH_GNUC_CONST
     50#undef  SH_GNUC_NORETURN
     51#define SH_GNUC_NORETURN
     52#undef  SH_GNUC_MALLOC
     53#define SH_GNUC_MALLOC
     54#endif
     55
    3056/**************************************************
    3157 *
     
    5783
    5884/* end IPv6 */
    59 
    60 #define REPLACE_OLD
    6185
    6286/* Standard buffer sizes.
     
    101125#define PW_LEN     8
    102126
    103 #undef  GOOD
    104 #define GOOD  1
    105 #undef  BAD
    106 #define BAD   0
    107 #undef  ON
    108 #define ON    1
    109 #undef  OFF
    110 #define OFF   0
    111127#undef  S_TRUE
    112128#define S_TRUE    1
    113129#undef  S_FALSE
    114130#define S_FALSE   0
     131
     132#undef  GOOD
     133#define GOOD  S_TRUE
     134#undef  BAD
     135#define BAD   S_FALSE
     136
     137
     138#ifdef HAVE_INTTYPES_H
     139#include <inttypes.h>
     140#endif
     141#ifdef HAVE_STDINT_H
     142#include <stdint.h>
     143#endif
     144
     145#if !defined(HAVE_UINT16_T)
     146#define UINT16 unsigned short
     147#else
     148#define UINT16 uint16_t
     149#endif
     150
     151#if !defined(HAVE_UINT32_T)
    115152
    116153/* An unsigned integer guaranteed to be 32 bit.
     
    129166#endif
    130167
    131 #ifdef HAVE_INTTYPES_H
    132 #include <inttypes.h>
    133 #endif
    134 #ifdef HAVE_STDINT_H
    135 #include <stdint.h>
    136 #endif
    137 
    138 #if !defined(HAVE_UINT16_T)
    139 #define UINT16 unsigned short
    140 #else
    141 #define UINT16 uint16_t
     168#else
     169#define UINT32 uint32_t
     170#define SINT32 int32_t
     171
    142172#endif
    143173
     
    305335  int    client_severity;          /* TRUE if client severity used    */
    306336  int    client_class;             /* TRUE if client class used       */
     337  int    hidefile;                 /* TRUE if file not shown in log   */
     338  int    inotify;                  /* Flags for inotify               */
    307339  int    audit;
    308340  unsigned long aud_mask;
    309   int    hidefile;                 /* TRUE if file not shown in log   */
    310   int    inotify;                  /* Flags for inotify               */
    311341} sh_sh_flag;
    312342
     
    347377  /*@null@*//*@out@*/ char   * timezone;
    348378
     379  int delayload;
     380
    349381#ifdef SCREW_IT_UP
    350382  int sigtrap_max_duration;
    351383#endif
    352384
     385  char * outpath;
    353386} sh_struct;
    354387
     
    365398extern volatile  int      sig_termfast;           /* SIGTERM */
    366399extern volatile  int      sig_force_check;        /* SIGTTOU */
     400extern volatile  int      sh_load_delta_flag;
    367401
    368402extern long int eintr__result;
     
    420454#endif
    421455
    422 #if defined(__GNUC__) && (__GNUC__ >= 4)
    423 #define SH_GNUC_SENTINEL __attribute__((__sentinel__))
    424 #else
    425 #define SH_GNUC_SENTINEL
    426 #endif
    427 
    428 #if defined(__GNUC__) && (__GNUC__ >= 3)
    429 #undef  SH_GNUC_PURE
    430 #define SH_GNUC_PURE     __attribute__((pure))
    431 #undef  SH_GNUC_CONST
    432 #define SH_GNUC_CONST    __attribute__((const))
    433 #undef  SH_GNUC_NORETURN
    434 #define SH_GNUC_NORETURN __attribute__((noreturn))
    435 #undef  SH_GNUC_MALLOC
    436 #define SH_GNUC_MALLOC   __attribute__((malloc))
    437 #else
    438 #undef  SH_GNUC_PURE
    439 #define SH_GNUC_PURE
    440 #undef  SH_GNUC_CONST
    441 #define SH_GNUC_CONST
    442 #undef  SH_GNUC_NORETURN
    443 #define SH_GNUC_NORETURN
    444 #undef  SH_GNUC_MALLOC
    445 #define SH_GNUC_MALLOC
    446 #endif
    447456
    448457
     
    481490#ifdef USE_SUID
    482491#define MLOCK(a, b) \
    483       if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
     492      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
    484493        (void) sl_set_suid(); \
    485         if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = SL_TRUE; \
     494        if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = S_TRUE; \
    486495        (void) sl_unset_suid(); }
    487496#else
    488497#define MLOCK(a, b) \
    489       if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
    490         if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = SL_TRUE; }
     498      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
     499        if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = S_TRUE; }
    491500#endif
    492501#else
     
    498507#ifdef USE_SUID
    499508#define MUNLOCK(a, b) \
    500       if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
     509      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
    501510        (void) sl_set_suid(); \
    502511        (void) sh_unix_munlock( a, b );\
     
    504513#else
    505514#define MUNLOCK(a, b) \
    506       if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
     515      if ((skey != NULL) && skey->mlock_failed == S_FALSE){ \
    507516        (void) sh_unix_munlock( a, b ); }
    508517#endif
Note: See TracChangeset for help on using the changeset viewer.