Sponsored Content
Operating Systems Solaris Clamd max file size Solaris 10 Post 303012521 by achenle on Monday 5th of February 2018 12:18:07 PM
Old 02-05-2018
Based on this post, I did some poking in the clamav source code.

I'm not impressed.

There are way too many instances of 64-to-32 bit truncations in the code - for example, read() is assumed to return int and not the correct ssize_t.

Running Solaris Studio 12.4 lint on just the C files in source tree's libclamav directory:

Code:
bash 4.1$ lint -errchk=%all -errhdr=%user -m64 -I.. -I../clamd -I../libclamav -I../win32 a*.c [c-z]*.c 2>&1 | grep "assignment of 64-bit integer" | wc -l
    398

The blob.c file causes lint to fail with an error, so I used a*.c [c-z]*.c to quickly exclude *.c files that start with b.

And there are 398 instances in just libclamav/*.c where a 64-bit value is truncated. There are also a lot of other problems, too.

It's no surprise at all that clamav has problems with files larger than 2 GB.

And that's just from using lint on the C files. I'd bet the results of compiling the C++ portions with Solaris Studio's C++ compiler and the "-m64 -xport64" command-line options are downright scary.

Last edited by achenle; 02-05-2018 at 01:25 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

setting max log file size...

Hello all! I have found a new home, this place is great! I have been searching for days to find a way to set a max size for a log.txt file using a cron job exicuting a shell script. Is it possible for a script to remove older entries in a log file to maintain a limited file size? If so,... (5 Replies)
Discussion started by: v-rod
5 Replies

2. Shell Programming and Scripting

Max size of variable

What is the maximum amount of characters that you can have in a varible name in the ksh shell? (1 Reply)
Discussion started by: lesstjm
1 Replies

3. UNIX for Dummies Questions & Answers

Max I/O Size

My HP-UX 11.0 system is supporting an Oracle database. I have found a number of references on the Net to the "Max I/O size" in relation to setting Oracle parameters. How can I tell what my max i/o size is? I originally made the assumption that it was referring to my stripe size but now I think... (1 Reply)
Discussion started by: keelba
1 Replies

4. Programming

Max file size can't exceed 2 GB

We have Sun OS 5.9 we are doing a backup process (ProC program) that uses the function... fprintf(fp,"%s;%s;%s;%s;%s;%ld;%ld;%ld;%ld;%s;%s;%s;%d;%s;%s;%s;%ld;%s;%s;%s;%ld;%ld;%s;%ld;%s;%ld;%s;%s;%c%c",x_contrno, x_subno, x_b_subno,x_transdate,x_last_traffic_date,BillAmt_s, x_billamount_int,... (10 Replies)
Discussion started by: atiato
10 Replies

5. UNIX for Advanced & Expert Users

How to determine the max file size

Does anyone know a way to determine the maximum filesize on a file system on Solaris, HP-UX, AIX, Linux, and OSF1 using the command line? TIA (2 Replies)
Discussion started by: dknight
2 Replies

6. Solaris

max. size of file

I wants to ask that what is the max size of file that we can create in the unix file system. (2 Replies)
Discussion started by: sameerghogre
2 Replies

7. UNIX for Advanced & Expert Users

Max. file size

i want to know what is the maximum file size supported by linux with ext3 file system. (1 Reply)
Discussion started by: nagalenoj
1 Replies

8. UNIX for Dummies Questions & Answers

MAX file size limited to 2GB

Hi All, We are running HP rp7400 box with hpux 11iv1. Recently, we changed 3 kernel parameters a) msgseg from 32560 to 32767 b) msgmnb from 65536 to 65535 c) msgssz from 128 to 256 Then we noticed that all application debug file size increase upto 2GB then it stops. So far we did not... (1 Reply)
Discussion started by: mhbd
1 Replies

9. UNIX for Dummies Questions & Answers

Restrict Max file size

Hello All, I am working on an issue, where I need to check the max file size of a file. If the file size exceeds 2 GB, then I need to generate an error message. Since the file system does not allow a file to be created larger than 2 GB, I am planning to use named pipes & AWK file to acheive my... (6 Replies)
Discussion started by: puru2121
6 Replies

10. Shell Programming and Scripting

Max size directory

Hi I know that a perticular direxctory is cosuming max space . Filesystem 1K-blocks Used Available Use% Mounted on nfsfi02:/vol/fivol2/Dir2/dir 104857600 92671400 12186200 89% /fs/dir I want to know which sub directory is consuming max... (4 Replies)
Discussion started by: ptappeta
4 Replies
Clam Daemon(8)							  Clam AntiVirus						    Clam Daemon(8)

NAME
clamd - an anti-virus daemon SYNOPSIS
clamd [options] DESCRIPTION
The daemon listens for incoming connections on Unix and/or TCP socket and scans files or directories on demand. It reads the configuration from /etc/clamd.conf COMMANDS
It's recommended to prefix clamd commands with the letter z (eg. zSCAN) to indicate that the command will be delimited by a NULL character and that clamd should continue reading command data until a NULL character is read. The null delimiter assures that the complete command and its entire argument will be processed as a single command. Alternatively commands may be prefixed with the letter n (e.g. nSCAN) to use a newline character as the delimiter. Clamd replies will honour the requested terminator in turn. If clamd doesn't recognize the command, or the command doesn't follow the requirements specified below, it will reply with an error message, and close the connection. Clamd recognizes the following commands: PING Check the server's state. It should reply with "PONG". VERSION Print program and database versions. RELOAD Reload the virus databases. SHUTDOWN Perform a clean exit. SCAN file/directory Scan a file or a directory (recursively) with archive support enabled (if not disabled in clamd.conf). A full path is required. CONTSCAN file/directory Scan file or directory (recursively) with archive support enabled and don't stop the scanning when a virus is found. MULTISCAN file/directory Scan file in a standard way or scan directory (recursively) using multiple threads (to make the scanning faster on SMP machines). INSTREAM It is mandatory to prefix this command with n or z. Scan a stream of data. The stream is sent to clamd in chunks, after INSTREAM, on the same socket on which the command was sent. This avoids the overhead of establishing new TCP connections and problems with NAT. The format of the chunk is: '<length><data>' where <length> is the size of the following data in bytes expressed as a 4 byte unsigned integer in network byte order and <data> is the actual chunk. Streaming is terminated by sending a zero-length chunk. Note: do not exceed StreamMaxLength as defined in clamd.conf, otherwise clamd will reply with INSTREAM size limit exceeded and close the connection. FILDES It is mandatory to newline terminate this command, or prefix with n or z. This command only works on UNIX domain sockets. Scan a file descriptor. After issuing a FILDES command a subsequent rfc2292/bsd4.4 style packet (with at least one dummy character) is sent to clamd carrying the file descriptor to be scanned inside the ancillary data. Alternatively the file descriptor may be sent in the same packet, including the extra character. STATS IIt is mandatory to newline terminate this command, or prefix with n or z, it is recommended to only use the z prefix. Replies with statistics about the scan queue, contents of scan queue, and memory usage. The exact reply format is subject to change in future releases. IDSESSION, END It is mandatory to prefix this command with n or z, and all commands inside IDSESSION must be prefixed. Start/end a clamd session. Within a session multiple SCAN, INSTREAM, FILDES, VERSION, STATS commands can be sent on the same socket without opening new connections. Replies from clamd will be in the form '<id>: <response>' where <id> is the request number (in ascii, starting from 1) and <response> is the usual clamd reply. The reply lines have same delimiter as the corresponding command had. Clamd will process the commands asynchronously, and reply as soon as it has finished processing. Clamd requires clients to read all the replies it sent, before sending more commands to prevent send() deadlocks. The recommended way to implement a client that uses IDSESSION is with non-blocking sockets, and a select()/poll() loop: whenever send would block, sleep in select/poll until either you can write more data, or read more replies. Note that using non-blocking sockets without the select/poll loop and alternating recv()/send() doesn't comply with clamd's requirements. If clamd detects that a client has deadlocked, it will close the connection. Note that clamd may close an IDSESSION connection too if you don't follow the protocol's requirements. VERSIONCOMMANDS It is mandatory to prefix this command with either n or z. It is recommended to use nVERSIONCOMMANDS. Print program and database versions, followed by "| COMMANDS:" and a space-delimited list of supported commands. Clamd <0.95 will recognize this as the VERSION command, and reply only with their version, without the commands list. This command can be used as an easy way to check for IDSESSION support for example. DEPRECATED COMMANDS STREAM Scan stream - on this command clamd will return "PORT number" you should connect to and send data to scan. (DEPRECATED, use INSTREAM instead) NOT SUPPORTED COMMANDS SESSION, END Start/end a clamd session which will allow you to run multiple commands per TCP session. (use IDSESSION instead) OPTIONS
-h, --help Output help information and exit. -V, --version Print the version number and exit. -c FILE, --config-file=FILE Read configuration from FILE. SIGNALS
Clamd recognizes the following signals: SIGHUP Reopen the logfile. SIGUSR2 Reload the signature databases. SIGTERM Perform a clean exit. FILES
/etc/clamd.conf CREDITS
Please check the full documentation for credits. AUTHOR
Tomasz Kojm <tkojm@clamav.net> SEE ALSO
clamd.conf(5), clamdscan(1), freshclam(1), freshclam.conf(5), clamav-milter(8) ClamAV 0.96.1 February 12, 2009 Clam Daemon(8)
All times are GMT -4. The time now is 09:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy