Ignore:
Timestamp:
Sep 1, 2012, 4:25:30 PM (12 years ago)
Author:
katerina
Message:

Enhancements for ticket #312 (logrotate) and #313 (--enable-suid).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/samhain.h

    r411 r412  
    458458
    459459#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
     460#ifdef USE_SUID
    460461#define MLOCK(a, b) \
    461462      if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
    462463        (void) sl_set_suid(); \
    463464        if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = SL_TRUE; \
    464         (void) sl_unset_suid(); }
     465        (void) sl_unset_suid(); }
     466#else
     467#define MLOCK(a, b) \
     468      if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
     469        if (sh_unix_mlock(FIL__, __LINE__, a, b) < 0) skey->mlock_failed = SL_TRUE; }
     470#endif
    465471#else
    466472#define MLOCK(a, b) \
     
    469475
    470476#if defined(HAVE_MLOCK) && !defined(HAVE_BROKEN_MLOCK)
     477#ifdef USE_SUID
    471478#define MUNLOCK(a, b) \
    472479      if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
    473480        (void) sl_set_suid(); \
    474481        (void) sh_unix_munlock( a, b );\
    475         (void) sl_unset_suid(); }
     482        (void) sl_unset_suid(); }
     483#else
     484#define MUNLOCK(a, b) \
     485      if ((skey != NULL) && skey->mlock_failed == SL_FALSE){ \
     486        (void) sh_unix_munlock( a, b ); }
     487#endif
    476488#else
    477489#define MUNLOCK(a, b) \
Note: See TracChangeset for help on using the changeset viewer.