~ubuntu-branches/ubuntu/dapper/clamav/dapper-updates

« back to all changes in this revision

Viewing changes to libclamav/unzip.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Tautschnig, Michael Tautschnig
  • Date: 2009-11-02 10:24:35 UTC
  • mfrom: (0.11.5 squeeze)
  • mto: (12.1.9 dapper-security)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20091102102435-yzkn3jdvo4gank3q
Tags: 0.95.3+dfsg-1
[ Michael Tautschnig ]
* New upstream version
* Should fix clamd segfault on startup (closes: #537629)
* Updated info in clamd.conf man page (closes: #534443)
* Proper socket ownership setup, no chgrp in make_dir (closes: #553333)

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
    }
107
107
    if(res==1) {
108
108
      if(ctx->engine->maxfilesize && csize > ctx->engine->maxfilesize) {
109
 
        cli_dbgmsg("cli_unzip: trimming output size to maxfilesize (%lu)\n", ctx->engine->maxfilesize);
 
109
        cli_dbgmsg("cli_unzip: trimming output size to maxfilesize (%lu)\n", (long unsigned int) ctx->engine->maxfilesize);
110
110
        csize = ctx->engine->maxfilesize;
111
111
      }
112
112
      if(cli_writen(of, src, csize)!=(int)csize) ret = CL_EWRITE;
167
167
      if(*avail_out!=sizeof(obuf)) {
168
168
        written+=sizeof(obuf)-(*avail_out);
169
169
        if(ctx->engine->maxfilesize && written > ctx->engine->maxfilesize) {
170
 
          cli_dbgmsg("cli_unzip: trimming output size to maxfilesize (%lu)\n", ctx->engine->maxfilesize);
 
170
          cli_dbgmsg("cli_unzip: trimming output size to maxfilesize (%lu)\n", (long unsigned int) ctx->engine->maxfilesize);
171
171
          res = Z_STREAM_END;
172
172
          break;
173
173
        }
211
211
      if(strm.avail_out!=sizeof(obuf)) {
212
212
        written+=sizeof(obuf)-strm.avail_out;
213
213
        if(ctx->engine->maxfilesize && written > ctx->engine->maxfilesize) {
214
 
          cli_dbgmsg("cli_unzip: trimming output size to maxfilesize (%lu)\n", ctx->engine->maxfilesize);
 
214
          cli_dbgmsg("cli_unzip: trimming output size to maxfilesize (%lu)\n", (unsigned long int) ctx->engine->maxfilesize);
215
215
          res = BZ_STREAM_END;
216
216
          break;
217
217
        }
248
248
      if(strm.avail_out!=sizeof(obuf)) {
249
249
        written+=sizeof(obuf)-strm.avail_out;
250
250
        if(ctx->engine->maxfilesize && written > ctx->engine->maxfilesize) {
251
 
          cli_dbgmsg("cli_unzip: trimming output size to maxfilesize (%lu)\n", ctx->engine->maxfilesize);
 
251
          cli_dbgmsg("cli_unzip: trimming output size to maxfilesize (%lu)\n", (unsigned long int) ctx->engine->maxfilesize);
252
252
          res = 0;
253
253
          break;
254
254
        }
379
379
    return 0;
380
380
  }
381
381
 
 
382
  if((LH_flags & F_ENCR) && DETECT_ENCRYPTED) {
 
383
    cli_dbgmsg("cli_unzip: Encrypted files found in archive.\n");
 
384
    *ctx->virname = "Encrypted.Zip";
 
385
    *ret = CL_VIRUS;
 
386
    return 0;
 
387
  }
 
388
 
382
389
  if(LH_flags & F_USEDD) {
383
390
    cli_dbgmsg("cli_unzip: lh - has data desc\n");
384
391
    if(!ch) return 0;
400
407
      return 0;
401
408
    } 
402
409
    if(LH_flags & F_ENCR) {
403
 
      if(DETECT_ENCRYPTED) {
404
 
        cli_dbgmsg("cli_unzip: Encrypted files found in archive.\n");
405
 
        *ctx->virname = "Encrypted.Zip";
406
 
        *ret = CL_VIRUS;
407
 
        return 0;
408
 
      }
409
410
      cli_dbgmsg("cli_unzip: lh - skipping encrypted file\n");
410
411
    } else *ret = unz(zip, csize, usize, LH_method, LH_flags, fu, ctx, tmpd);
411
412
    zip+=csize;