Mailing List Archive

Socket closed after command
Hi,

I have implemented an application using Clamd Service connection, it was
working fine for a while.
I have used the IDSESSION command and then nSCAN ... \n command.
Everything runs good and as expected.

The problem now is I need to use different scanning types for different
scenarios.I need to send commands that scan archives (CONTSCAN) and the
usual nSCAN command based on clamd.conf settings.

I have set 'disabled' into clamd.conf for archive scanning, which means I
need to send CONTSCAN if I want to scan archives.
I cannot send CONTSCAN command using IDSESSION.
After scanning the file using CONTSCAN command clamd closes the socket. The
same happens for any command not using IDSESSION.

Why does clamd closes the socket?
Is there another way to do that?
Changing clamd.conf is not a solution, I need both options available
(archives scanning and not archives scanning).

Thank you!

Jorge
Re: Socket closed after command [ In reply to ]
Hi there,

On Sat, 26 Nov 2022, Jorge Elissalde via clamav-users wrote:

> ... I cannot send CONTSCAN command using IDSESSION. After scanning
> the file using CONTSCAN command clamd closes the socket. The same
> happens for any command not using IDSESSION.

That's correct.

> Why does clamd closes the socket?

It's tidier than leaving it open and doing nothing with it. I don't
remember anyone asking this question before. AFAIK it's always been
this way.

> Is there another way to do that?

I'm not sure that I understand the question. Is it a problem to open
a connection to clamd?

> Changing clamd.conf is not a solution, I need both options available
> (archives scanning and not archives scanning).

Sometimes I run several copies of clamd, all using different configs
and of course listening to different sockets. Might that be an option
for you?

--

73,
Ged.
_______________________________________________

Manage your clamav-users mailing list subscription / unsubscribe:
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/Cisco-Talos/clamav-documentation

https://docs.clamav.net/#mailing-lists-and-chat
Re: Socket closed after command [ In reply to ]
Hi,

I need to send individual files to scan, because I check them before
sending to clamd -CONSTSCAN [folder] is not an option-.
With that scheme, I need a session communication opened to clamd.
I also need the CONTSCAN command, which I cannot send in a session.
If I use CONTSCAN the connection will be closed after scanning every single
file.
If I use a pool of socket connections to clamd and I scan 500 files, 500
connections will be opened and closed.

Again my question: why does clamd closes the socket?

Thank you

Jorge


El sáb, 26 nov 2022 a las 20:27, G.W. Haywood via clamav-users (<
clamav-users@lists.clamav.net>) escribió:

> Hi there,
>
> On Sat, 26 Nov 2022, Jorge Elissalde via clamav-users wrote:
>
> > ... I cannot send CONTSCAN command using IDSESSION. After scanning
> > the file using CONTSCAN command clamd closes the socket. The same
> > happens for any command not using IDSESSION.
>
> That's correct.
>
> > Why does clamd closes the socket?
>
> It's tidier than leaving it open and doing nothing with it. I don't
> remember anyone asking this question before. AFAIK it's always been
> this way.
>
> > Is there another way to do that?
>
> I'm not sure that I understand the question. Is it a problem to open
> a connection to clamd?
>
> > Changing clamd.conf is not a solution, I need both options available
> > (archives scanning and not archives scanning).
>
> Sometimes I run several copies of clamd, all using different configs
> and of course listening to different sockets. Might that be an option
> for you?
>
> --
>
> 73,
> Ged.
> _______________________________________________
>
> Manage your clamav-users mailing list subscription / unsubscribe:
> https://lists.clamav.net/mailman/listinfo/clamav-users
>
>
> Help us build a comprehensive ClamAV guide:
> https://github.com/Cisco-Talos/clamav-documentation
>
> https://docs.clamav.net/#mailing-lists-and-chat
>