/[monit]/monit/event.c
ViewVC logotype

Diff of /monit/event.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by martinp, Tue Aug 5 07:55:21 2003 UTC revision 1.15 by martinp, Tue Aug 5 15:03:48 2003 UTC
# Line 67  struct Event_Table { Line 67  struct Event_Table {
67      {EVENT_TIMESTAMP,  "Timestamp rule matched"},      {EVENT_TIMESTAMP,  "Timestamp rule matched"},
68      {EVENT_SIZE,       "Size rule matched"},      {EVENT_SIZE,       "Size rule matched"},
69      {EVENT_CONNECTION, "Connection test failed"},      {EVENT_CONNECTION, "Connection test failed"},
70      {EVENT_PERMISSION, "Permission error"}      {EVENT_PERMISSION, "Permission error"},
71        {EVENT_UID,        "UID error"},
72        {EVENT_GID,        "GID error"}
73  };  };
74    
75    
# Line 85  static void handle_resource(Event_T E); Line 87  static void handle_resource(Event_T E);
87  static void handle_timestamp(Event_T E);  static void handle_timestamp(Event_T E);
88  static void handle_connection(Event_T E);  static void handle_connection(Event_T E);
89  static void handle_permission(Event_T E);  static void handle_permission(Event_T E);
90    static void handle_uid(Event_T E);
91    static void handle_gid(Event_T E);
92    
93    
94  /* ------------------------------------------------------------------ Public */  /* ------------------------------------------------------------------ Public */
# Line 236  static void handle_event(Event_T E) { Line 240  static void handle_event(Event_T E) {
240    case EVENT_TIMESTAMP:  handle_timestamp(E); break;    case EVENT_TIMESTAMP:  handle_timestamp(E); break;
241    case EVENT_CONNECTION: handle_connection(E); break;    case EVENT_CONNECTION: handle_connection(E); break;
242    case EVENT_PERMISSION: handle_permission(E); break;    case EVENT_PERMISSION: handle_permission(E); break;
243      case EVENT_UID:        handle_uid(E); break;
244      case EVENT_GID:        handle_gid(E); break;
245    }    }
246        
247    if(E->id != EVENT_NULL) {    if(E->id != EVENT_NULL) {
# Line 385  static void handle_permission(Event_T E) Line 391  static void handle_permission(Event_T E)
391    END_LOCK;    END_LOCK;
392    
393  }  }
394    
395    
396    static void handle_uid(Event_T E) {
397    
398      LOCK(Run.mutex)
399          E->source->do_monitor= FALSE;
400          E->source->has_uid_error= TRUE;
401      END_LOCK;
402    
403    }
404    
405    
406    static void handle_gid(Event_T E) {
407    
408      LOCK(Run.mutex)
409          E->source->do_monitor= FALSE;
410          E->source->has_gid_error= TRUE;
411      END_LOCK;
412    
413    }
414    
415    
416  /* ------------------------------------------------------------------------- */  /* ------------------------------------------------------------------------- */

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26