Changeset 397 for trunk


Ignore:
Timestamp:
Mar 27, 2012, 9:05:08 PM (13 years ago)
Author:
katerina
Message:

Fix for ticket #293 (deadlock with inotify+suidcheck).

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/Changelog

    r396 r397  
    113.0.3:
     2        * fix for deadlock if suid check and inotify are used together
    23        * fixed problem with samhain_stealth.c (handle input config
    34          files that don't end with a newline)
  • trunk/src/sh_files.c

    r395 r397  
    27882788      *reported   = item->is_reported;
    27892789      retval = 1;
    2790       goto out;
    2791     }
     2790    }
     2791  SH_MUTEX_UNLOCK(mutex_zfiles);
    27922792
    27932793#if defined(HAVE_GLOB_H) && defined(HAVE_FNMATCH_H)
    2794   SH_MUTEX_LOCK(mutex_zglob);
    2795   for (testPattern = (sh_globstack_t *) zAVLFirst (&cursor, zglobList);
    2796        testPattern;
    2797        testPattern = (sh_globstack_t *) zAVLNext  (&cursor))
    2798     {
    2799       if (testPattern->type == SH_LIST_FILE)
     2794  if (retval == 0)
     2795    {
     2796      SH_MUTEX_LOCK(mutex_zglob);
     2797      for (testPattern = (sh_globstack_t *) zAVLFirst (&cursor, zglobList);
     2798           testPattern;
     2799           testPattern = (sh_globstack_t *) zAVLNext  (&cursor))
    28002800        {
    2801           if (0 == fnmatch(testPattern->name, name, FNM_PATHNAME|FNM_PERIOD))
     2801          if (testPattern->type == SH_LIST_FILE)
    28022802            {
    2803               *check_mask = testPattern->check_mask;
    2804               *class      = testPattern->class;
    2805               retval = 1;
    2806               break;
     2803              if (0 == fnmatch(testPattern->name, name,
     2804                               FNM_PATHNAME|FNM_PERIOD))
     2805                {
     2806                  *check_mask = testPattern->check_mask;
     2807                  *class      = testPattern->class;
     2808                  retval = 1;
     2809                  break;
     2810                }
     2811             
    28072812            }
    2808        
    28092813        }
    2810     }
    2811   SH_MUTEX_UNLOCK(mutex_zglob);
    2812 #endif
    2813  out:
    2814   ; /* 'label at end of compound statement' */
    2815   SH_MUTEX_UNLOCK(mutex_zfiles);
     2814      SH_MUTEX_UNLOCK(mutex_zglob);
     2815    }
     2816#endif
     2817
    28162818  return retval;
    28172819}
Note: See TracChangeset for help on using the changeset viewer.