~yolanda.robla/ubuntu/saucy/clamav/dep-8-tests

« back to all changes in this revision

Viewing changes to clamscan/clamscan.c

  • 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:
23
23
#include <stdio.h>
24
24
#include <stdlib.h>
25
25
#include <string.h>
 
26
#include <signal.h>
 
27
 
26
28
#ifdef  HAVE_UNISTD_H
27
29
#include <unistd.h>
28
30
#endif
40
42
#include "others.h"
41
43
#include "global.h"
42
44
#include "manager.h"
43
 
#include "treewalk.h"
44
45
 
45
46
#include "shared/misc.h"
46
47
#include "shared/output.h"
47
48
#include "shared/options.h"
48
49
 
49
50
#include "libclamav/str.h"
 
51
#include "libclamav/clamav.h"
50
52
 
51
53
void help(void);
52
54
 
64
66
        struct timeval t1, t2;
65
67
#ifndef C_WINDOWS
66
68
        struct timezone tz;
 
69
        sigset_t sigset;
67
70
#endif
68
71
        struct optstruct *opt;
69
72
        const char *pt;
75
78
    }
76
79
#endif
77
80
 
 
81
#if !defined(C_WINDOWS) && !defined(C_BEOS)
 
82
    sigemptyset(&sigset);
 
83
    sigaddset(&sigset, SIGXFSZ);
 
84
    sigprocmask(SIG_SETMASK, &sigset, NULL);
 
85
#endif
 
86
 
78
87
    opt = opt_parse(argc, argv, clamscan_shortopt, clamscan_longopt, NULL);
79
88
    if(!opt) {
80
89
        mprintf("!Can't parse the command line\n");
237
246
        dms += (dms < 0) ? (1000000):(0);
238
247
        logg("\n----------- SCAN SUMMARY -----------\n");
239
248
        logg("Known viruses: %u\n", info.sigs);
240
 
        logg("Engine version: %s\n", cl_retver());
 
249
        logg("Engine version: %s\n", get_version());
241
250
        logg("Scanned directories: %u\n", info.dirs);
242
251
        logg("Scanned files: %u\n", info.files);
243
252
        logg("Infected files: %u\n", info.ifiles);
270
279
    mprintf_stdout = 1;
271
280
 
272
281
    mprintf("\n");
273
 
    mprintf("                       Clam AntiVirus Scanner "VERSION"\n");
 
282
    mprintf("                       Clam AntiVirus Scanner %s\n", get_version());
274
283
    mprintf("      (C) 2002 - 2007 ClamAV Team - http://www.clamav.net/team\n\n");
275
284
 
276
285
    mprintf("    --help                -h             Print this help screen\n");
306
315
#endif
307
316
    mprintf("\n");
308
317
    mprintf("    --detect-pua                         Detect Possibly Unwanted Applications\n");
 
318
    mprintf("    --exclude-pua=CAT                    Skip PUA sigs of category CAT\n");
 
319
    mprintf("    --include-pua=CAT                    Load PUA sigs of category CAT\n");
 
320
    mprintf("    --detect-structured                  Detect structured data (SSN, Credit Card)\n");
 
321
    mprintf("    --structured-ssn-format=X            SSN format (0=normal,1=stripped,2=both)\n");
 
322
    mprintf("    --structured-ssn-count=N             Min SSN count to generate a detect\n");
 
323
    mprintf("    --structured-cc-count=N              Min CC count to generate a detect\n");
309
324
    mprintf("    --no-mail                            Disable mail file support\n");
310
325
    mprintf("    --no-phishing-sigs                   Disable signature-based phishing detection\n");
311
326
    mprintf("    --no-phishing-scan-urls              Disable url-based phishing detection\n");
312
 
    mprintf("    --no-phishing-restrictedscan         Enable phishing detection for all domains (might lead to false positives!)\n");
 
327
    mprintf("    --heuristic-scan-precedence          Stop scanning as soon as a heuristic match is found\n");
313
328
    mprintf("    --phishing-ssl                       Always block SSL mismatches in URLs (phishing module)\n");
314
329
    mprintf("    --phishing-cloak                     Always block cloaked URLs (phishing module)\n");
315
330
    mprintf("    --no-algorithmic                     Disable algorithmic detection\n");
318
333
    mprintf("    --no-ole2                            Disable OLE2 support\n");
319
334
    mprintf("    --no-pdf                             Disable PDF support\n");
320
335
    mprintf("    --no-html                            Disable HTML support\n");
321
 
    mprintf("    --no-archive                         Disable libclamav archive support\n");
 
336
    mprintf("    --no-archive                         Disable archive support\n");
322
337
    mprintf("    --detect-broken                      Try to detect broken executable files\n");
323
338
    mprintf("    --block-encrypted                    Block encrypted archives\n");
324
339
    mprintf("    --mail-follow-urls                   Download and scan URLs\n");
328
343
    mprintf("    --max-files=#n                       The maximum number of files to scan for each container file (*)\n");
329
344
    mprintf("    --max-recursion=#n                   Maximum archive recursion level for container file (*)\n");
330
345
    mprintf("    --max-dir-recursion=#n               Maximum directory recursion level\n");
331
 
    mprintf("    --unzip[=FULLPATH]                   Enable support for .zip files\n");
332
 
    mprintf("    --unrar[=FULLPATH]                   Enable support for .rar files\n");
333
 
    mprintf("    --arj[=FULLPATH]                     Enable support for .arj files\n");
334
 
    mprintf("    --unzoo[=FULLPATH]                   Enable support for .zoo files\n");
335
 
    mprintf("    --lha[=FULLPATH]                     Enable support for .lha files\n");
336
 
    mprintf("    --jar[=FULLPATH]                     Enable support for .jar files\n");
337
 
    mprintf("    --tar[=FULLPATH]                     Enable support for .tar files\n");
338
 
    mprintf("    --deb[=FULLPATH to ar]               Enable support for .deb files\n");
339
 
    mprintf("    --tgz[=FULLPATH]                     Enable support for .tar.gz, .tgz files\n\n");
340
 
    mprintf("(*) Certain files (e.g. documents, archives, etc.) may in turn contain other files inside.\n");
341
 
    mprintf("    The above options ensure safe processing of this kind of data.\n\n");
 
346
 
 
347
    mprintf("\n");
 
348
    mprintf("(*) Certain files (e.g. documents, archives, etc.) may in turn contain other\n");
 
349
    mprintf("    files inside. The above options ensure safe processing of this kind of data.\n\n");
342
350
}