Changeset 133 for trunk/src/sh_prelink.c


Ignore:
Timestamp:
Oct 25, 2007, 12:19:05 AM (12 years ago)
Author:
rainer
Message:

Reentrant checksum/hash functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_prelink.c

    r132 r133  
    112112  SL_TICKET ticket;
    113113  char * tmp;
     114  char hashbuf[KEYBUF_SIZE];
    114115
    115116  if (task->com_ti != (-1))
     
    128129      return;
    129130    }
    130   tiger_fd = ticket;
     131
    131132  if (*(task->checksum) == '\0' ||
    132133      0 == sl_strcmp(task->checksum,
    133                      sh_tiger_hash (task->command, TIGER_FD, 0)))
     134                     sh_tiger_hash (task->command, ticket, 0, hashbuf, sizeof(hashbuf))))
    134135    {
    135136      task->com_fd = get_the_fd(ticket);
     
    256257  /* read from pipe
    257258   */
    258   tiger_fd = task.pipeTI;
    259 
    260259  sl_read_timeout_prep (task.pipeTI);
    261260
    262   sl_strlcpy(file_hash,
    263              sh_tiger_generic_hash (path, TIGER_FD, TIGER_NOLIM, alert_timeout),
    264              KEY_LEN+1);
     261  {
     262    char hashbuf[KEYBUF_SIZE];
     263    sl_strlcpy(file_hash,
     264               sh_tiger_generic_hash (path, task.pipeTI, TIGER_NOLIM, alert_timeout,
     265                                      hashbuf, sizeof(hashbuf)),
     266               KEY_LEN+1);
     267  }
    265268
    266269  /* restore old signal handler
Note: See TracChangeset for help on using the changeset viewer.