Changeset 107


Ignore:
Timestamp:
Jun 16, 2007, 3:29:39 PM (14 years ago)
Author:
rainer
Message:

Fix incorrect handling of files with zero size in GrowingLogFiles?.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/Changelog

    r105 r107  
    112.3.5:
     2        * fix incorrect handling of files with zero size in GrowingLogFiles
     3          (problem reported by S. Petersen)
    24        * fix incorrect encoding of null checksums in stealth mode
    35        * sh_hash.c: fix repeated printing of acl/attributes in database dump
  • trunk/include/sh_tiger.h

    r22 r107  
    1212  TIGER_DATA
    1313} TigerType;
     14
     15#define TIGER_NOLIM ((UINT64)-1)
    1416
    1517extern SL_TICKET tiger_fd;
  • trunk/src/cutest_sh_tiger0.c

    r96 r107  
    139139  /* same result as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192)
    140140   */
    141   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 0, 0);
     141  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0);
    142142  expected = "0E9321614C966A33608C2A15F156E0435CACFD1213B9F095";
    143143  CuAssertStrEquals(tc, expected, actual);
     
    147147  tiger_fd  = rval_open;
    148148
    149   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, 0, 0);
     149  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, TIGER_NOLIM, 0);
    150150  expected = "0E9321614C966A33608C2A15F156E0435CACFD1213B9F095";
    151151  CuAssertStrEquals(tc, expected, actual);
     
    163163  /* same result as GNU md5sum
    164164   */
    165   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, 0, 0);
     165  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, TIGER_NOLIM, 0);
    166166  expected = "AEEC4DDA496BCFBA691F4E8863BA84C00000000000000000";
    167167  CuAssertStrEquals(tc, expected, actual);
     
    179179  /* same result as gpg --print-md SHA1
    180180   */
    181   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, 0, 0);
     181  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, TIGER_NOLIM, 0);
    182182  expected = "2FE65D1D995B8F8BC8B13F798C07E7E935A787ED00000000";
    183183  CuAssertStrEquals(tc, expected, actual);
     
    205205  /* same result as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192)
    206206   */
    207   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 0, 0);
     207  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0);
    208208  expected = "F987845A0EA784367BF9E4DB09014995810F27C99C891734";
    209209  CuAssertStrEquals(tc, expected, actual);
     
    228228  /* same result as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192)
    229229   */
    230   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 0, 0);
     230  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0);
    231231  expected = "75B98A7AE257A230189828A40792E30B4038D286479CC7B8";
    232232  CuAssertStrEquals(tc, expected, actual);
     
    268268  /* same as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192)
    269269   */
     270  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 0, 0);
     271  expected = "24F0130C63AC933216166E76B1BB925FF373DE2D49584E7A";
     272  CuAssertStrEquals(tc, expected, actual);
     273
    270274  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, testlen, 0);
    271275  expected = "75B98A7AE257A230189828A40792E30B4038D286479CC7B8";
     
    276280  CuAssertStrEquals(tc, expected, actual);
    277281
    278   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 0, 0);
     282  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0);
    279283  expected = "B5B4FB97B01ADB58794D87A6A01B2368852FA764BD93AB90";
    280284  CuAssertStrEquals(tc, expected, actual);
     
    299303  CuAssertStrEquals(tc, expected, actual);
    300304
    301   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 0, 0);
     305  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0);
    302306  expected = "D0EE1A9956CAB22D84B51A5E0C093B724828C6A1F9CBDB7F";
    303307  CuAssertStrEquals(tc, expected, actual);
     
    337341  CuAssertTrue(tc, rval_open >= 0);
    338342
    339   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, 0, 0);
     343  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, TIGER_NOLIM, 0);
    340344  expected = "00A1F1C5EDDCCFC430D3862FDA94593E0000000000000000";
    341345  CuAssertStrEquals(tc, expected, actual);
     
    371375  CuAssertTrue(tc, rval_open >= 0);
    372376
    373   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, 0, 0);
     377  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FD, TIGER_NOLIM, 0);
    374378  expected = "FAA937EF3389C7E786EB0F1006D049D7AEA7B7B600000000";
    375379  CuAssertStrEquals(tc, expected, actual);
  • trunk/src/sh_hash.c

    r105 r107  
    31433143#ifdef REPLACE_OLD
    31443144          if (sh.flag.reportonce == S_TRUE && sh.flag.update == S_FALSE)
    3145             sl_strlcpy(p->theFile.checksum, fileHash, KEY_LEN+1);
     3145            {
     3146              sl_strlcpy(p->theFile.checksum, fileHash, KEY_LEN+1);
     3147              if ((theFile->check_mask & MODI_SGROW) != 0)           
     3148                p->theFile.size  = theFile->size;
     3149            }
    31463150#endif
    31473151        }
  • trunk/src/sh_prelink.c

    r102 r107  
    259259
    260260  sl_strlcpy(file_hash,
    261              sh_tiger_generic_hash (path, TIGER_FD, 0, alert_timeout),
     261             sh_tiger_generic_hash (path, TIGER_FD, TIGER_NOLIM, alert_timeout),
    262262             KEY_LEN+1);
    263263
  • trunk/src/sh_tiger0.c

    r105 r107  
    236236          }
    237237
    238         if (Length > 0)
     238        if (Length != TIGER_NOLIM)
    239239          {
    240240            bcount += count;
     
    879879        }
    880880
    881       if (Length > 0)
     881      if (Length != TIGER_NOLIM)
    882882        {
    883883          bcount += n;
     
    14021402        }
    14031403
    1404       if (Length > 0)
     1404      if (Length != TIGER_NOLIM)
    14051405        {
    14061406          bcount += n;
  • trunk/src/sh_unix.c

    r105 r107  
    28912891                 KEY_LEN+1);
    28922892     
    2893       /* return */
     2893       /* return */
    28942894      SL_RETURN( 0, _("sh_unix_checksum_size"));
    28952895    }
     
    32263226              sl_strlcpy(fileHash,
    32273227                         sh_tiger_generic_hash (theFile->fullpath,
    3228                                                 TIGER_FD, 0,
     3228                                                TIGER_FD, TIGER_NOLIM,
    32293229                                                alert_timeout),
    32303230                         KEY_LEN+1);
     
    32653265              tiger_fd = rval_open;
    32663266              sl_strlcpy(fileHash,
    3267                          sh_tiger_generic_hash (theFile->fullpath, TIGER_FD, 0,
     3267                         sh_tiger_generic_hash (theFile->fullpath, TIGER_FD, TIGER_NOLIM,
    32683268                                                alert_timeout),
    32693269                         KEY_LEN + 1);
Note: See TracChangeset for help on using the changeset viewer.