~ubuntu-branches/ubuntu/saucy/clamav/saucy

« back to all changes in this revision

Viewing changes to clamscan/manager.c

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2013-03-19 06:38:51 UTC
  • mfrom: (0.35.34 sid)
  • Revision ID: package-import@ubuntu.com-20130319063851-bbuk8h4jrzh09u1r
Tags: 0.97.7+dfsg-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - Drop build-dep on electric-fence (in Universe)
  - Add apparmor profiles for clamd and freshclam along with maintainer
    script changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
        int ret = 0, fd, included, printclean = 1;
126
126
        const struct optstruct *opt;
127
127
        const char *virname;
 
128
        const char **virpp = &virname; 
128
129
        struct stat sb;
129
130
 
130
131
    if((opt = optget(opts, "exclude"))->enabled) {
190
191
    }
191
192
 
192
193
    if((ret = cl_scandesc(fd, &virname, &info.blocks, engine, options)) == CL_VIRUS) {
193
 
        logg("~%s: %s FOUND\n", filename, virname);
 
194
        if (options & CL_SCAN_ALLMATCHES) {                                                                               
 
195
            int i = 0;
 
196
            virpp = (const char **)*virpp; /* temp hack for allscan until API enhancement */
 
197
            virname = virpp[0];
 
198
            while (virpp[i])
 
199
                logg("~%s: %s FOUND\n", filename, virpp[i++]);
 
200
            free((void *)virpp);
 
201
        }
 
202
        else
 
203
            logg("~%s: %s FOUND\n", filename, virname);
194
204
        info.files++;
195
205
        info.ifiles++;
196
206
 
319
329
        int ret;
320
330
        unsigned int fsize = 0;
321
331
        const char *virname, *tmpdir;
 
332
        const char **virpp = &virname;
 
333
 
322
334
        char *file, buff[FILEBUFF];
323
335
        size_t bread;
324
336
        FILE *fs;
358
370
    info.rblocks += fsize / CL_COUNT_PRECISION;
359
371
 
360
372
    if((ret = cl_scanfile(file, &virname, &info.blocks, engine, options)) == CL_VIRUS) {
361
 
        logg("stdin: %s FOUND\n", virname);
 
373
        if (options & CL_SCAN_ALLMATCHES) {
 
374
            int i = 0;
 
375
            virpp = (const char **)*virpp; /* temp hack for scanall mode until api augmentation */
 
376
            virname = virpp[0];
 
377
            while (virpp[i])
 
378
                logg("stdin: %s FOUND\n", virpp[i++]);
 
379
            free((void *)virpp);
 
380
        }
 
381
        else
 
382
            logg("stdin: %s FOUND\n", virname);
 
383
 
362
384
        info.ifiles++;
363
385
 
364
386
        if(bell)
587
609
    }
588
610
 
589
611
    /* set scan options */
 
612
    if(optget(opts, "allmatch")->enabled)
 
613
        options |= CL_SCAN_ALLMATCHES;
 
614
 
590
615
    if(optget(opts,"phishing-ssl")->enabled)
591
616
        options |= CL_SCAN_PHISHING_BLOCKSSL;
592
617