Re: [Evolution] Evolution 2.24 + clamav



Sex, 2008-12-05 Ãs 10:14 -0500, Reid Thompson escreveu:
On Fri, 2008-12-05 at 12:55 +0000, Josà Carlos Martins wrote:

Thank you for your kind help and patience.
My clamd.conf points to /var/lib/clamav/clamd.socket and i changed it in
the ruby program.
Yes the socket exist.
I have ruby 1.8.7 and zenity 2.24.0 installed.

First problem is here.
/home/jose/rubyclamav.rb is failing immediately

what does
  which ruby
return?

if it does not return /usr/bin/ruby, then change the first line of the
script from
  #!/usr/bin/ruby
to
  #!/path/to/your/ruby


[jose localhost ~]$ cat teste3 | /home/jose/rubyclamav.rb
/home/jose/rubyclamav.rb: line 4: require: command not found
/home/jose/rubyclamav.rb: line 5: syntax error near unexpected token `('
/home/jose/rubyclamav.rb: line 5: `fp =
File.open("/var/log/rubyclamav/rubyoutclam_#{Process.pid}.log",'
[jose localhost ~]$ echo $?


what does
   file /home/jose/rubyclamav.rb
return?

what does
   cat /home/jose/rubyclamav.rb
display?

Hello

This is what the commands returned:

[jose localhost ~]$ which ruby
/usr/bin/ruby
[jose localhost ~]$ file /home/jose/rubyclamav.rb
/home/jose/rubyclamav.rb: ASCII text
[jose localhost ~]$ cat /home/jose/rubyclamav.rb

#!/usr/bin/ruby
#
require 'socket'
fp = File.open("/var/log/rubyclamav/rubyoutclam_#{Process.pid}.log",
"a")
START_TIME=Time.now
sendSock = UNIXSocket.open('/var/lib/clamav/clamd.socket')
#sendSock = UNIXSocket.open('/var/run/clamav/clamd.ctl')
sendSock.puts("STREAM")
retStr = sendSock.gets
tag, val = retStr.split
sendSock1 =  TCPSocket.open('localhost',"#{val}")
#res = $stdin.read
sendSock1.write($stdin.read)
sendSock1.close
retStr = sendSock.gets
pt = Time.now - START_TIME
#puts "#{retStr}"
#fp.write("#{res}\n")
fp.write("#{retStr}\n")
fp.write("ProcessTime = #{pt}\n")
fp.close
if retStr.match("FOUND") then
        system("zenity --warning --title=\"Evolution: Virus detected\"
--text=\"#{retStr}\" &")
    exit 1
else
    exit 0
end

[jose localhost ~]$ 

This is a copy/paste from the cli, i am starting to think that copying
instead of typing might be a problem, at least i've seen that in some
forum....

Thank you
JosÃ




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]