I have a patch for using clamav-95 with multi log if anyone is intrested.
I didn't write the orginal patch I found it on shupp.org but they stopped 
adding release at 0.91.

patched clean and no issues with compile or running on Fedora 9/8/7/5/3

Patch paste below:

diff -cr clamav-0.95/clamd/clamd.c clamav-0.95-patched/clamd/clamd.c
*** clamav-0.95/clamd/clamd.c   2009-03-16 14:37:26.000000000 -0400
--- clamav-0.95-patched/clamd/clamd.c   2009-04-08 10:37:34.000000000 -0400
***************
*** 217,226 ****
        char timestr[32];
        logg_file = opt->strarg;
        if(strlen(logg_file) < 2 || (logg_file[0] != '/' && logg_file[0] != 
'\\' && logg_file[1] != ':')) {
!           fprintf(stderr, "ERROR: LogFile requires full path.\n");
            ret = 1;
            break;
!       }
        time(&currtime);
        if(logg("#+++ Started at %s", cli_ctime(&currtime, timestr, 
sizeof(timestr)))) {
            fprintf(stderr, "ERROR: Can't initialize the internal logger\n");
--- 217,230 ----
        char timestr[32];
        logg_file = opt->strarg;
        if(strlen(logg_file) < 2 || (logg_file[0] != '/' && logg_file[0] != 
'\\' && logg_file[1] != ':')) {
!       if (strcmp(logg_file,"stderr")!=0) {
!          fprintf(stderr, "ERROR: LogFile requires full path.\n");
            ret = 1;
            break;
!       }else {
!                 use_stderr=1;
!         }
!         }
        time(&currtime);
        if(logg("#+++ Started at %s", cli_ctime(&currtime, timestr, 
sizeof(timestr)))) {
            fprintf(stderr, "ERROR: Can't initialize the internal logger\n");
diff -cr clamav-0.95/etc/clamd.conf clamav-0.95-patched/etc/clamd.conf
*** clamav-0.95/etc/clamd.conf  2009-03-16 14:37:27.000000000 -0400
--- clamav-0.95-patched/etc/clamd.conf  2009-04-08 10:38:59.000000000 -0400
***************
*** 5,17 ****


  # Comment or remove the line below.
! Example

  # Uncomment this option to enable logging.
  # LogFile must be writable for the user running daemon.
  # A full path is required.
  # Default: disabled
! #LogFile /tmp/clamd.log

  # By default the log file is locked for writing - the lock protects against
  # running clamd multiple times (if want to run another clamd, please
--- 5,17 ----


  # Comment or remove the line below.
! #Example

  # Uncomment this option to enable logging.
  # LogFile must be writable for the user running daemon.
  # A full path is required.
  # Default: disabled
! # /tmp/clamd.log

  # By default the log file is locked for writing - the lock protects against
  # running clamd multiple times (if want to run another clamd, please
***************
*** 36,42 ****
  # Also log clean files. Useful in debugging but drastically increases the
  # log size.
  # Default: no
! #LogClean yes

  # Use system logger (can work together with LogFile).
  # Default: no
--- 36,42 ----
  # Also log clean files. Useful in debugging but drastically increases the
  # log size.
  # Default: no
! LogClean yes

  # Use system logger (can work together with LogFile).
  # Default: no
***************
*** 49,55 ****

  # Enable verbose logging.
  # Default: no
! #LogVerbose yes

  # This option allows you to save a process identifier of the listening
  # daemon (main thread).
--- 49,55 ----

  # Enable verbose logging.
  # Default: no
! LogVerbose yes

  # This option allows you to save a process identifier of the listening
  # daemon (main thread).
***************
*** 158,164 ****

  # Don't fork into background.
  # Default: no
! #Foreground yes

  # Enable debug messages in libclamav.
  # Default: no
--- 158,164 ----

  # Don't fork into background.
  # Default: no
! Foreground yes

  # Enable debug messages in libclamav.
  # Default: no
***************
*** 236,242 ****

  # Enable internal e-mail scanner.
  # Default: yes
! #ScanMail yes

  # If an email contains URLs ClamAV can download and scan them.
  # WARNING: This option may open your system to a DoS attack.
--- 236,242 ----

  # Enable internal e-mail scanner.
  # Default: yes
! ScanMail yes

  # If an email contains URLs ClamAV can download and scan them.
  # WARNING: This option may open your system to a DoS attack.
diff -cr clamav-0.95/etc/freshclam.conf clamav-0.95-patched/etc/freshclam.conf
*** clamav-0.95/etc/freshclam.conf      2009-03-16 14:43:35.000000000 -0400
--- clamav-0.95-patched/etc/freshclam.conf      2009-04-08 10:38:59.000000000 
-0400
***************
*** 5,11 ****


  # Comment or remove the line below.
! Example

  # Path to the database directory.
  # WARNING: It must match clamd.conf's directive!
--- 5,11 ----


  # Comment or remove the line below.
! #Example

  # Path to the database directory.
  # WARNING: It must match clamd.conf's directive!
***************
*** 14,20 ****

  # Path to the log file (make sure it has proper permissions)
  # Default: disabled
! #UpdateLogFile /var/log/freshclam.log

  # Maximum size of the log file.
  # Value of 0 disables the limit.
--- 14,20 ----

  # Path to the log file (make sure it has proper permissions)
  # Default: disabled
! UpdateLogFile /var/log/freshclam.log

  # Maximum size of the log file.
  # Value of 0 disables the limit.
diff -cr clamav-0.95/shared/output.c clamav-0.95-patched/shared/output.c
*** clamav-0.95/shared/output.c 2009-03-16 14:37:26.000000000 -0400
--- clamav-0.95-patched/shared/output.c 2009-04-08 10:35:18.000000000 -0400
***************
*** 191,197 ****

      return ret < 0 ? -1 : bytes;
  }
!
  void logg_close(void)
  {
  #if defined(USE_SYSLOG) && !defined(C_AIX)
--- 191,197 ----

      return ret < 0 ? -1 : bytes;
  }
! int use_stderr;
  void logg_close(void)
  {
  #if defined(USE_SYSLOG) && !defined(C_AIX)
***************
*** 249,256 ****
      pthread_mutex_lock(&logg_mutex);
  #endif
      if(logg_file) {
!       if(!logg_fp) {
!           old_umask = umask(0037);
            if((logg_fp = fopen(logg_file, "at")) == NULL) {
                umask(old_umask);
  #ifdef CL_THREAD_SAFE
--- 249,258 ----
      pthread_mutex_lock(&logg_mutex);
  #endif
      if(logg_file) {
!       if(use_stderr) {
!             logg_fp = stderr;
!          } else if(!logg_fp) {
!               old_umask = umask(0037);
            if((logg_fp = fopen(logg_file, "at")) == NULL) {
                umask(old_umask);
  #ifdef CL_THREAD_SAFE
***************
*** 279,285 ****
  #endif
        }

!       if(logg_size) {
            if(stat(logg_file, &sb) != -1) {
                if((unsigned int) sb.st_size > logg_size) {
                    logg_file = NULL;
--- 281,287 ----
  #endif
        }

!       if(logg_size && !use_stderr) {
            if(stat(logg_file, &sb) != -1) {
                if((unsigned int) sb.st_size > logg_size) {
                    logg_file = NULL;
diff -cr clamav-0.95/shared/output.h clamav-0.95-patched/shared/output.h
*** clamav-0.95/shared/output.h 2009-03-16 14:37:26.000000000 -0400
--- clamav-0.95-patched/shared/output.h 2009-04-08 10:38:59.000000000 -0400
***************
*** 27,32 ****
--- 27,33 ----

  #include <stdlib.h>

+ int use_stderr;
  #ifdef __GNUC__
  int mdprintf(int desc, const char *str, ...) __attribute__((format(printf, 
2,3)));
  #else

END patch ----------


Jason
 
 
 
..·><((((º>
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to