Re: [clamav-users] Virus summary

2003-05-28 Thread listuser
On Tue, 27 May 2003, Ronan Lucio wrote:

> Hello,
> 
> I'd like to make a report about the viruses catched by ClamAV.
> So, to do this I tried to read the clamav log file and create
> a txt file with the results, but, when I remove the clamd log
> file, ClamAV don't create it againg. ClamAV only create a new
> log file when I restart it.
> 
> So, If I want to leave the file blank each time I read it,
> should I restart clamd?
> 
> It's not so good to an automated process.
> 
> Any tip would be appreciated.

I hope you already rotate that log with logrotate.  How often do you want 
to generate the report?  Weekly?  Rotate the log weekly and logrotate will 
take care of the log file recreation.  If you want to rotate the log 
monthly and generate the report weekly then a trick I frequently use will 
work for you.  First get a copy of LogCheck.

http://freshmeat.net/redir/logcheck/40274/url_tgz/logcheck-1.1.1.tar.gz

Ungz and untar that file.  Compile logcheck.  You don't have to install it 
if you don't want the whole thing (handy tool though).  Copy src/logtail 
to somewhere useful like /usr/local/bin/.  Usage is simple:

logtail  /path/to/your/log  offsetFile  >  tempFile

Logtail stores the decimal offset and inode of the file in file to
remember exactly what it last read from the log file.  It outputs the
remaining log to STDOUT.  Dump that to a temp file and use that file as a
collection of data for your report generating.  Automate this with crons.  
First call a script that calls logtail.  Then call your report generation
script.  Or merge the two and pipe logtail's output into your report
generation script.  I always dump it to file because I pull multiple data
sources from that output (like POP and IMAP client connections or spam
rejections of various types in a 5 minute period).

I threw together the shell script below to call logtail and handle simple
instance locking in one go.

#!/bin/bash

LOGTAIL=/usr/local/bin/logtail
workDir=/noc/mail-stats
tmpFile=$workDir/current-log.out
offsetFile=$workDir/current-log.offset
lockFile=.logtail-lock

# Local lock file check/creation
if [ -f $workDir/$lockFile ];
 then
  echo ERROR: Local lock "$workDir/$lockFile" exists.;
  exit 1;
else
   date > $workDir/$lockFile 
fi

# remove the old temp file if it exists
# Not really needed but...
if [ -f $tmpFile ]; then
 rm -f $tmpFile 
fi

$LOGTAIL /var/log/maillog $offsetFile > $tmpFile

# Remove the lock file.
 rm -f $workDir/$lockFile || echo "ERROR: Can't remove $workDir/$lockFile."



Good luck
 Justin


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [clamav-users] Missing binaries for clamd/clamdscan

2003-05-28 Thread listuser
George,

You probably already thought of this but just in case you didn't..

echo $PATH

is any /usr/local in there?

ls -l /usr/local/bin/clamscan

Your prompt indicates that you weren't root when you ran make install.  
Were you?

Justin

On Tue, 27 May 2003, George Szekely wrote:

> Hi all!
> 
> I'm quite new to clamav and having some problems compiling it for OSX.
> I'm using the standard process:
> 
> $ tar zxpvf clamav-x.yz.tar.gz
> $ cd clamav-x.yz
> $ ./configure; make
> $ make install
> 
> But somehow it does not compile nor install  clamd/clamdscan.
> The end of "make install" process does not indicate any error.
> 
> Any help would be appreciated.
> 
> George
> 
> 
> 
> /bin/sh ../mkinstalldirs /usr/local/include
>   /usr/bin/install -c -m 644 clamav.h /usr/local/include/clamav.h
> Making install in clamscan
> /bin/sh ../mkinstalldirs /usr/local/bin
>/bin/sh ../libtool --mode=install /usr/bin/install -c clamscan 
> /usr/local/bin/clamscan
> /usr/bin/install -c .libs/clamscan /usr/local/bin/clamscan
> make[2]: Nothing to be done for `install-data-am'.
> Making install in freshclam
> /bin/sh ../mkinstalldirs /usr/local/bin
>/bin/sh ../libtool --mode=install /usr/bin/install -c freshclam 
> /usr/local/bin/freshclam
> /usr/bin/install -c .libs/freshclam /usr/local/bin/freshclam
> make[2]: Nothing to be done for `install-data-am'.
> Making install in database
> /bin/sh ../mkinstalldirs /usr/local/share/clamav
> Making install in docs
> make[2]: Nothing to be done for `install-exec-am'.
> /bin/sh ../mkinstalldirs /usr/local/man/man1
>   /usr/bin/install -c -m 644 ./clamscan.1 /usr/local/man/man1/clamscan.1
>   /usr/bin/install -c -m 644 ./freshclam.1 /usr/local/man/man1/freshclam.1
>   /usr/bin/install -c -m 644 ./sigtool.1 /usr/local/man/man1/sigtool.1
>   /usr/bin/install -c -m 644 ./clamdscan.1 /usr/local/man/man1/clamdscan.1
> /bin/sh ../mkinstalldirs /usr/local/man/man5
>   /usr/bin/install -c -m 644 ./clamav.conf.5 /usr/local/man/man5/clamav.conf.5
> /bin/sh ../mkinstalldirs /usr/local/man/man8
>   /usr/bin/install -c -m 644 ./clamd.8 /usr/local/man/man8/clamd.8
> Making install in sigtool
> /bin/sh ../mkinstalldirs /usr/local/bin
>/bin/sh ../libtool --mode=install /usr/bin/install -c sigtool 
> /usr/local/bin/sigtool
> /usr/bin/install -c .libs/sigtool /usr/local/bin/sigtool
> make[2]: Nothing to be done for `install-data-am'.
> Making install in clamd
> 
> /bin/sh ../mkinstalldirs /usr/local/sbin
> make[2]: Nothing to be done for `install-data-am'.
> Making install in clamdscan
> /bin/sh ../mkinstalldirs /usr/local/bin
> make[2]: Nothing to be done for `install-data-am'.
> Making install in etc
> make[2]: Nothing to be done for `install-exec-am'.
> make[2]: Nothing to be done for `install-data-am'.
> make[2]: Nothing to be done for `install-exec-am'.
> make[2]: Nothing to be done for `install-data-am'.
> [adsl-66:~/clamav-0.54] root#
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [clamav-users] Missing binaries for clamd/clamdscan

2003-05-28 Thread George Szekely
Justin,

Thanks for the feedback.

As it turns out the configure file for compiling clamav-0.54 sets
"have_pthreads" to "no" if it detect Darwin (OSX) and clamd/clamdscan 
requires POSIX threads support. Hence the absence of installation for 
daemon.
I was under the impression that OSX being FreeBSD, is supporting threads.

"use_netinfo="yes"
have_pthreads="no"
echo "$as_me:$LINENO: result: Darwin detected. Disabling thread 
support." >&5
echo "${ECHO_T}Darwin detected. Disabling thread support." >&6
;;
"
I've flipped "no" to "yes" and it did compile and install, but the question
in my mind remains if that is OK or it's set to "no" for a reason. It 
works from the command line, but not from Exim yet.

George



[adsl-66:~] root# clamdscan clamav-0.54
/var/root/clamav-0.54/test/test1: ClamAV-Test-Signature FOUND
/var/root/clamav-0.54: OK
--- SCAN SUMMARY ---
Infected files: 1
Time: 1.826 sec (0 m 1 s)
[adsl-66:~] root#
   
   

+++ Started at Tue May 27 18:58:58 2003
Log file size limited to 1048576 bytes.
Reading databases from /usr/local/share/clamav
Protecting against 7286 viruses.
Unix socket file /tmp/clamd
Setting connection queue length to 15
Maximal number of threads: 5
Archive: Archived file size limit set to 10485760 bytes.
Archive: Recursion level limit set to 5.
Archive: Files limit set to 1000.
Archive support enabled.
Self checking every 3600 seconds.
Timeout set to 180 seconds.


George,

You probably already thought of this but just in case you didn't..

echo $PATH

is any /usr/local in there?

ls -l /usr/local/bin/clamscan

Your prompt indicates that you weren't root when you ran make install. 
Were you?

Justin

On Tue, 27 May 2003, George Szekely wrote:

 Hi all!

 I'm quite new to clamav and having some problems compiling it for OSX.
 I'm using the standard process:
 $ tar zxpvf clamav-x.yz.tar.gz
 $ cd clamav-x.yz
 $ ./configure; make
 $ make install
 But somehow it does not compile nor install  clamd/clamdscan.
 The end of "make install" process does not indicate any error.
 Any help would be appreciated.

 > George
 >
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [clamav-users] Virus summary

2003-05-28 Thread Fajar Arief Nugraha




Or you could just use this script. I modify it from exims' exicyclog.
Just put it in the crontab.
My log is stored as /var/spool/exim/log/clamd.log

You probably need to tidy it up a little

#! /bin/sh
keep=10
compress=/usr/bin/gzip
suffix=gz

chown=/usr/bin/chown
chgrp=/usr/bin/chgrp
mv=/bin/mv
rm=/bin/rm

log_file_path=/var/spool/exim/log/
logdir=$log_file_path
viruslog=clamd-log

cd $logdir
cp clamd.log clamd-log
cp /dev/null clamd.log

#clamd log processing
a=`ls -lg $viruslog`
b=`ls -l  $viruslog`

user=`echo "$a
$b
" | awk 'BEGIN { OFS=""} { if ($5 ~ /^[0-9]+$/) { print $3; exit; } }'`

group=`echo "$a
$b
" | awk 'BEGIN { OFS=""} { if ($5 ~ /^[0-9]+$/) { print $4; exit; } }'`

if [ $keep -lt 10 ]; then keept=0$keep; else keept=$keep; fi;

if [ -f $viruslog.$keept ]; then $rm $viruslog.$keept; fi;
if [ -f $viruslog.$keept.$suffix ]; then $rm $viruslog.$keept.$suffix;
fi;

count=$keep
if [ $count -lt 10 ]; then countt=0$count; else countt=$count; fi;

while [ $count -gt 1 ]; do
  old=`expr $count - 1`
  if [ $old -lt 10 ]; then oldt=0$old; else oldt=$old; fi;
  if [ -f $viruslog.$oldt ]; then
    $mv $viruslog.$oldt $viruslog.$countt
  elif [ -f $viruslog.$oldt.$suffix ]; then
    $mv $viruslog.$oldt.$suffix $viruslog.$countt.$suffix
  fi
  count=$old
  countt=$oldt
done

if [ -f $viruslog ]; then
  $mv $viruslog $viruslog.01
  $chown $user:$group $viruslog.01
fi

count=2;

while [ $count -le $keep ]; do
  if [ $count -lt 10 ]; then countt=0$count; else countt=$count; fi
  if [ -f $viruslog.$countt ]; then $compress $viruslog.$countt; fi
  if [ -f $viruslog.$countt.$suffix ]; then
    $chown $user:$group $viruslog.$countt.$suffix
  fi
  count=`expr $count + 1`
done




[EMAIL PROTECTED] wrote:

  On Tue, 27 May 2003, Ronan Lucio wrote:

  
  
Hello,

I'd like to make a report about the viruses catched by ClamAV.
So, to do this I tried to read the clamav log file and create
a txt file with the results, but, when I remove the clamd log
file, ClamAV don't create it againg. ClamAV only create a new
log file when I restart it.

So, If I want to leave the file blank each time I read it,
should I restart clamd?

It's not so good to an automated process.

Any tip would be appreciated.

  
  
I hope you already rotate that log with logrotate.  How often do you want 
to generate the report?  Weekly?  Rotate the log weekly and logrotate will 
take care of the log file recreation.  If you want to rotate the log 
monthly and generate the report weekly then a trick I frequently use will 
work for you.  First get a copy of LogCheck.

http://freshmeat.net/redir/logcheck/40274/url_tgz/logcheck-1.1.1.tar.gz

Ungz and untar that file.  Compile logcheck.  You don't have to install it 
if you don't want the whole thing (handy tool though).  Copy src/logtail 
to somewhere useful like /usr/local/bin/.  Usage is simple:

  






Re: [clamav-users] Missing binaries for clamd/clamdscan

2003-05-28 Thread listuser
Ah.  An OS X user.  I don't have an OS X box handy anymore to test this 
on.  I'd suspect that's the same reason it's set to no; the author didn't 
have an OS X box to test on, or couldn't get testing and feedback from an 
OS X user.  I can't say that with any degree of certainty though.  It's 
plausible.  Good luck!

Justin


On Tue, 27 May 2003, George Szekely wrote:

> Justin,
> 
> Thanks for the feedback.
> 
> As it turns out the configure file for compiling clamav-0.54 sets
> "have_pthreads" to "no" if it detect Darwin (OSX) and clamd/clamdscan 
> requires POSIX threads support. Hence the absence of installation for 
> daemon.
> I was under the impression that OSX being FreeBSD, is supporting threads.
> 
> "use_netinfo="yes"
>  have_pthreads="no"
>  echo "$as_me:$LINENO: result: Darwin detected. Disabling thread 
> support." >&5
> echo "${ECHO_T}Darwin detected. Disabling thread support." >&6
>  ;;
> "
> I've flipped "no" to "yes" and it did compile and install, but the question
> in my mind remains if that is OK or it's set to "no" for a reason. It 
> works from the command line, but not from Exim yet.
> 
> George
> 
> 
> 
> [adsl-66:~] root# clamdscan clamav-0.54
> /var/root/clamav-0.54/test/test1: ClamAV-Test-Signature FOUND
> /var/root/clamav-0.54: OK
> 
> --- SCAN SUMMARY ---
> Infected files: 1
> Time: 1.826 sec (0 m 1 s)
> [adsl-66:~] root#
> 
> 
> 
> 
> +++ Started at Tue May 27 18:58:58 2003
> Log file size limited to 1048576 bytes.
> Reading databases from /usr/local/share/clamav
> Protecting against 7286 viruses.
> Unix socket file /tmp/clamd
> Setting connection queue length to 15
> Maximal number of threads: 5
> Archive: Archived file size limit set to 10485760 bytes.
> Archive: Recursion level limit set to 5.
> Archive: Files limit set to 1000.
> Archive support enabled.
> Self checking every 3600 seconds.
> Timeout set to 180 seconds.
> 
> 
> 
> >George,
> >
> >You probably already thought of this but just in case you didn't..
> >
> >echo $PATH
> >
> >is any /usr/local in there?
> >
> >ls -l /usr/local/bin/clamscan
> >
> >Your prompt indicates that you weren't root when you ran make install. 
> >Were you?
> >
> >Justin
> >
> >On Tue, 27 May 2003, George Szekely wrote:
> >
> >>  Hi all!
> >>
> >>  I'm quite new to clamav and having some problems compiling it for OSX.
> >>  I'm using the standard process:
> >>
> >>  $ tar zxpvf clamav-x.yz.tar.gz
> >>  $ cd clamav-x.yz
> >>  $ ./configure; make
> >>  $ make install
> >>
> >>  But somehow it does not compile nor install  clamd/clamdscan.
> >>  The end of "make install" process does not indicate any error.
> >>
> >>  Any help would be appreciated.
> >>
> >  > George
> >  >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [clamav-users] Missing binaries for clamd/clamdscan

2003-05-28 Thread Flinn Mueller
George Szekely wrote:

"use_netinfo="yes"
have_pthreads="no"
echo "$as_me:$LINENO: result: Darwin detected. Disabling thread 
support." >&5
echo "${ECHO_T}Darwin detected. Disabling thread support." >&6
;;
"
I've flipped "no" to "yes" and it did compile and install, but the question
in my mind remains if that is OK or it's set to "no" for a reason. It 
works from the command line, but not from Exim yet.
This is also true on my OS X machine using 20030522.  I can't speak for 
Exim, but all seems well otherwise.

Patch attached...
sorry for the sh*t line endings on the patch
Regards,
Flinn
--- configure.orig  Tue May 27 23:42:59 2003
+++ configure   Tue May 27 23:43:05 2003
@@ -9083,9 +9083,9 @@ _ACEOF
 _ACEOF
 
 use_netinfo="yes"
-have_pthreads="no"
-echo "$as_me:$LINENO: result: Darwin detected. Disabling thread support." >&5
-echo "${ECHO_T}Darwin detected. Disabling thread support." >&6
+have_pthreads="yes"
+//echo "$as_me:$LINENO: result: Darwin detected. Disabling thread support." >&5
+//echo "${ECHO_T}Darwin detected. Disabling thread support." >&6
 ;;
 sco*)
 FRESHCLAM_LIBS="-lsocket"
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

[clamav-users] clamd-20030522 crashed

2003-05-28 Thread Fajar Arief Nugraha
Sorry about that. It was an old virus, I don't keep the original mail 
anymore. I just keep the attachment.

Anyway,

I'm currently implementing exim 4.20 - exiscan-acl - clamav 20030522 in 
7 MTAs.
Most are fine (I set exim's maximum connection to 384).
Two of them, because of the heavy traffic, had exim's maximum set to 
connection 2048 ( Even then I stil get "Connection from x.x.x.x refused: 
too many connections" in Exim's log).

exiscan calls clamav thru a wrapper script, that first calls clamdscan, 
and if it fails calls clamscan. I also have a cron job that 
automatically notify me an restarts clamd incase it's dead (clamd is in 
using local socket /tmp/clamd).

Of those two servers, Clamd seems to be having problems in one of them. 
It has crashed and restarted 7 times in two days.

I couldn't get any clue why it's dead from clamd.log or system log. Is 
there any way to find out why?

Regards,

Fajar

Tomasz Kojm wrote:

This is a normal ASCII file, it seems the virus has been removed by your
mail provider. BTW, next time please send a virus copy to
[EMAIL PROTECTED]
(and you don't need to encrypt it).
Best regards,
Tomasz Kojm
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [clamav-users] clamd-20030522 crashed

2003-05-28 Thread Fajar Arief Nugraha
I suggest you use the newest snapshot, since 0.54 crashed more often (on 
my installation, that is).
If you use the new exiscan-acl with clamd support, you could probably 
just use these in exim config (modify to fit your configuration):

#[main config section]

av_scanner = clamd:/tmp/clamd

#[acl_check_rcpt section]

acl_check_data:

 deny  message = Message "$header_Subject:" contains an unwanted file extension ($found_extension). If you wish to send these files, please Zip it and then resend.

   demime = exe:com:vbs:bat:bas:ade:adp:chm:cmd:cpl:crt:hlp:hta:ins:inf:isp:js:jse:lnk:mdb:mde:msc:msi:msp:mst:pcd:pif:reg:scr:sct:shs:url:vbe:wsf:wsh:wsc

 deny  message = Message "$header_Subject:" contains virus or malware ($malware_name)

   malware = *

 accept condition = yes

A fair warning : if clamd is dead, ALL mail will be defered.
If you want to use the cmdline scanner with wrapper script (it can 
fallback to clamscan if clamd fails), use this in exim's configure :

#[main config section]

av_scanner = cmdline:\

 /usr/exim/malware.sh %s:\

 FOUND:'(.+)'

Use the same config as above for the acl_check_rcpt
The wrapper script :
#!/bin/sh

TMPFILE=$1

DATE=`date '+%Y-%m-%d %H:%M:%S'`

BEG="$DATE $TMPFILE :"

LOGFILE=/var/spool/exim/log/malware.log

if [ "X$TMPFILE" = "X" ]

   then echo You must specify file to scan

   exit

fi

printf "$BEG Scanning for virus\n" >> $LOGFILE

SCANNER_OUTPUT=`/usr/clamav/bin/clamdscan $TMPFILE 2>&1`

ERROR=`echo $SCANNER_OUTPUT|grep -i ERROR:|wc -w`

if [ $ERROR -gt 0 ]

   then SCANNER_OUTPUT=`/usr/clamav/bin/clamscan $TMPFILE 2>&1`

   #clamscan fallback

fi

FOUND=`echo $SCANNER_OUTPUT|grep -i FOUND|wc -w`

if [ $FOUND -gt 0 ]

   then VIRUS=`echo $SCANNER_OUTPUT | awk -F: '{print $2}'|awk '{print $1}'`

   printf "$BEG rejecting : virus $VIRUS found\n" >> $LOGFILE

   echo "'$VIRUS' FOUND"

   exit

else

   printf "$BEG No virus found\n" >> $LOGFILE

   echo No virus detected

fi

Some warning :
- It will likely be a little slower then the clamd solution
- This script logs to /var/spool/exim/log/malware.log, which can grow 
very big. Remember to rotate it, or modify the script do disable logging.
- You need /bin/sh, awk, grep, wc, date, and cat (part of  most standard 
U**ix)
- My clamdscan and clamscan were installed as /usr/clamav/bin/clamdscan 
and /usr/clamav/bin/clamscan

Regards,

Fajar

George Szekely wrote:

Sorry about that. It was an old virus, I don't keep the original mail 
anymore. I just keep the attachment.

Anyway,

I'm currently implementing exim 4.20 - exiscan-acl - clamav 20030522 
in 7 MTAs.
Most are fine (I set exim's maximum connection to 384).
Two of them, because of the heavy traffic, had exim's maximum set to 
connection 2048 ( Even then I stil get "Connection from x.x.x.x 
refused: too many connections" in Exim's log).

exiscan calls clamav thru a wrapper script, that first calls 
clamdscan, and if it fails calls clamscan.


Fajar,

Since I'm trying to get going with exim4.20-exiscan-acl-clamav-0.54 also,
I would love to see your exim config and the wrapper script that calls 
on clamdscan. I was under the impression that exiscan does that by 
itself.

George



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [clamav-users] [PATCH] corrected proxy support in freshclam

2003-05-28 Thread Tomasz Kojm
> This is not-very-beautiful, but logically correct fix for http-proxy and
> proxy-user support in freshclam. It fixes uninitialized pointers freeing,
> too.

Thanks, however Damien Curtain has already sent me a patch for that.

Best regards,
Tomasz Kojm
-- 
  oo.   [EMAIL PROTECTED]
 (\/)\. http://www.konarski.edu.pl/~zolw
\..._   I nie zapomnij kliknac w brzuszek... 
  //\   /\\ <- C. Amboinensiswww.pajacyk.pl

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




[clamav-users] ./configure looking to /etc/passwd for user data?

2003-05-28 Thread Christopher Allen [BigFatPipe.Net]
Greetings, we're receiving the following error during the configure process.

; begin paste
Checking /etc/passwd...
ERROR: User "clamav" (and/or group "clamav") doesn't exist. Please create
it.
; end paste

Using the --with-user and --with-group options produces the same error.  The
clamav user and clamav group _do_ exist in our system, however we've never
had a program require an actual /etc/passwd file before... so they don't
exist on any of our servers.

I used the --disable-clamav option, but the documentation isn't clear
whether this simply disables checking to see if clamav:clamav exists, or if
this actually disables clamscan's ability to run in superuser mode.

-CA

-- Christopher R. Allen  [EMAIL PROTECTED] --
-- "Education is a progressive discovery of our --
-- own ignorance."  Will Durant --


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: [clamav-users] Connection Problems

2003-05-28 Thread Sean O'Reilly
The  error i am getting when trying to send from outlook express is 451
temporary local problem. When i check exim's logs it says: temporarily
rejected by exiscan(): Temporary local problem ( error parsing returned
output)

Does anyone know what this might be please ?

Sean O'Reilly


On Tue, 2003-05-27 at 15:53, Paul Walsh wrote:
> >-Original Message-
> >From: Sean O'Reilly [mailto:[EMAIL PROTECTED]
> >Sent: 27 May 2003 14:26
> >To: [EMAIL PROTECTED]
> >Subject: Re: [clamav-users] Connection Problems
> 
> 
> >I know that clamd uses port 3310 but why is the connection being refused
> >when i try to send or recieve mail.
> >
> >Sean O'Reilly
> 
> Errm If I read your original mail correctly, Exiscan is trying to connect to
> 3301 instead of 3310.  A typo in your exim config perhaps> :)
> 
> Paul
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




[clamav-devel] [PATCH] corrected proxy support in freshclam

2003-05-28 Thread Nick Gazaloff
This is not-very-beautiful, but logically correct fix for http-proxy and
proxy-user support in freshclam. It fixes uninitialized pointers freeing,
too.


-- 

Best regards,
Nick
(GPG Key ID: 4396B2D0, fingerprint: 648E C3FE ACF6 A730 FF52 D717 776D 1CB0 4396 B2D0)


diff -r -U 3 clamav-20030522-orig/freshclam/manager.c 
clamav-20030522/freshclam/manager.c
--- clamav-20030522-orig/freshclam/manager.cThu Apr 24 02:46:57 2003
+++ clamav-20030522/freshclam/manager.c Wed May 28 13:55:51 2003
@@ -393,17 +393,21 @@
 if(proxy) {
 remotename = mmalloc(strlen(hostname) + 8);
 sprintf(remotename, "http://%s";, hostname);
-} else if(user) {
-int len;
-   char* buf = mmalloc(strlen(user)*2+4);
-len=fmt_base64(buf,user,strlen(user));
-buf[len]='\0';
-authorization = mmalloc(strlen(buf) + 30);
-sprintf(authorization, "Proxy-Authorization: Basic %s\r\n", buf);
-free(buf);
+
+if(user) {
+int len;
+   char* buf = mmalloc(strlen(user)*2+4);
+len=fmt_base64(buf,user,strlen(user));
+buf[len]='\0';
+authorization = mmalloc(strlen(buf) + 30);
+sprintf(authorization, "Proxy-Authorization: Basic %s\r\n", buf);
+free(buf);
+} else {
+authorization = strdup("");
+}
 } else {
-authorization = strdup("");
 remotename = strdup("");
+authorization = strdup("");
 }
 
 mprintf("Reading md5 sum (%s): ", file);
@@ -487,18 +491,22 @@
 if(proxy) {
 remotename = mmalloc(strlen(hostname) + 8);
 sprintf(remotename, "http://%s";, hostname);
-} else if(user) {
-int len;
-   char* buf = mmalloc(strlen(user)*2+4);
-len=fmt_base64(buf,user,strlen(user));
-buf[len]='\0';
-authorization = mmalloc(strlen(buf) + 30);
-sprintf(authorization, "Proxy-Authorization: Basic %s\r\n", buf);
-free(buf);
+if(user) {
+int len;
+   char* buf = mmalloc(strlen(user)*2+4);
+len=fmt_base64(buf,user,strlen(user));
+buf[len]='\0';
+authorization = mmalloc(strlen(buf) + 30);
+sprintf(authorization, "Proxy-Authorization: Basic %s\r\n", buf);
+free(buf);
+} else {
+authorization = strdup("");
+}
 } else {
-authorization = strdup("");
 remotename = strdup("");
+authorization = strdup("");
 }
+
 
 if((fd = open(file, O_WRONLY|O_CREAT|O_EXCL, 0644)) == -1) {
mprintf("@Can't open new file %s to write\n", file);

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]