~ubuntu-branches/ubuntu/jaunty/clamav/jaunty-backports

« back to all changes in this revision

Viewing changes to docs/html/node51.html

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (1.39.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 11.
  • 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>Forking daemons</TITLE>
11
 
<META NAME="description" CONTENT="Forking daemons">
 
10
<TITLE>Data scan functions</TITLE>
 
11
<META NAME="description" CONTENT="Data scan functions">
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="node52.html">
22
22
<LINK REL="previous" HREF="node50.html">
23
 
<LINK REL="up" HREF="node48.html">
 
23
<LINK REL="up" HREF="node43.html">
24
24
<LINK REL="next" HREF="node52.html">
25
25
</HEAD>
26
26
 
27
27
<BODY >
28
28
 
29
29
<DIV CLASS="navigation"><!--Navigation Panel-->
30
 
<A NAME="tex2html870"
 
30
<A NAME="tex2html881"
31
31
  HREF="node52.html">
32
32
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
33
 
<A NAME="tex2html866"
34
 
  HREF="node48.html">
 
33
<A NAME="tex2html877"
 
34
  HREF="node43.html">
35
35
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
36
 
<A NAME="tex2html860"
 
36
<A NAME="tex2html871"
37
37
  HREF="node50.html">
38
38
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
39
 
<A NAME="tex2html868"
 
39
<A NAME="tex2html879"
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="tex2html871"
44
 
  HREF="node52.html">clamav-config</A>
45
 
<B> Up:</B> <A NAME="tex2html867"
46
 
  HREF="node48.html">Database reloading</A>
47
 
<B> Previous:</B> <A NAME="tex2html861"
48
 
  HREF="node50.html">Memory</A>
49
 
 &nbsp; <B>  <A NAME="tex2html869"
 
43
<B> Next:</B> <A NAME="tex2html882"
 
44
  HREF="node52.html">Memory</A>
 
45
<B> Up:</B> <A NAME="tex2html878"
 
46
  HREF="node43.html">API</A>
 
47
<B> Previous:</B> <A NAME="tex2html872"
 
48
  HREF="node50.html">Database checks</A>
 
49
 &nbsp; <B>  <A NAME="tex2html880"
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="SECTION00076300000000000000">
56
 
Forking daemons</A>
 
55
<H3><A NAME="SECTION00073800000000000000">
 
56
Data scan functions</A>
57
57
</H3>
58
 
    If you're using libclamav with a forking daemon you should call
59
 
    <code>srand()</code> inside a forked child before making any calls to the
60
 
    libclamav functions. This will avoid possible collisions with temporary
61
 
    filenames created by other processes of the daemon. This procedure
62
 
    is not required for multi-threaded daemons.
 
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_OLE2</SPAN>
 
101
<BR>
 
102
Enables support for OLE2 containers (used by MS Office and .msi
 
103
              files).
 
104
</LI>
 
105
<LI><SPAN  CLASS="textbf">CL_SCAN_PDF</SPAN>
 
106
<BR>
 
107
Enables scanning within PDF files.
 
108
</LI>
 
109
<LI><SPAN  CLASS="textbf">CL_SCAN_PE</SPAN>
 
110
<BR>
 
111
This flag enables deep scanning of Portable Executable files and
 
112
              allows libclamav to unpack executables compressed with run-time
 
113
              unpackers.
 
114
</LI>
 
115
<LI><SPAN  CLASS="textbf">CL_SCAN_ELF</SPAN>
 
116
<BR>
 
117
Enable support for ELF files.
 
118
</LI>
 
119
<LI><SPAN  CLASS="textbf">CL_SCAN_BLOCKBROKEN</SPAN>
 
120
<BR>
 
121
libclamav will try to detect broken executables and mark them as
 
122
              Broken.Executable.
 
123
</LI>
 
124
<LI><SPAN  CLASS="textbf">CL_SCAN_HTML</SPAN>
 
125
<BR>
 
126
This flag enables HTML normalisation (including ScrEnc
 
127
              decryption).
 
128
</LI>
 
129
<LI><SPAN  CLASS="textbf">CL_SCAN_ALGORITHMIC</SPAN>
 
130
<BR>
 
131
Enable algorithmic detection of viruses.
 
132
</LI>
 
133
<LI><SPAN  CLASS="textbf">CL_SCAN_PHISHING_BLOCKSSL</SPAN>
 
134
<BR>
 
135
Phishing module: always block SSL mismatches in URLs.
 
136
</LI>
 
137
<LI><SPAN  CLASS="textbf">CL_SCAN_PHISHING_BLOCKCLOAK</SPAN>
 
138
<BR>
 
139
Phishing module: always block cloaked URLs.
 
140
</LI>
 
141
<LI><SPAN  CLASS="textbf">CL_SCAN_STRUCTURED</SPAN>
 
142
<BR>
 
143
Enable the DLP module which scans for credit card and SSN
 
144
              numbers.
 
145
</LI>
 
146
<LI><SPAN  CLASS="textbf">CL_SCAN_STRUCTURED_SSN_NORMAL</SPAN>
 
147
<BR>
 
148
Search for SSNs formatted as xx-yy-zzzz.
 
149
</LI>
 
150
<LI><SPAN  CLASS="textbf">CL_SCAN_STRUCTURED_SSN_STRIPPED</SPAN>
 
151
<BR>
 
152
Search for SSNs formatted as xxyyzzzz.
 
153
</LI>
 
154
<LI><SPAN  CLASS="textbf">CL_SCAN_PARTIAL_MESSAGE</SPAN>
 
155
<BR>
 
156
Scan RFC1341 messages split over many emails. You will need to
 
157
              periodically clean up <code>$TemporaryDirectory/clamav-partial</code>
 
158
              directory.
 
159
</LI>
 
160
<LI><SPAN  CLASS="textbf">CL_SCAN_HEURISTIC_PRECEDENCE</SPAN>
 
161
<BR>
 
162
Allow heuristic match to take precedence. When enabled, if
 
163
              a heuristic scan (such as phishingScan) detects a possible
 
164
              virus/phish it will stop scan immediately. Recommended, saves CPU
 
165
              scan-time. When disabled, virus/phish detected by heuristic scans
 
166
              will be reported only at the end of a scan. If an archive
 
167
              contains both a heuristically detected virus/phishing, and a real
 
168
              malware, the real malware will be reported.
 
169
    
 
170
</LI>
 
171
</UL>
 
172
    All functions return <code>CL_CLEAN</code> when the file seems clean,
 
173
    <code>CL_VIRUS</code> when a virus is detected and another value on failure.
 
174
    <PRE>
 
175
            ...
 
176
            const char *virname;
 
177
 
 
178
        if((ret = cl_scanfile("/tmp/test.exe", &amp;virname, NULL, engine,
 
179
        CL_STDOPT)) == CL_VIRUS) {
 
180
            printf("Virus detected: %s\n", virname);
 
181
        } else {
 
182
            printf("No virus detected.\n");
 
183
            if(ret != CL_CLEAN)
 
184
                printf("Error: %s\n", cl_strerror(ret));
 
185
        }
 
186
</PRE>
63
187
 
64
188
<P>
65
 
<BR><HR>
 
189
 
 
190
<DIV CLASS="navigation"><HR>
 
191
<!--Navigation Panel-->
 
192
<A NAME="tex2html881"
 
193
  HREF="node52.html">
 
194
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
 
195
<A NAME="tex2html877"
 
196
  HREF="node43.html">
 
197
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
 
198
<A NAME="tex2html871"
 
199
  HREF="node50.html">
 
200
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
 
201
<A NAME="tex2html879"
 
202
  HREF="node1.html">
 
203
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>  
 
204
<BR>
 
205
<B> Next:</B> <A NAME="tex2html882"
 
206
  HREF="node52.html">Memory</A>
 
207
<B> Up:</B> <A NAME="tex2html878"
 
208
  HREF="node43.html">API</A>
 
209
<B> Previous:</B> <A NAME="tex2html872"
 
210
  HREF="node50.html">Database checks</A>
 
211
 &nbsp; <B>  <A NAME="tex2html880"
 
212
  HREF="node1.html">Contents</A></B> </DIV>
 
213
<!--End of Navigation Panel-->
66
214
<ADDRESS>
67
215
Tomasz Kojm
68
 
2009-10-28
 
216
2010-03-10
69
217
</ADDRESS>
70
218
</BODY>
71
219
</HTML>