Changeset 397 for trunk/src/sh_files.c


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.