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

« back to all changes in this revision

Viewing changes to libclamav/autoit.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:
41
41
 
42
42
#include "others.h"
43
43
#include "scanners.h"
 
44
#include "autoit.h"
44
45
 
45
46
 
46
47
/* FIXME: use unicode detection and normalization from edwin */
349
350
 
350
351
    files++;
351
352
 
352
 
    /* FIXME: TODO send to text notmalization */
353
 
 
354
 
    /* FIXME: ad-interim solution. ideally we should detect text and turn it to ascii */
355
 
    UNP.usize = u2a(UNP.outputbuf, UNP.usize);
 
353
    /* FIXME: REGRESSION NEEDED! */
 
354
    /* UNP.usize = u2a(UNP.outputbuf, UNP.usize); */
356
355
 
357
356
    snprintf(tempfile, 1023, "%s/autoit.%.3u", tmpd, files);
358
357
    tempfile[1023]='\0';
372
371
      cli_dbgmsg("autoit: file extracted to %s\n", tempfile);
373
372
    else 
374
373
      cli_dbgmsg("autoit: file successfully extracted\n");
375
 
    fsync(i);
376
374
    lseek(i, 0, SEEK_SET);
377
375
    if(cli_magic_scandesc(i, ctx) == CL_VIRUS) {
378
376
      close(i);
379
 
      if(!cli_leavetemps_flag) unlink(tempfile);
 
377
      if(!cli_leavetemps_flag)
 
378
        if(cli_unlink(tempfile)) return CL_EIO;
380
379
      return CL_VIRUS;
381
380
    }
382
381
    close(i);
383
 
    if(!cli_leavetemps_flag) unlink(tempfile);
 
382
    if(!cli_leavetemps_flag) 
 
383
      if (cli_unlink(tempfile)) return CL_EIO;
384
384
  }
385
385
  return ret;
386
386
}
881
881
      cli_dbgmsg("autoit: %s extracted to %s\n", (script)?"script":"file", tempfile);
882
882
    else 
883
883
      cli_dbgmsg("autoit: %s successfully extracted\n", (script)?"script":"file");
884
 
    fsync(i);
885
884
    lseek(i, 0, SEEK_SET);
886
885
    if(cli_magic_scandesc(i, ctx) == CL_VIRUS) {
887
886
      close(i);
888
 
      if(!cli_leavetemps_flag) unlink(tempfile);
 
887
      if(!cli_leavetemps_flag) 
 
888
        if (cli_unlink(tempfile)) return CL_EIO;
889
889
      return CL_VIRUS;
890
890
    }
891
891
    close(i);
892
 
    if(!cli_leavetemps_flag) unlink(tempfile);
 
892
    if(!cli_leavetemps_flag)
 
893
      if (cli_unlink(tempfile)) return CL_EIO;
893
894
  }
894
895
  return ret;
895
896
}