Changeset 151 for trunk/src


Ignore:
Timestamp:
Jan 9, 2008, 10:49:15 PM (17 years ago)
Author:
katerina
Message:

Checksum functions modified to return length of file hashed. Fixes ticket #85 (GrowingLogfiles bug).

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cutest_sh_tiger0.c

    r137 r151  
    135135  char * expected;
    136136  char hashbuf[KEYBUF_SIZE];
     137  UINT64  length;
    137138
    138139  init();
     
    153154  /* same result as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192)
    154155   */
    155   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     156  length = TIGER_NOLIM;
     157  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    156158  expected = "0E9321614C966A33608C2A15F156E0435CACFD1213B9F095";
    157159  CuAssertStrEquals(tc, expected, actual);
     
    160162  CuAssertTrue(tc, rval_open >= 0);
    161163
    162   actual = sh_tiger_generic_hash("cutest_foo", rval_open, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     164  length = TIGER_NOLIM;
     165  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    163166  expected = "0E9321614C966A33608C2A15F156E0435CACFD1213B9F095";
    164167  CuAssertStrEquals(tc, expected, actual);
     
    175178  /* same result as GNU md5sum
    176179   */
    177   actual = sh_tiger_generic_hash("cutest_foo", rval_open, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     180  length = TIGER_NOLIM;
     181  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    178182  expected = "AEEC4DDA496BCFBA691F4E8863BA84C00000000000000000";
    179183  CuAssertStrEquals(tc, expected, actual);
     
    190194  /* same result as gpg --print-md SHA1
    191195   */
    192   actual = sh_tiger_generic_hash("cutest_foo", rval_open, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     196  length = TIGER_NOLIM;
     197  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    193198  expected = "2FE65D1D995B8F8BC8B13F798C07E7E935A787ED00000000";
    194199  CuAssertStrEquals(tc, expected, actual);
     
    216221  /* same result as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192)
    217222   */
    218   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     223  length = TIGER_NOLIM;
     224  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    219225  expected = "F987845A0EA784367BF9E4DB09014995810F27C99C891734";
    220226  CuAssertStrEquals(tc, expected, actual);
     
    239245  /* same result as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192)
    240246   */
    241   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     247  length = TIGER_NOLIM;
     248  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    242249  expected = "75B98A7AE257A230189828A40792E30B4038D286479CC7B8";
    243250  CuAssertStrEquals(tc, expected, actual);
     
    258265  char * expected;
    259266  char hashbuf[KEYBUF_SIZE];
     267  UINT64  length;
    260268
    261269  char * teststring = "Tiger - A Fast New Hash Function, by Ross Anderson and Eli Biham, proceedings of Fast Software Encryption 3, Cambridge, 1996.\n";
    262   int    testlen = strlen(teststring);
     270  size_t    testlen = strlen(teststring);
    263271
    264272  init();
     
    280288  /* same as GnuPG 1.0.6 (gpg --load-extension tiger --print-md TIGER192)
    281289   */
    282   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 0, 0, hashbuf, sizeof(hashbuf));
     290  length = 0;
     291  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    283292  expected = "24F0130C63AC933216166E76B1BB925FF373DE2D49584E7A";
    284293  CuAssertStrEquals(tc, expected, actual);
    285 
    286   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, testlen, 0, hashbuf, sizeof(hashbuf));
     294  CuAssertTrue(tc, 0 == length);
     295
     296  length = testlen;
     297  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    287298  expected = "75B98A7AE257A230189828A40792E30B4038D286479CC7B8";
    288299  CuAssertStrEquals(tc, expected, actual);
    289 
    290   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 2*testlen, 0, hashbuf, sizeof(hashbuf));
     300  CuAssertTrue(tc, testlen == length);
     301
     302  length = 2*testlen;
     303  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    291304  expected = "B5B4FB97B01ADB58794D87A6A01B2368852FA764BD93AB90";
    292305  CuAssertStrEquals(tc, expected, actual);
    293 
    294   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     306  CuAssertTrue(tc, 2*testlen == length);
     307
     308  length = TIGER_NOLIM;
     309  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    295310  expected = "B5B4FB97B01ADB58794D87A6A01B2368852FA764BD93AB90";
    296311  CuAssertStrEquals(tc, expected, actual);
     312  CuAssertTrue(tc, 2*testlen == length);
    297313
    298314  fp = fopen("cutest_foo", "a");
     
    303319  CuAssertTrue(tc, result == 0);
    304320
    305   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, testlen, 0, hashbuf, sizeof(hashbuf));
     321  length = testlen;
     322  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    306323  expected = "75B98A7AE257A230189828A40792E30B4038D286479CC7B8";
    307324  CuAssertStrEquals(tc, expected, actual);
    308 
    309   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 2*testlen, 0, hashbuf, sizeof(hashbuf));
     325  CuAssertTrue(tc, testlen == length);
     326
     327  length = 2*testlen;
     328  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    310329  expected = "B5B4FB97B01ADB58794D87A6A01B2368852FA764BD93AB90";
    311330  CuAssertStrEquals(tc, expected, actual);
    312 
    313   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 3*testlen, 0, hashbuf, sizeof(hashbuf));
     331  CuAssertTrue(tc, 2*testlen == length);
     332
     333  length = 3*testlen;
     334  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    314335  expected = "D0EE1A9956CAB22D84B51A5E0C093B724828C6A1F9CBDB7F";
    315336  CuAssertStrEquals(tc, expected, actual);
    316 
    317   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     337  CuAssertTrue(tc, 3*testlen == length);
     338
     339  length = TIGER_NOLIM;
     340  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    318341  expected = "D0EE1A9956CAB22D84B51A5E0C093B724828C6A1F9CBDB7F";
    319342  CuAssertStrEquals(tc, expected, actual);
    320 
    321   actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, 5, 0, hashbuf, sizeof(hashbuf));
     343  CuAssertTrue(tc, 3*testlen == length);
     344
     345  length = 5;
     346  actual = sh_tiger_generic_hash("cutest_foo", TIGER_FILE, &length, 0, hashbuf, sizeof(hashbuf));
    322347  expected = "9F00F599072300DD276ABB38C8EB6DEC37790C116F9D2BDF";
    323348  CuAssertStrEquals(tc, expected, actual);
     349  CuAssertTrue(tc, 5 == length);
    324350
    325351  /* same results as GNU md5sum */
     
    331357  CuAssertTrue(tc, rval_open >= 0);
    332358
    333   actual = sh_tiger_generic_hash("cutest_foo", rval_open, testlen, 0, hashbuf, sizeof(hashbuf));
     359  length = testlen;
     360  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    334361  expected = "11E7E7EA486136273606BEE57C71F34B0000000000000000";
    335362  CuAssertStrEquals(tc, expected, actual);
    336 
    337   result = sl_rewind(rval_open);
    338   CuAssertTrue(tc, rval_open >= 0);
    339 
    340   actual = sh_tiger_generic_hash("cutest_foo", rval_open, 2*testlen, 0, hashbuf, sizeof(hashbuf));
     363  CuAssertTrue(tc, testlen == length);
     364
     365  result = sl_rewind(rval_open);
     366  CuAssertTrue(tc, rval_open >= 0);
     367
     368  length = 2*testlen;
     369  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    341370  expected = "D49DAD474095D467E2E5EFCB2DC23A770000000000000000";
    342371  CuAssertStrEquals(tc, expected, actual);
    343 
    344   result = sl_rewind(rval_open);
    345   CuAssertTrue(tc, rval_open >= 0);
    346 
    347   actual = sh_tiger_generic_hash("cutest_foo", rval_open, 3*testlen, 0, hashbuf, sizeof(hashbuf));
     372  CuAssertTrue(tc, 2*testlen == length);
     373
     374  result = sl_rewind(rval_open);
     375  CuAssertTrue(tc, rval_open >= 0);
     376
     377  length = 3*testlen;
     378  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    348379  expected = "00A1F1C5EDDCCFC430D3862FDA94593E0000000000000000";
    349380  CuAssertStrEquals(tc, expected, actual);
    350 
    351   result = sl_rewind(rval_open);
    352   CuAssertTrue(tc, rval_open >= 0);
    353 
    354   actual = sh_tiger_generic_hash("cutest_foo", rval_open, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     381  CuAssertTrue(tc, 3*testlen == length);
     382
     383  result = sl_rewind(rval_open);
     384  CuAssertTrue(tc, rval_open >= 0);
     385
     386  length = TIGER_NOLIM;
     387  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    355388  expected = "00A1F1C5EDDCCFC430D3862FDA94593E0000000000000000";
    356389  CuAssertStrEquals(tc, expected, actual);
     390  CuAssertTrue(tc, 3*testlen == length);
    357391
    358392  /* same result as gpg --print-md SHA1
     
    365399  CuAssertTrue(tc, rval_open >= 0);
    366400
    367   actual = sh_tiger_generic_hash("cutest_foo", rval_open, testlen, 0, hashbuf, sizeof(hashbuf));
     401  length = testlen;
     402  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    368403  expected = "F37DB4344CCD140EE315179E9A27512FB4704F0F00000000";
    369404  CuAssertStrEquals(tc, expected, actual);
    370 
    371   result = sl_rewind(rval_open);
    372   CuAssertTrue(tc, rval_open >= 0);
    373 
    374   actual = sh_tiger_generic_hash("cutest_foo", rval_open, 2*testlen, 0, hashbuf, sizeof(hashbuf));
     405  CuAssertTrue(tc, testlen == length);
     406
     407  result = sl_rewind(rval_open);
     408  CuAssertTrue(tc, rval_open >= 0);
     409
     410  length = 2*testlen;
     411  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    375412  expected = "D2AD5FC366452D81400BAC31F96269DEEF314BC200000000";
    376413  CuAssertStrEquals(tc, expected, actual);
    377 
    378   result = sl_rewind(rval_open);
    379   CuAssertTrue(tc, rval_open >= 0);
    380 
    381   actual = sh_tiger_generic_hash("cutest_foo", rval_open, 3*testlen, 0, hashbuf, sizeof(hashbuf));
     414  CuAssertTrue(tc, 2*testlen == length);
     415
     416  result = sl_rewind(rval_open);
     417  CuAssertTrue(tc, rval_open >= 0);
     418
     419  length = 3*testlen;
     420  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    382421  expected = "FAA937EF3389C7E786EB0F1006D049D7AEA7B7B600000000";
    383422  CuAssertStrEquals(tc, expected, actual);
    384 
    385   result = sl_rewind(rval_open);
    386   CuAssertTrue(tc, rval_open >= 0);
    387 
    388   actual = sh_tiger_generic_hash("cutest_foo", rval_open, TIGER_NOLIM, 0, hashbuf, sizeof(hashbuf));
     423  CuAssertTrue(tc, 3*testlen == length);
     424
     425  result = sl_rewind(rval_open);
     426  CuAssertTrue(tc, rval_open >= 0);
     427
     428  length = TIGER_NOLIM;
     429  actual = sh_tiger_generic_hash("cutest_foo", rval_open, &length, 0, hashbuf, sizeof(hashbuf));
    389430  expected = "FAA937EF3389C7E786EB0F1006D049D7AEA7B7B600000000";
    390431  CuAssertStrEquals(tc, expected, actual);
     432  CuAssertTrue(tc, 3*testlen == length);
    391433
    392434  result = sl_close(rval_open);
  • trunk/src/sh_prelink.c

    r133 r151  
    261261  {
    262262    char hashbuf[KEYBUF_SIZE];
     263    UINT64 length_nolim = TIGER_NOLIM;
    263264    sl_strlcpy(file_hash,
    264                sh_tiger_generic_hash (path, task.pipeTI, TIGER_NOLIM, alert_timeout,
     265               sh_tiger_generic_hash (path, task.pipeTI, &length_nolim, alert_timeout,
    265266                                      hashbuf, sizeof(hashbuf)),
    266267               KEY_LEN+1);
  • trunk/src/sh_tiger0.c

    r137 r151  
    106106static
    107107word64 * sh_tiger_hash_val (const char * filename, TigerType what,
    108                             UINT64 Length, int timeout, word64 * res)
     108                            UINT64 * Length, int timeout, word64 * res)
    109109#else
    110110static
    111111sh_word32 * sh_tiger_hash_val (const char * filename, TigerType what,
    112                                UINT64 Length, int timeout, sh_word32 * res)
     112                               UINT64 * Length, int timeout, sh_word32 * res)
    113113#endif
    114114{
     
    178178          SH_FREE(tmp);
    179179          SH_FREE(buffer);
     180          *Length = 0;
    180181          SL_RETURN( NULL, _("sh_tiger_hash_val"));
    181182        }
     
    222223              sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
    223224              SH_FREE(buffer);
     225              *Length = 0;
    224226              SL_RETURN( NULL, _("sh_tiger_hash_val"));
    225227            }
     
    242244            sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
    243245            SH_FREE(buffer);
     246            *Length = 0;
    244247            SL_RETURN( NULL, _("sh_tiger_hash_val"));
    245248          }
    246249
    247         if (Length != TIGER_NOLIM)
     250        bcount += count;
     251
     252        if (*Length != TIGER_NOLIM)
    248253          {
    249             bcount += count;
    250             if (bcount > Length)
    251               count = count - (bcount - Length);
    252             count = (count < 0) ? 0 : count;
     254            if (bcount > *Length)
     255              {
     256                count   = count - (bcount - (*Length));
     257                bcount  = *Length;
     258                count = (count < 0) ? 0 : count;
     259              }
    253260          }
    254261
     
    288295            sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
    289296            SH_FREE(buffer);
     297            *Length = 0;
    290298            SL_RETURN( NULL, _("sh_tiger_hash_val"));
    291299          }
     
    375383    sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
    376384    SH_FREE(buffer);
     385    *Length = bcount;
    377386    SL_RETURN( res, _("sh_tiger_hash_val"));
    378387  }
     
    380389  if (what == TIGER_DATA && filename != NULL)
    381390    {
    382       tiger(TIGER_CAST filename, (sh_word32) Length, res);
     391      tiger(TIGER_CAST filename, (sh_word32) *Length, res);
    383392      sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
    384393      SH_FREE(buffer);
     
    387396  sh_unix_munlock((char *)buffer, (PRIV_MAX)*sizeof(sh_byte));
    388397  SH_FREE(buffer);
     398  *Length = 0;
    389399  SL_RETURN( NULL, _("sh_tiger_hash_val"));
    390400}
     
    822832   beginning at RESBLOCK.  */
    823833static int md5_stream(char * filename, void *resblock,
    824                       UINT64 Length, int timeout, SL_TICKET fd)
     834                      UINT64 * Length, int timeout, SL_TICKET fd)
    825835{
    826836  /* Important: BLOCKSIZE must be a multiple of 64.  */
     
    852862                       MSG_E_ACCESS, (long) euid, tmp);
    853863      SH_FREE(tmp);
     864      *Length = 0;
    854865      return -1;
    855866    }
     
    888899                             MSG_E_READ, tmp);
    889900          SH_FREE(tmp);
     901          *Length = 0;
    890902          return -1;
    891903        }
    892904
    893       if (Length != TIGER_NOLIM)
     905      bcount += n;
     906
     907      if (*Length != TIGER_NOLIM)
    894908        {
    895           bcount += n;
    896           if (bcount > Length)
    897             n = n - (bcount - Length);
    898           n = (n < 0) ? 0 : n;
     909          if (bcount > *Length)
     910            {
     911              n = n - (bcount - (*Length));
     912              bcount = *Length;
     913              n = (n < 0) ? 0 : n;
     914            }
    899915        }
    900916
     
    924940    if (sig_termfast == 1)
    925941      {
     942        *Length = 0;
    926943        return -1;
    927944      }
     
    939956  (void) md5Digest(&ctx, resblock);
    940957
     958  *Length = bcount;
    941959  return 0;
    942960}
     
    944962static
    945963char * sh_tiger_md5_hash  (char * filename, TigerType what,
    946                            UINT64 Length, int timeout, char * out, size_t len)
     964                           UINT64 * Length, int timeout, char * out, size_t len)
    947965{
    948966  int cnt;
     
    13321350   beginning at RESBLOCK.  */
    13331351static int sha1_stream(char * filename, void *resblock,
    1334                        UINT64 Length, int timeout, SL_TICKET fd)
     1352                       UINT64 * Length, int timeout, SL_TICKET fd)
    13351353{
    13361354  /* Important: BLOCKSIZE must be a multiple of 64.  */
     
    13611379                       MSG_E_ACCESS, (long) euid, tmp);
    13621380      SH_FREE(tmp);
     1381      *Length = 0;
    13631382      return -1;
    13641383    }
     
    14001419            }
    14011420          SH_FREE(tmp);
     1421          *Length = 0;
    14021422          return -1;
    14031423        }
    14041424
    1405       if (Length != TIGER_NOLIM)
     1425      bcount += n;
     1426
     1427      if (*Length != TIGER_NOLIM)
    14061428        {
    1407           bcount += n;
    1408           if (bcount > Length)
    1409             n = n - (bcount - Length);
    1410           n = (n < 0) ? 0 : n;
     1429          if (bcount > *Length)
     1430            {
     1431              n = n - (bcount - (*Length));
     1432              bcount = *Length;
     1433              n = (n < 0) ? 0 : n;
     1434            }
    14111435        }
    14121436
     
    14361460    if (sig_termfast == 1)
    14371461      {
     1462        *Length = 0;
    14381463        return -1;
    14391464      }
     
    14531478  /* Construct result in desired memory.  */
    14541479  sha_digest (&ctx, resblock);
     1480  *Length = bcount;
    14551481  return 0;
    14561482}
     
    14581484
    14591485static char * sh_tiger_sha1_hash  (char * filename, TigerType what,
    1460                                    UINT64 Length, int timeout,
     1486                                   UINT64 * Length, int timeout,
    14611487                                   char * out, size_t len)
    14621488{
     
    15171543
    15181544static char * sh_tiger_hash_internal (const char * filename, TigerType what,
    1519                                       UINT64 Length, int timeout,
     1545                                      UINT64 * Length, int timeout,
    15201546                                      char * out, size_t len);
    15211547
     
    15231549                      UINT64 Length, char * out, size_t len)
    15241550{
    1525   return sh_tiger_hash_internal (filename, what, Length, 0, out,len);
     1551  UINT64 local_length = Length;
     1552  char * retval = sh_tiger_hash_internal (filename, what, &local_length, 0, out,len);
     1553  return retval;
    15261554}
    15271555
    15281556char * sh_tiger_generic_hash (char * filename, TigerType what,
    1529                               UINT64 Length, int timeout,
     1557                              UINT64 * Length, int timeout,
    15301558                              char * out, size_t len)
    15311559{
     
    15451573 
    15461574static char * sh_tiger_hash_internal (const char * filename, TigerType what,
    1547                                       UINT64 Length, int timeout,
     1575                                      UINT64 * Length, int timeout,
    15481576                                      char * out, size_t len)
    15491577{
     
    15981626  sh_word32 res[6];
    15991627#endif
     1628  UINT64 local_length = Length;
    16001629
    16011630  SL_ENTER(_("sh_tiger_hash_gpg"));
    16021631
    1603   if (NULL != sh_tiger_hash_val (filename, what, Length, 0, res))
     1632  if (NULL != sh_tiger_hash_val (filename, what, &local_length, 0, res))
    16041633    {
    16051634#if defined(TIGER_64_BIT)
     
    16631692  sh_word32 res[6];
    16641693#endif
     1694  UINT64 local_length = Length;
    16651695
    16661696  SL_ENTER(_("sh_tiger_hash_uint32"));
     
    16711701  out[3] = 0; out[4] = 0; out[5] = 0;
    16721702
    1673   if (NULL != sh_tiger_hash_val (filename,  what,  Length, 0, res))
     1703  if (NULL != sh_tiger_hash_val (filename,  what,  &local_length, 0, res))
    16741704    {
    16751705#if defined(TIGER_64_BIT)
  • trunk/src/sh_unix.c

    r149 r151  
    30333033      char hashbuf[KEYBUF_SIZE];
    30343034      sl_strlcpy(fileHash,
    3035                  sh_tiger_generic_hash (filename, fd, tmpFile.size,
     3035                 sh_tiger_generic_hash (filename, fd, &(tmpFile.size),
    30363036                                        alert_timeout, hashbuf, sizeof(hashbuf)),
    30373037                 KEY_LEN+1);
     
    33713371            {
    33723372              char hashbuf[KEYBUF_SIZE];
     3373              UINT64 length_nolim = TIGER_NOLIM;
    33733374              sl_strlcpy(fileHash,
    33743375                         sh_tiger_generic_hash (theFile->fullpath,
    3375                                                 rval_open, TIGER_NOLIM,
     3376                                                rval_open, &length_nolim,
    33763377                                                alert_timeout,
    33773378                                                hashbuf, sizeof(hashbuf)),
     
    33793380              if ((theFile->check_mask & MODI_SGROW) != 0)
    33803381                {
     3382                  fbuf.st_size = (off_t) length_nolim;
     3383                  buf.st_size  = fbuf.st_size;
    33813384                  sl_rewind(rval_open);
    33823385                  sh_unix_checksum_size (theFile->fullpath, &fbuf,
     
    34113414            {
    34123415              char hashbuf[KEYBUF_SIZE];
     3416              UINT64 length_nolim = TIGER_NOLIM;
    34133417              sl_strlcpy(fileHash,
    34143418                         sh_tiger_generic_hash (theFile->fullpath, rval_open,
    3415                                                 TIGER_NOLIM,
     3419                                                &length_nolim,
    34163420                                                alert_timeout,
    34173421                                                hashbuf, sizeof(hashbuf)),
     
    34193423              if ((theFile->check_mask & MODI_SGROW) != 0)
    34203424                {
     3425                  fbuf.st_size = (off_t) length_nolim;
     3426                  buf.st_size  = fbuf.st_size;
    34213427                  sl_rewind(rval_open);
    34223428                  sh_unix_checksum_size (theFile->fullpath, &fbuf,
Note: See TracChangeset for help on using the changeset viewer.