[prev in list] [next in list] [prev in thread] [next in thread]
List: ossec-dev
Subject: [ossec-dev] ossec-hids: getloglocation.c (HEAD) getloglocation.h
From: OSSEC CVS <cvs-commit () ossec ! net>
Date: 2006-08-28 18:45:56
Message-ID: getloglocation.h.1.6 () ossec ! net
[Download RAW message or body]
Module name: ossec-hids
Changes by: dcid 06/08/28 15:45:24
Modified files:
getloglocation.c getloglocation.h
Log message:
Description: Long commit.
-Increased size requirement for agent names.
-Added monitor daemon.
-Re organized client/server comminication.
-Removed false positives from rootkits.
Reviewed by: dcid (more tests needed)
Bug:
Index: getloglocation.c
===================================================================
RCS file: /usr/cvsroot/ossec-hids/src/analysisd/alerts/getloglocation.c,v
diff -u -r1.8 -r1.9
--- getloglocation.c 12 Aug 2006 19:28:00 -0000 1.8
+++ getloglocation.c 28 Aug 2006 18:45:24 -0000 1.9
@@ -1,4 +1,4 @@
-/* $OSSEC, getloglocation.c, v0.1, 2005/04/25, Daniel B. Cid$ */
+/* @(#) $Id$ */
/* Copyright (C) 2005 Daniel B. Cid <dcid@ossec.net>
* All right reserved.
@@ -41,75 +41,11 @@
}
-/* gzips a log file */
+/* gzips a log file
int OS_CompressLog(int yesterday, char *prev_month, int prev_year)
-{
- gzFile *_zflogGZ;
- FILE *_zflog;
- char __zlogfile[OS_FLSIZE + 1];
- char __zlogfileGZ[OS_FLSIZE + 1];
- int len, err;
- char buf[OS_MAXSTR + 1];
-
- memset(__zlogfile,'\0',OS_FLSIZE +1);
- memset(__zlogfileGZ,'\0',OS_FLSIZE +1);
- _zflog = NULL;
-
- /* Setting the umask */
- umask(0027);
-
- /* Creating the logfile name */
- snprintf(__zlogfile, OS_FLSIZE,"%s/%d/%s/ossec-%s-%02d.log",
- ALERTS,
- prev_year,
- prev_month,
- "alerts",
- yesterday);
-
- snprintf(__zlogfileGZ, OS_FLSIZE,"%s/%d/%s/ossec-%s-%02d.log.gz",
- ALERTS,
- prev_year,
- prev_month,
- "alerts",
- yesterday);
-
-
- /* Reading alert file */
- _zflog = fopen(__zlogfile, "r");
- if(!_zflog)
- {
- merror(FOPEN_ERROR, ARGV0, __zlogfile);
- return(0);
- }
-
- /* Opening compressed file */
- _zflogGZ = gzopen(__zlogfileGZ, "w");
- if(!_zflogGZ)
- {
- fclose(_zflog);
- merror(FOPEN_ERROR, ARGV0, __zlogfileGZ);
- return(0);
- }
-
- for(;;)
- {
- len = fread(buf, 1, OS_MAXSTR, _zflog);
- if(len == 0)
- break;
- if(gzwrite(_zflogGZ, buf, (unsigned)len) != len)
- merror("%s: Compression error: %s", ARGV0,gzerror(_zflogGZ, &err));
- }
-
- /* Closing */
- fclose(_zflog);
- gzclose(_zflogGZ);
- /* Removing uncompressed file */
- unlink(__zlogfile);
-
- return(0);
-}
-
+ -- moved to monitord.
+*/
Index: getloglocation.h
===================================================================
RCS file: /usr/cvsroot/ossec-hids/src/analysisd/alerts/getloglocation.h,v
diff -u -r1.5 -r1.6
--- getloglocation.h 10 Jul 2006 14:59:01 -0000 1.5
+++ getloglocation.h 28 Aug 2006 18:45:24 -0000 1.6
@@ -1,4 +1,4 @@
-/* $OSSEC, getloglocation.h, v0.2, 2005/04/25, Daniel B. Cid$ */
+/* @(#) $Id$ */
/* Copyright (C) 2005 Daniel B. Cid <dcid@ossec.net>
* All right reserved.
@@ -15,18 +15,12 @@
#define __GETLL_H
#include "eventinfo.h"
-#include "os_zlib/os_zlib.h"
/*
* Start the log location (need to be called before getlog)
*
*/
void OS_InitLog();
-
-/* Compress a log using gzip.
- *
- */
-int OS_CompressLog(int yesterday, char *prev_month, int prev_year);
/*
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic