~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to docs/html/node49.html

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8
8
<HTML>
9
9
<HEAD>
10
 
<TITLE>Data scan functions</TITLE>
11
 
<META NAME="description" CONTENT="Data scan functions">
 
10
<TITLE>Limits</TITLE>
 
11
<META NAME="description" CONTENT="Limits">
12
12
<META NAME="keywords" CONTENT="clamdoc">
13
13
<META NAME="resource-type" CONTENT="document">
14
14
<META NAME="distribution" CONTENT="global">
20
20
 
21
21
<LINK REL="next" HREF="node50.html">
22
22
<LINK REL="previous" HREF="node48.html">
23
 
<LINK REL="up" HREF="node48.html">
 
23
<LINK REL="up" HREF="node43.html">
24
24
<LINK REL="next" HREF="node50.html">
25
25
</HEAD>
26
26
 
27
27
<BODY >
28
28
 
29
29
<DIV CLASS="navigation"><!--Navigation Panel-->
30
 
<A NAME="tex2html846"
 
30
<A NAME="tex2html857"
31
31
  HREF="node50.html">
32
32
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
33
 
<A NAME="tex2html842"
34
 
  HREF="node48.html">
 
33
<A NAME="tex2html853"
 
34
  HREF="node43.html">
35
35
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
36
 
<A NAME="tex2html836"
 
36
<A NAME="tex2html847"
37
37
  HREF="node48.html">
38
38
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
39
 
<A NAME="tex2html844"
 
39
<A NAME="tex2html855"
40
40
  HREF="node1.html">
41
41
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>  
42
42
<BR>
43
 
<B> Next:</B> <A NAME="tex2html847"
44
 
  HREF="node50.html">Memory</A>
45
 
<B> Up:</B> <A NAME="tex2html843"
46
 
  HREF="node48.html">Database reloading</A>
47
 
<B> Previous:</B> <A NAME="tex2html837"
48
 
  HREF="node48.html">Database reloading</A>
49
 
 &nbsp; <B>  <A NAME="tex2html845"
 
43
<B> Next:</B> <A NAME="tex2html858"
 
44
  HREF="node50.html">Database checks</A>
 
45
<B> Up:</B> <A NAME="tex2html854"
 
46
  HREF="node43.html">API</A>
 
47
<B> Previous:</B> <A NAME="tex2html848"
 
48
  HREF="node48.html">Engine structure</A>
 
49
 &nbsp; <B>  <A NAME="tex2html856"
50
50
  HREF="node1.html">Contents</A></B> 
51
51
<BR>
52
52
<BR></DIV>
53
53
<!--End of Navigation Panel-->
54
54
 
55
 
<H3><A NAME="SECTION00076100000000000000">
56
 
Data scan functions</A>
 
55
<H3><A NAME="SECTION00073600000000000000">
 
56
Limits</A>
57
57
</H3>
58
 
    It's possible to scan a file or descriptor using:
59
 
    <PRE>
60
 
        int cl_scanfile(const char *filename, const char **virname,
61
 
        unsigned long int *scanned, const struct cl_engine *engine,
62
 
        unsigned int options);
63
 
 
64
 
        int cl_scandesc(int desc, const char **virname, unsigned
65
 
        long int *scanned, const struct cl_engine *engine,
66
 
        unsigned int options);
67
 
</PRE>
68
 
    Both functions will store a virus name under the pointer <code>virname</code>,
69
 
    the virus name is part of the engine structure and must not be released
70
 
    directly. If the third argument (<code>scanned</code>) is not NULL, the
71
 
    functions will increase its value with the size of scanned data (in
72
 
    <code>CL_COUNT_PRECISION</code> units).
73
 
    The last argument (<code>options</code>) specified the scan options and supports
74
 
    the following flags (which can be combined using bit operators):
75
 
    
76
 
<UL>
77
 
<LI><SPAN  CLASS="textbf">CL_SCAN_STDOPT</SPAN>
78
 
<BR>
79
 
This is an alias for a recommended set of scan options. You
80
 
              should use it to make your software ready for new features
81
 
              in the future versions of libclamav.
82
 
</LI>
83
 
<LI><SPAN  CLASS="textbf">CL_SCAN_RAW</SPAN>
84
 
<BR>
85
 
Use it alone if you want to disable support for special files.
86
 
</LI>
87
 
<LI><SPAN  CLASS="textbf">CL_SCAN_ARCHIVE</SPAN>
88
 
<BR>
89
 
This flag enables transparent scanning of various archive formats.
90
 
</LI>
91
 
<LI><SPAN  CLASS="textbf">CL_SCAN_BLOCKENCRYPTED</SPAN>
92
 
<BR>
93
 
With this flag the library will mark encrypted archives as viruses
94
 
              (Encrypted.Zip, Encrypted.RAR).
95
 
</LI>
96
 
<LI><SPAN  CLASS="textbf">CL_SCAN_MAIL</SPAN>
97
 
<BR>
98
 
Enable support for mail files.
99
 
</LI>
100
 
<LI><SPAN  CLASS="textbf">CL_SCAN_MAILURL</SPAN>
101
 
<BR>
102
 
The mail scanner will download and scan URLs listed in a mail
103
 
              body. This flag should not be used on loaded servers. Due to
104
 
              potential problems please do not enable it by default but make
105
 
              it optional.
106
 
</LI>
107
 
<LI><SPAN  CLASS="textbf">CL_SCAN_OLE2</SPAN>
108
 
<BR>
109
 
Enables support for OLE2 containers (used by MS Office and .msi
110
 
              files).
111
 
</LI>
112
 
<LI><SPAN  CLASS="textbf">CL_SCAN_PDF</SPAN>
113
 
<BR>
114
 
Enables scanning within PDF files.
115
 
</LI>
116
 
<LI><SPAN  CLASS="textbf">CL_SCAN_PE</SPAN>
117
 
<BR>
118
 
This flag enables deep scanning of Portable Executable files and
119
 
              allows libclamav to unpack executables compressed with run-time
120
 
              unpackers.
121
 
</LI>
122
 
<LI><SPAN  CLASS="textbf">CL_SCAN_ELF</SPAN>
123
 
<BR>
124
 
Enable support for ELF files.
125
 
</LI>
126
 
<LI><SPAN  CLASS="textbf">CL_SCAN_BLOCKBROKEN</SPAN>
127
 
<BR>
128
 
libclamav will try to detect broken executables and mark them as
129
 
              Broken.Executable.
130
 
</LI>
131
 
<LI><SPAN  CLASS="textbf">CL_SCAN_HTML</SPAN>
132
 
<BR>
133
 
This flag enables HTML normalisation (including ScrEnc
134
 
              decryption).
135
 
</LI>
136
 
<LI><SPAN  CLASS="textbf">CL_SCAN_ALGORITHMIC</SPAN>
137
 
<BR>
138
 
Enable algorithmic detection of viruses.
139
 
</LI>
140
 
<LI><SPAN  CLASS="textbf">CL_SCAN_PHISHING_BLOCKSSL</SPAN>
141
 
<BR>
142
 
Phishing module: always block SSL mismatches in URLs.
143
 
</LI>
144
 
<LI><SPAN  CLASS="textbf">CL_SCAN_PHISHING_BLOCKCLOAK</SPAN>
145
 
<BR>
146
 
Phishing module: always block cloaked URLs.
147
 
</LI>
148
 
<LI><SPAN  CLASS="textbf">CL_SCAN_STRUCTURED</SPAN>
149
 
<BR>
150
 
Enable the DLP module which scans for credit card and SSN
151
 
              numbers.
152
 
</LI>
153
 
<LI><SPAN  CLASS="textbf">CL_SCAN_STRUCTURED_SSN_NORMAL</SPAN>
154
 
<BR>
155
 
Search for SSNs formatted as xx-yy-zzzz.
156
 
</LI>
157
 
<LI><SPAN  CLASS="textbf">CL_SCAN_STRUCTURED_SSN_STRIPPED</SPAN>
158
 
<BR>
159
 
Search for SSNs formatted as xxyyzzzz.
160
 
</LI>
161
 
<LI><SPAN  CLASS="textbf">CL_SCAN_PARTIAL_MESSAGE</SPAN>
162
 
<BR>
163
 
Scan RFC1341 messages split over many emails. You will need to
164
 
              periodically clean up <code>$TemporaryDirectory/clamav-partial</code>
165
 
              directory.
166
 
</LI>
167
 
<LI><SPAN  CLASS="textbf">CL_SCAN_HEURISTIC_PRECEDENCE</SPAN>
168
 
<BR>
169
 
Allow heuristic match to take precedence. When enabled, if
170
 
              a heuristic scan (such as phishingScan) detects a possible
171
 
              virus/phish it will stop scan immediately. Recommended, saves CPU
172
 
              scan-time. When disabled, virus/phish detected by heuristic scans
173
 
              will be reported only at the end of a scan. If an archive
174
 
              contains both a heuristically detected virus/phishing, and a real
175
 
              malware, the real malware will be reported.
176
 
    
177
 
</LI>
178
 
</UL>
179
 
    All functions return <code>CL_CLEAN</code> when the file seems clean,
180
 
    <code>CL_VIRUS</code> when a virus is detected and another value on failure.
181
 
    <PRE>
182
 
            ...
183
 
            const char *virname;
184
 
 
185
 
        if((ret = cl_scanfile("/tmp/test.exe", &amp;virname, NULL, engine,
186
 
        CL_STDOPT)) == CL_VIRUS) {
187
 
            printf("Virus detected: %s\n", virname);
188
 
        } else {
189
 
            printf("No virus detected.\n");
190
 
            if(ret != CL_CLEAN)
191
 
                printf("Error: %s\n", cl_strerror(ret));
192
 
        }
193
 
</PRE>
 
58
    When you create a new engine with <code>cl_engine_new()</code>, it will have
 
59
    all internal settings set to default values as recommended by the
 
60
    ClamAV authors. It's possible to check and modify the values (numerical
 
61
    and strings) using the following set of functions:
 
62
    <PRE>
 
63
int cl_engine_set_num(struct cl_engine *engine,
 
64
  enum cl_engine_field field, long long num);
 
65
 
 
66
long long cl_engine_get_num(const struct cl_engine *engine,
 
67
  enum cl_engine_field field, int *err);
 
68
 
 
69
int cl_engine_set_str(struct cl_engine *engine,
 
70
  enum cl_engine_field field, const char *str);
 
71
 
 
72
const char *cl_engine_get_str(const struct cl_engine *engine,
 
73
  enum cl_engine_field field, int *err);
 
74
</PRE>
 
75
    Please don't modify the default values unless you know what you're doing.
 
76
    Refer to the ClamAV sources (clamscan, clamd) for examples.
194
77
 
195
78
<P>
196
 
 
197
 
<DIV CLASS="navigation"><HR>
198
 
<!--Navigation Panel-->
199
 
<A NAME="tex2html846"
200
 
  HREF="node50.html">
201
 
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
202
 
<A NAME="tex2html842"
203
 
  HREF="node48.html">
204
 
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
205
 
<A NAME="tex2html836"
206
 
  HREF="node48.html">
207
 
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
208
 
<A NAME="tex2html844"
209
 
  HREF="node1.html">
210
 
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>  
211
 
<BR>
212
 
<B> Next:</B> <A NAME="tex2html847"
213
 
  HREF="node50.html">Memory</A>
214
 
<B> Up:</B> <A NAME="tex2html843"
215
 
  HREF="node48.html">Database reloading</A>
216
 
<B> Previous:</B> <A NAME="tex2html837"
217
 
  HREF="node48.html">Database reloading</A>
218
 
 &nbsp; <B>  <A NAME="tex2html845"
219
 
  HREF="node1.html">Contents</A></B> </DIV>
220
 
<!--End of Navigation Panel-->
 
79
<BR><HR>
221
80
<ADDRESS>
222
81
Tomasz Kojm
223
 
2009-10-28
 
82
2010-03-10
224
83
</ADDRESS>
225
84
</BODY>
226
85
</HTML>