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

« back to all changes in this revision

Viewing changes to sigtool/sigtool.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2009-11-02 23:27:19 UTC
  • mfrom: (0.35.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091102232719-61ay35095dhbuxfm
Tags: 0.95.3+dfsg-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop build-dep on electric-fence (in Universe)
  - Build-dep on libltdl3-dev instead of libltdl-dev for updating earlier
    releases more easily
  - Add apparmor profiles for clamd and freshclam along with maintainer
    script changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
    newname = malloc(strlen(fname) + 7);
212
212
    if(!newname) {
213
213
        mprintf("!utf16decode: Can't allocate memory\n");
 
214
        close(fd1);
214
215
        return -1;
215
216
    }
216
217
    sprintf(newname, "%s.ascii", fname);
1052
1053
    /* check for CVD file */
1053
1054
    if(!fgets(buffer, 12, fh)) {
1054
1055
        mprintf("!listdb: fgets failed\n");
 
1056
        free(buffer);
1055
1057
        fclose(fh);
1056
1058
        return -1;
1057
1059
    }
1338
1340
        long opos;
1339
1341
 
1340
1342
 
1341
 
    if(!(new = fopen(newpath, "r"))) {
1342
 
        mprintf("!compare: Can't open file %s for reading\n", newpath);
1343
 
        return -1;
1344
 
    }
1345
 
 
1346
1343
    if((omd5 = cli_md5file(oldpath))) {
1347
1344
        if(!(nmd5 = cli_md5file(newpath))) {
1348
1345
            mprintf("!compare: Can't get MD5 checksum of %s\n", newpath);
1360
1357
 
1361
1358
    fprintf(diff, "OPEN %s\n", newpath);
1362
1359
 
 
1360
    if(!(new = fopen(newpath, "r"))) {
 
1361
        mprintf("!compare: Can't open file %s for reading\n", newpath);
 
1362
        return -1;
 
1363
    }
1363
1364
    old = fopen(oldpath, "r");
1364
1365
 
1365
1366
    while(fgets(nbuff, sizeof(nbuff), new)) {
1368
1369
            mprintf("!compare: New %s file contains lines terminated with CRLF or CR\n", newpath);
1369
1370
            if(old)
1370
1371
                fclose(old);
 
1372
            fclose(new);
1371
1373
            return -1;
1372
1374
        }
1373
1375
        cli_chomp(nbuff);
1428
1430
           mprintf("!compare: COMPATIBILITY_LIMIT: Found too long line in new %s\n", newpath);
1429
1431
           if(old)
1430
1432
               fclose(old);
 
1433
           fclose(new);
1431
1434
           return -1;
1432
1435
       }
1433
1436
#endif
1434
1437
    }
 
1438
    fclose(new);
1435
1439
 
1436
1440
    if(old) {
1437
1441
        while(fgets(obuff, sizeof(obuff), old)) {
1536
1540
        }
1537
1541
    }
1538
1542
 
 
1543
    if(!getcwd(cwd, sizeof(cwd))) {
 
1544
        mprintf("!verifydiff: getcwd() failed\n");
 
1545
        cli_rmdirs(tempdir);
 
1546
        free(tempdir);
 
1547
        return -1;
 
1548
    }
 
1549
 
1539
1550
    if((fd = open(diff, O_RDONLY)) == -1) {
1540
1551
        mprintf("!verifydiff: Can't open diff file %s\n", diff);
1541
1552
        cli_rmdirs(tempdir);
1543
1554
        return -1;
1544
1555
    }
1545
1556
 
1546
 
    if(!getcwd(cwd, sizeof(cwd))) {
1547
 
        mprintf("!verifydiff: getcwd() failed\n");
1548
 
        cli_rmdirs(tempdir);
1549
 
        free(tempdir);
1550
 
        return -1;
1551
 
    }
1552
 
 
1553
1557
    if(chdir(tempdir) == -1) {
1554
1558
        mprintf("!verifydiff: Can't chdir to %s\n", tempdir);
1555
1559
        cli_rmdirs(tempdir);