290 |
s->inf->st_gid= stat_buf.st_gid; |
s->inf->st_gid= stat_buf.st_gid; |
291 |
s->inf->st_size= stat_buf.st_size; |
s->inf->st_size= stat_buf.st_size; |
292 |
s->inf->timestamp= MAX(stat_buf.st_mtime, stat_buf.st_ctime); |
s->inf->timestamp= MAX(stat_buf.st_mtime, stat_buf.st_ctime); |
293 |
|
DEBUG("'%s' file existence check passed\n", s->name); |
294 |
Event_post(s, EVENT_NONEXIST, FALSE, s->action_NONEXIST, |
Event_post(s, EVENT_NONEXIST, FALSE, s->action_NONEXIST, |
295 |
"'%s' file exist", s->name); |
"'%s' file exist", s->name); |
296 |
} |
} |
300 |
"'%s' is not regular file", s->name); |
"'%s' is not regular file", s->name); |
301 |
return FALSE; |
return FALSE; |
302 |
} else { |
} else { |
303 |
|
DEBUG("'%s' is regular file\n", s->name); |
304 |
Event_post(s, EVENT_INVALID, FALSE, s->action_INVALID, |
Event_post(s, EVENT_INVALID, FALSE, s->action_INVALID, |
305 |
"'%s' is regular file", s->name); |
"'%s' is regular file", s->name); |
306 |
} |
} |
347 |
s->inf->st_uid= stat_buf.st_uid; |
s->inf->st_uid= stat_buf.st_uid; |
348 |
s->inf->st_gid= stat_buf.st_gid; |
s->inf->st_gid= stat_buf.st_gid; |
349 |
s->inf->timestamp= MAX(stat_buf.st_mtime, stat_buf.st_ctime); |
s->inf->timestamp= MAX(stat_buf.st_mtime, stat_buf.st_ctime); |
350 |
|
DEBUG("'%s' directory existence check passed\n", s->name); |
351 |
Event_post(s, EVENT_NONEXIST, FALSE, s->action_NONEXIST, |
Event_post(s, EVENT_NONEXIST, FALSE, s->action_NONEXIST, |
352 |
"'%s' directory exist", s->name); |
"'%s' directory exist", s->name); |
353 |
} |
} |
357 |
"'%s' is not directory", s->name); |
"'%s' is not directory", s->name); |
358 |
return FALSE; |
return FALSE; |
359 |
} else { |
} else { |
360 |
|
DEBUG("'%s' is directory\n", s->name); |
361 |
Event_post(s, EVENT_INVALID, FALSE, s->action_INVALID, |
Event_post(s, EVENT_INVALID, FALSE, s->action_INVALID, |
362 |
"'%s' is directory", s->name); |
"'%s' is directory", s->name); |
363 |
} |
} |
547 |
Event_post(s, EVENT_CHANGED, TRUE, s->action_PID, |
Event_post(s, EVENT_CHANGED, TRUE, s->action_PID, |
548 |
"'%s' process PID changed to %d", s->name, s->inf->pid); |
"'%s' process PID changed to %d", s->name, s->inf->pid); |
549 |
} else { |
} else { |
550 |
|
DEBUG("'%s' PID has not changed since last cycle\n", s->name); |
551 |
Event_post(s, EVENT_CHANGED, FALSE, s->action_PID, |
Event_post(s, EVENT_CHANGED, FALSE, s->action_PID, |
552 |
"'%s' PID has not changed", s->name); |
"'%s' PID has not changed", s->name); |
553 |
} |
} |
569 |
Event_post(s, EVENT_CHANGED, TRUE, s->action_PPID, |
Event_post(s, EVENT_CHANGED, TRUE, s->action_PPID, |
570 |
"'%s' process PPID changed to %d", s->name, s->inf->ppid); |
"'%s' process PPID changed to %d", s->name, s->inf->ppid); |
571 |
} else { |
} else { |
572 |
|
DEBUG("'%s' PPID has not changed since last cycle\n", s->name); |
573 |
Event_post(s, EVENT_CHANGED, FALSE, s->action_PPID, |
Event_post(s, EVENT_CHANGED, FALSE, s->action_PPID, |
574 |
"'%s' PPID has not changed", s->name); |
"'%s' PPID has not changed", s->name); |
575 |
} |
} |
817 |
"'%s' permission test failed for %s -- current permission is %o", |
"'%s' permission test failed for %s -- current permission is %o", |
818 |
s->name, s->path, s->inf->st_mode&07777); |
s->name, s->path, s->inf->st_mode&07777); |
819 |
} else { |
} else { |
820 |
DEBUG("'%s' file permission check passed [current permission=%o]\n", |
DEBUG("'%s' permission check passed [current permission=%o]\n", |
821 |
s->name, s->inf->st_mode&07777); |
s->name, s->inf->st_mode&07777); |
822 |
Event_post(s, EVENT_PERMISSION, FALSE, s->perm->action, |
Event_post(s, EVENT_PERMISSION, FALSE, s->perm->action, |
823 |
"'%s' permission passed", s->name); |
"'%s' permission passed", s->name); |
837 |
"'%s' uid test failed for %s -- current uid is %d", |
"'%s' uid test failed for %s -- current uid is %d", |
838 |
s->name, s->path, (int)s->inf->st_uid); |
s->name, s->path, (int)s->inf->st_uid); |
839 |
} else { |
} else { |
840 |
DEBUG("'%s' device uid check passed [current uid=%d]\n", s->name, |
DEBUG("'%s' uid check passed [current uid=%d]\n", s->name, |
841 |
(int)s->inf->st_uid); |
(int)s->inf->st_uid); |
842 |
Event_post(s, EVENT_UID, FALSE, s->uid->action, "'%s' uid passed", s->name); |
Event_post(s, EVENT_UID, FALSE, s->uid->action, "'%s' uid passed", s->name); |
843 |
} |
} |
857 |
"'%s' gid test failed for %s -- current gid is %d", |
"'%s' gid test failed for %s -- current gid is %d", |
858 |
s->name, s->path, (int)s->inf->st_gid); |
s->name, s->path, (int)s->inf->st_gid); |
859 |
} else { |
} else { |
860 |
DEBUG("'%s' device gid check passed [current gid=%d]\n", s->name, |
DEBUG("'%s' gid check passed [current gid=%d]\n", s->name, |
861 |
(int)s->inf->st_gid); |
(int)s->inf->st_gid); |
862 |
Event_post(s, EVENT_GID, FALSE, s->gid->action, "'%s' gid passed", s->name); |
Event_post(s, EVENT_GID, FALSE, s->gid->action, "'%s' gid passed", s->name); |
863 |
} |
} |