Here's the patch

diff -crB clamav-0.94-orig/clamd/clamd.c clamav-0.94/clamd/clamd.c
*** clamav-0.94-orig/clamd/clamd.c      2008-08-20 04:52:25.000000000 -0400
--- clamav-0.94/clamd/clamd.c   2008-09-30 10:53:28.000000000 -0400
***************
*** 230,240 ****
        char timestr[32];
        logg_file = cpt->strarg;
        if(strlen(logg_file) < 2 || (logg_file[0] != '/' && logg_file[0] != 
'\\' && logg_file[1] != ':')) {
!           fprintf(stderr, "ERROR: LogFile requires full path.\n");
            logg_close();
            freecfg(copt);
            return 1;
!       }
        time(&currtime);
        if(logg("#+++ Started at %s", cli_ctime(&currtime, timestr, 
sizeof(timestr)))) {
            fprintf(stderr, "ERROR: Problem with internal logger. Please check 
the permissions on the %s file.\n", logg_file);
--- 230,244 ----
        char timestr[32];
        logg_file = cpt->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");
            logg_close();
            freecfg(copt);
            return 1;
!           }else {
!                use_stderr=1;
!        }
!        }
        time(&currtime);
        if(logg("#+++ Started at %s", cli_ctime(&currtime, timestr, 
sizeof(timestr)))) {
            fprintf(stderr, "ERROR: Problem with internal logger. Please check 
the permissions on the %s file.\n", logg_file);
diff -crB clamav-0.94-orig/etc/clamd.conf clamav-0.94/etc/clamd.conf
*** clamav-0.94-orig/etc/clamd.conf     2008-09-02 07:59:05.000000000 -0400
--- clamav-0.94/etc/clamd.conf  2008-09-30 10:27:50.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 -crB clamav-0.94-orig/etc/freshclam.conf clamav-0.94/etc/freshclam.conf
*** clamav-0.94-orig/etc/freshclam.conf 2008-08-16 13:18:12.000000000 -0400
--- clamav-0.94/etc/freshclam.conf      2008-09-30 10:27:50.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 -crB clamav-0.94-orig/shared/output.c clamav-0.94/shared/output.c
*** clamav-0.94-orig/shared/output.c    2008-08-16 13:18:00.000000000 -0400
--- clamav-0.94/shared/output.c 2008-09-30 11:11:44.000000000 -0400
***************
*** 106,112 ****
  
      return send(desc, buff, bytes, 0);
  }
! 
  void logg_close(void) {
  
  #ifdef CL_THREAD_SAFE
--- 106,112 ----
  
      return send(desc, buff, bytes, 0);
  }
! int use_stderr;
  void logg_close(void) {
  
  #ifdef CL_THREAD_SAFE
***************
*** 148,155 ****
      pthread_mutex_lock(&logg_mutex);
  #endif
      if(logg_file) {
!       if(!logg_fd) {
!           old_umask = umask(0037);
            if((logg_fd = fopen(logg_file, "at")) == NULL) {
                umask(old_umask);
  #ifdef CL_THREAD_SAFE
--- 148,156 ----
      pthread_mutex_lock(&logg_mutex);
  #endif
      if(logg_file) {
!       if(use_stderr) {
!            logg_fd = stderr;
!         } else if(!logg_fd) {       old_umask = umask(0037);
            if((logg_fd = fopen(logg_file, "at")) == NULL) {
                umask(old_umask);
  #ifdef CL_THREAD_SAFE
***************
*** 173,179 ****
  #endif
        }
  
!       if(logg_size) {
            if(stat(logg_file, &sb) != -1) {
                if((unsigned int) sb.st_size > logg_size) {
                    logg_file = NULL;
--- 174,180 ----
  #endif
        }
  
!       if(logg_size && !use_stderr) {
            if(stat(logg_file, &sb) != -1) {
                if((unsigned int) sb.st_size > logg_size) {
                    logg_file = NULL;

diff -crB clamav-0.94-orig/shared/output.h clamav-0.94/shared/output.h
*** clamav-0.94-orig/shared/output.h    2008-09-01 13:19:46.000000000 -0400
--- clamav-0.94/shared/output.h 2008-09-30 10:27:50.000000000 -0400
***************
*** 26,31 ****
--- 26,32 ----
  #include <stdlib.h>
  #include "cfgparser.h"
  
+ int use_stderr;
  #ifdef __GNUC__
  int mdprintf(int desc, const char *str, ...) __attribute__((format(printf, 
2,3)));
  #else

The stock clamav compiles fine

Jason



..·><((((º>



> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Török Edwin
> Sent: Tuesday, September 30, 2008 1:07 PM
> To: ClamAV users ML
> Subject: Re: [Clamav-users] Compile error
> 
> 
> On 2008-09-30 20:02, Jason Staudenmayer wrote:
> > Hi all it seems I getting a compile error with clamav-0.94 
> on Fedora 9 with a patch for daemontools.
> > The patch compiles fine on my Fedora 5 box but not this one.
> >
> > Here's the error I'm getting
> > gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../shared 
> -I../libclamav   -g -O2 -MT clamd.o -MD -MP -MF 
> .deps/clamd.Tpo -c -o clamd.o clamd.c
> > clamd.c: In function âmainâ:
> > clamd.c:239: error: âuse_stderrâ undeclared (first use in 
> this function)
> > clamd.c:239: error: (Each undeclared identifier is reported 
> only once
> > clamd.c:239: error: for each function it appears in.)
> >   
> 
> Is line 239 the same for you?
> fprintf(stderr, "ERROR: Problem with internal logger. Please check the
> permissions on the %s  file.\n", logg_file);
> 
> Does an unpatched clamav compile on your box?
> How does the patch look like?
> 
> Best regards,
> --Edwin
> 
> 
> _______________________________________________
> Help us build a comprehensive ClamAV guide: visit 
> http://wiki.clamav.net
> http://www.clamav.net/support/ml
> 
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to