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

« back to all changes in this revision

Viewing changes to shared/cfgparser.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:
47
47
    {"DetectBrokenExecutables", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
48
48
    {"ScanMail", OPT_BOOL, 1, NULL, 0, OPT_CLAMD},
49
49
    {"MailFollowURLs", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
 
50
    {"ScanPartialMessages", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
50
51
    {"PhishingSignatures", OPT_BOOL, 1, NULL, 0, OPT_CLAMD},
51
52
    {"PhishingScanURLs",OPT_BOOL, 1, NULL, 0, OPT_CLAMD},
52
53
    /* these are FP prone options, if default isn't used */
53
54
    {"PhishingAlwaysBlockCloak", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
54
55
    {"PhishingAlwaysBlockSSLMismatch", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
55
 
    {"PhishingRestrictedScan", OPT_BOOL, 1, NULL, 0, OPT_CLAMD},
 
56
    {"HeuristicScanPrecedence", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
56
57
    /* end of FP prone options */
57
58
    {"DetectPUA", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
 
59
    {"ExcludePUA", OPT_QUOTESTR, -1, NULL, 1, OPT_CLAMD},
 
60
    {"IncludePUA", OPT_QUOTESTR, -1, NULL, 1, OPT_CLAMD},
 
61
    {"StructuredDataDetection", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
 
62
    {"StructuredMinCreditCardCount", OPT_NUM, 3, NULL, 0, OPT_CLAMD},
 
63
    {"StructuredMinSSNCount", OPT_NUM, 3, NULL, 0, OPT_CLAMD},
 
64
    {"StructuredSSNFormatNormal", OPT_BOOL, 1, NULL, 0, OPT_CLAMD},
 
65
    {"StructuredSSNFormatStripped", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
58
66
    {"AlgorithmicDetection", OPT_BOOL, 1, NULL, 0, OPT_CLAMD},
59
67
    {"ScanHTML", OPT_BOOL, 1, NULL, 0, OPT_CLAMD},
60
68
    {"ScanOLE2", OPT_BOOL, 1, NULL, 0, OPT_CLAMD},
78
86
    {"ReadTimeout", OPT_NUM, 120, NULL, 0, OPT_CLAMD},
79
87
    {"IdleTimeout", OPT_NUM, 30, NULL, 0, OPT_CLAMD},
80
88
    {"MaxDirectoryRecursion", OPT_NUM, 15, NULL, 0, OPT_CLAMD},
 
89
    {"ExcludePath", OPT_QUOTESTR, -1, NULL, 1, OPT_CLAMD},
81
90
    {"FollowDirectorySymlinks", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
82
91
    {"FollowFileSymlinks", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
83
92
    {"ExitOnOOM", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
286
295
                                }
287
296
                                ctype = tolower(arg[strlen(arg) - 1]);
288
297
                                if(ctype == 'm' || ctype == 'k') {
289
 
                                    char *cpy = (char *) calloc(strlen(arg), 1);
290
 
                                    strncpy(cpy, arg, strlen(arg) - 1);
291
 
                                    cpy[strlen(arg)-1]='\0';
 
298
                                    char *cpy = strdup(arg);
 
299
                                    if(!cpy) {
 
300
                                        fprintf(stderr, "ERROR: Can't register new options (not enough memory)\n");
 
301
                                        fclose(fs);
 
302
                                        free(name);
 
303
                                        freecfg(copt);
 
304
                                        return NULL;
 
305
                                    }
 
306
                                    cpy[strlen(arg) - 1] = '\0';
292
307
                                    if(!cli_isnumber(cpy)) {
293
308
                                        if(verbose)
294
309
                                            fprintf(stderr, "ERROR: Parse error at line %d: Option %s requires numerical (raw/K/M) argument.\n", line, name);