Commits

cmoraes committed fe65c16

Added comments in code to understand syscheckd better.

Comments (0)

Files changed (2)

src/config/syscheck-config.h

 
 typedef struct _config
 {
-    int tsleep;
+    int tsleep;            /* sleep for sometime for daemon to settle */
     int sleep_after;
-    int rootcheck;
-    int disabled;
+    int rootcheck;         /* set to 0 when rootcheck is disabled */
+    int disabled;          /* is syscheck disabled? */
     int scan_on_start;
     int realtime_count;
     
-    int time;
-    int queue;
+    int time;              /* frequency (secs) for syscheck to run */
+    int queue;             /* file descriptor of socket to write to queue */
     
-    int *opts;
+    int *opts;             /* attributes set in the <directories> tag element */
 
-    char *workdir;
+    char *workdir;         /* set to the DEFAULTDIR (/var/ossec) */
     char *remote_db;
     char *db;
 
-    char *scan_day;
-    char *scan_time;
+    char *scan_day;        /* run syscheck on this day */
+    char *scan_time;       /* run syscheck at this time */
     
-	char **ignore;
-    void **ignore_regex;
+    char **ignore;         /* list of files/dirs to ignore */
+    void **ignore_regex;   /* regex of files/dirs to ignore */
     
-	char **dir;
+    char **dir;            /* array of directories to be scanned */
     void **filerestrict;
 
     /* Windows only registry checking */
     #ifdef WIN32
-	char **registry_ignore;
-    void **registry_ignore_regex;
-	char **registry;
+    char **registry_ignore;         /* list of registry entries to ignore */
+    void **registry_ignore_regex;   /* regex of registry entries to ignore */
+    char **registry;        /* array of registry entries to be scanned */
     FILE *reg_fp;
     #endif
     

src/syscheckd/create_db.c

     char f_name[PATH_MAX +2]; 
     DIR *dp;
     
-	struct dirent *entry;
+    struct dirent *entry;
 
     f_name[PATH_MAX +1] = '\0';
 	
     
     /* Opening the directory given */
     dp = opendir(dir_name);
-	if(!dp)
+    if(!dp)
     {
         if(errno == ENOTDIR)
         {
         *s_name = '\0';
         
         strncpy(s_name, entry->d_name, PATH_MAX - dir_size -2);
+
+        /* Check integrity of the file */
         read_file(f_name, opts, restriction);
     }