verbose("%s: Reading dir: %s\n",ARGV0, file_name);
#endif
+ #ifdef WIN32
+ /* Directory links are not supported */
+ if (GetFileAttributes(file_name) & FILE_ATTRIBUTE_REPARSE_POINT) {
+ merror("%s: WARN: Links are not supported: '%s'", ARGV0, file_name);
+ return(-1);
+ }
+ #endif
return(read_dir(file_name, opts, restriction));
}
buf = OSHash_Get(syscheck.fp, file_name);
if(!buf)
{
- char alert_msg[912 +1];
+ char alert_msg[916 +1]; /* 912 -> 916 to accommodate a long */
- alert_msg[912] = '\0';
+ alert_msg[916] = '\0';
+ #ifndef WIN32
if(opts & CHECK_SEECHANGES)
{
char *alertdump = seechanges_addfile(file_name);
alertdump = NULL;
}
}
+ #endif
- snprintf(alert_msg, 912, "%c%c%c%c%c%c%d:%d:%d:%d:%s:%s",
+ snprintf(alert_msg, 916, "%c%c%c%c%c%c%ld:%d:%d:%d:%s:%s",
opts & CHECK_SIZE?'+':'-',
opts & CHECK_PERM?'+':'-',
opts & CHECK_OWNER?'+':'-',
opts & CHECK_GROUP?'+':'-',
opts & CHECK_MD5SUM?'+':'-',
sha1s,
- opts & CHECK_SIZE?(int)statbuf.st_size:0,
+ opts & CHECK_SIZE?(long)statbuf.st_size:0,
opts & CHECK_PERM?(int)statbuf.st_mode:0,
opts & CHECK_OWNER?(int)statbuf.st_uid:0,
opts & CHECK_GROUP?(int)statbuf.st_gid:0,
/* Sending the new checksum to the analysis server */
- alert_msg[912] = '\0';
- snprintf(alert_msg, 912, "%d:%d:%d:%d:%s:%s %s",
- opts & CHECK_SIZE?(int)statbuf.st_size:0,
+ alert_msg[916] = '\0';
+
+ /* changed by chris st_size int to long, 912 to 916*/
+ snprintf(alert_msg, 916, "%ld:%d:%d:%d:%s:%s %s",
+ opts & CHECK_SIZE?(long)statbuf.st_size:0,
opts & CHECK_PERM?(int)statbuf.st_mode:0,
opts & CHECK_OWNER?(int)statbuf.st_uid:0,
opts & CHECK_GROUP?(int)statbuf.st_gid:0,
if(strcmp(c_sum, buf+6) != 0)
{
/* Sending the new checksum to the analysis server */
- char *fullalert = NULL;
alert_msg[OS_MAXSTR] = '\0';
+ #ifdef WIN32
+ snprintf(alert_msg, 916, "%s %s", c_sum, file_name);
+ #else
+ char *fullalert = NULL;
if(buf[5] == 's' || buf[5] == 'n')
{
fullalert = seechanges_addfile(file_name);
}
else
{
- snprintf(alert_msg, 912, "%s %s", c_sum, file_name);
+ snprintf(alert_msg, 916, "%s %s", c_sum, file_name);
}
}
else
{
- snprintf(alert_msg, 912, "%s %s", c_sum, file_name);
+ snprintf(alert_msg, 916, "%s %s", c_sum, file_name);
}
+ #endif
send_syscheck_msg(alert_msg);
}
}
struct dirent *entry;
f_name[PATH_MAX +1] = '\0';
-
+
/* Directory should be valid */
if((dir_name == NULL)||((dir_size = strlen(dir_name)) > PATH_MAX))