Package: clamav-daemon
Version: 0.83-5
Severity: wishlist

please apply this patch to add stderr loggging. This is for multilog/svlogd.
It allows "LogFile stderr" configuration option

thanks


diff -ru clamav-0.84/clamd/clamd.c clamav-0.84-new/clamd/clamd.c
--- clamav-0.84/clamd/clamd.c   2005-04-20 01:33:13.000000000 +0200
+++ clamav-0.84-new/clamd/clamd.c       2005-05-04 22:52:13.000000000
+0200
@@ -137,8 +137,13 @@
     if((cpt = cfgopt(copt, "LogFile"))) {
        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");
-           exit(1);
+           if (strcmp(logg_file,"stderr")!=0) {
+              fprintf(stderr, "ERROR: LogFile requires full path.\n");
+              exit(1);
+           }
+           else {
+               use_stderr=1;
+           }
        }
        time(&currtime);
        if(logg("+++ Started at %s", ctime(&currtime))) {
diff -ru clamav-0.84/shared/output.c clamav-0.84-new/shared/output.c
--- clamav-0.84/shared/output.c 2005-04-20 01:33:15.000000000 +0200
+++ clamav-0.84-new/shared/output.c     2005-05-04 22:50:01.000000000
+0200
@@ -115,7 +115,9 @@
 #ifdef CL_THREAD_SAFE
        pthread_mutex_lock(&logg_mutex);
 #endif
-       if(!logg_fd) {
+       if(use_stderr) {
+               logg_fd = stderr;
+       } else if(!logg_fd) {
            old_umask = umask(0037);
            if((logg_fd = fopen(logg_file, "a")) == NULL) {
                umask(old_umask);
@@ -150,7 +152,7 @@
            free(timestr);
        }

-       if(logg_size) {
+       if(logg_size && !use_stderr) {
            if(stat(logg_file, &sb) != -1) {
                if(sb.st_size > logg_size) {
                    logg_file = NULL;
diff -ru clamav-0.84/shared/output.h clamav-0.84-new/shared/output.h
--- clamav-0.84/shared/output.h 2005-04-20 01:33:15.000000000 +0200
+++ clamav-0.84-new/shared/output.h     2005-05-04 22:50:01.000000000
+0200
@@ -28,6 +28,7 @@

 int mdprintf(int desc, const char *str, ...);

+int use_stderr;
 int logg(const char *str, ...);
 void logg_close(void);
 extern short int logg_verbose, logg_lock, logg_time;




-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing'), (33, 'unstable'), (15, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.11.7
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages clamav-daemon depends on:
ii  clamav-base                 0.83-5       base package for clamav, an anti-v
ii  clamav-freshclam [clamav-da 0.83-5       downloads clamav virus databases f
ii  libbz2-1.0                  1.0.2-5      high-quality block-sorting file co
ii  libc6                       2.3.2.ds1-21 GNU C Library: Shared libraries an
ii  libclamav1                  0.83-5       virus scanner library
ii  libcurl3                    7.13.2-2     Multi-protocol file transfer libra
ii  libgmp3                     4.1.4-6      Multiprecision arithmetic library
ii  libidn11                    0.5.13-1.0   GNU libidn library, implementation
ii  libssl0.9.7                 0.9.7e-3     SSL shared libraries
ii  zlib1g                      1:1.2.2-4    compression library - runtime

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to