~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to docs/html/node41.html

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2008-09-05 17:25:34 UTC
  • mfrom: (0.35.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080905172534-yi3f8fkye1o7u1r3
* New upstream version (closes: #497662, #497773)
  - lots of new options for clamd.conf
  - fixes CVEs CVE-2008-3912, CVE-2008-3913, CVE-2008-3914, and
    CVE-2008-1389
* No longer supports --unzip option, so typo is gone (closes: #496276)
* Translations:
  - sv (thanks Martin Bagge <brother@bsnet.se>) (closes: #491760)

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>Engine structure</TITLE>
11
 
<META NAME="description" CONTENT="Engine structure">
 
10
<TITLE>Database loading</TITLE>
 
11
<META NAME="description" CONTENT="Database loading">
12
12
<META NAME="keywords" CONTENT="clamdoc">
13
13
<META NAME="resource-type" CONTENT="document">
14
14
<META NAME="distribution" CONTENT="global">
18
18
 
19
19
<LINK REL="STYLESHEET" HREF="clamdoc.css">
20
20
 
 
21
<LINK REL="next" HREF="node42.html">
21
22
<LINK REL="previous" HREF="node40.html">
22
 
<LINK REL="up" HREF="node37.html">
 
23
<LINK REL="up" HREF="node39.html">
23
24
<LINK REL="next" HREF="node42.html">
24
25
</HEAD>
25
26
 
26
27
<BODY >
27
28
 
28
29
<DIV CLASS="navigation"><!--Navigation Panel-->
29
 
<A NAME="tex2html724"
 
30
<A NAME="tex2html737"
30
31
  HREF="node42.html">
31
32
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
32
 
<A NAME="tex2html720"
33
 
  HREF="node37.html">
 
33
<A NAME="tex2html733"
 
34
  HREF="node39.html">
34
35
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
35
 
<A NAME="tex2html716"
 
36
<A NAME="tex2html727"
36
37
  HREF="node40.html">
37
38
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
38
 
<A NAME="tex2html722"
 
39
<A NAME="tex2html735"
39
40
  HREF="node1.html">
40
41
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>  
41
42
<BR>
42
 
<B> Next:</B> <A NAME="tex2html725"
43
 
  HREF="node42.html">Database reloading</A>
44
 
<B> Up:</B> <A NAME="tex2html721"
45
 
  HREF="node37.html">API</A>
46
 
<B> Previous:</B> <A NAME="tex2html717"
47
 
  HREF="node40.html">Error handling</A>
48
 
 &nbsp; <B>  <A NAME="tex2html723"
 
43
<B> Next:</B> <A NAME="tex2html738"
 
44
  HREF="node42.html">Error handling</A>
 
45
<B> Up:</B> <A NAME="tex2html734"
 
46
  HREF="node39.html">API</A>
 
47
<B> Previous:</B> <A NAME="tex2html728"
 
48
  HREF="node40.html">Header file</A>
 
49
 &nbsp; <B>  <A NAME="tex2html736"
49
50
  HREF="node1.html">Contents</A></B> 
50
51
<BR>
51
52
<BR></DIV>
52
53
<!--End of Navigation Panel-->
53
54
 
54
 
<H3><A NAME="SECTION00073400000000000000">
55
 
Engine structure</A>
 
55
<H3><A NAME="SECTION00073200000000000000">
 
56
Database loading</A>
56
57
</H3>
57
 
    When all required databases are loaded you should prepare the detection
58
 
    engine by calling <code>cl_build</code>. In the case of failure you should
59
 
    free the memory occupied by the engine with <code>cl_free</code>:
 
58
    The following set of functions provides an interface for loading
 
59
    the virus database:
60
60
    <PRE>
61
 
        int cl_build(struct cl_engine *engine);
62
 
        void cl_free(struct cl_engine *engine);
 
61
        const char *cl_retdbdir(void);
 
62
 
 
63
        int cl_load(const char *path, struct cl_engine **engine,
 
64
                    unsigned int *signo, unsigned int options);
63
65
</PRE>
64
 
    In our example:
 
66
    <code>cl_retdbdir</code> returns the default (hardcoded) path to the directory
 
67
    with ClamAV databases.
 
68
    <code>cl_load</code> loads a single database file or all databases from a
 
69
    directory (if <code>path</code> points to a directory). The second argument
 
70
    is used for passing in the engine structure which should be previously
 
71
    initialized with NULL. A number of loaded signatures will be <SPAN  CLASS="textbf">added</SPAN>
 
72
    to <code>signo</code> <A NAME="tex2html20"
 
73
  HREF="footnode.html#foot313"><SUP><SPAN CLASS="arabic">8</SPAN></SUP></A>. The last argument can pass the following flags:
 
74
    
 
75
<UL>
 
76
<LI><SPAN  CLASS="textbf">CL_DB_STDOPT</SPAN>
 
77
<BR>
 
78
This is an alias for a recommended set of scan options.
 
79
</LI>
 
80
<LI><SPAN  CLASS="textbf">CL_DB_PHISHING</SPAN>
 
81
<BR>
 
82
Load phishing signatures.
 
83
</LI>
 
84
<LI><SPAN  CLASS="textbf">CL_DB_PHISHING_URLS</SPAN>
 
85
<BR>
 
86
Initialize the phishing detection module and load .wdb and .pdb files.
 
87
</LI>
 
88
<LI><SPAN  CLASS="textbf">CL_DB_PUA</SPAN>
 
89
<BR>
 
90
Load signatures for Potentially Unwanted Applications.
 
91
</LI>
 
92
<LI><SPAN  CLASS="textbf">CL_DB_CVDNOTMP</SPAN>
 
93
<BR>
 
94
Load CVD files directly without unpacking them into a temporary
 
95
        directory.
 
96
    
 
97
</LI>
 
98
</UL>
 
99
    <code>cl_load</code> returns 0 (<code>CL_SUCCESS</code>) on success and a negative
 
100
    value on failure.
65
101
    <PRE>
66
 
        if((ret = cl_build(engine))) {
67
 
            printf("cl_build() error: %s\n", cl_strerror(ret));
68
 
            cl_free(engine);
69
 
            exit(1);
70
 
        }
 
102
            ...
 
103
            struct cl_engine *engine = NULL;
 
104
            unsigned int sigs = 0;
 
105
            int ret;
 
106
 
 
107
        ret = cl_load(cl_retdbdir(), &amp;engine, &amp;sigs, CL_DB_STDOPT);
71
108
</PRE>
72
109
 
73
110
<P>
74
111
<BR><HR>
75
112
<ADDRESS>
76
113
Tomasz Kojm
77
 
2008-07-07
 
114
2008-09-01
78
115
</ADDRESS>
79
116
</BODY>
80
117
</HTML>