Changeset 86 for trunk/src/sh_gpg.c


Ignore:
Timestamp:
Jan 20, 2007, 11:04:59 PM (18 years ago)
Author:
rainer
Message:

More thorough fix for ticket #47, and corresponding regression test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_gpg.c

    r34 r86  
    115115
    116116#ifdef GPG_HASH
     117
    117118static int sh_gpg_checksum (SL_TICKET checkfd, int flag)
    118119{
     
    202203}
    203204#endif
     205
     206struct startup_info {
     207  long   line;
     208  char * program;
     209  long   uid;
     210  char * path;
     211  char * key_uid;
     212  char * key_id;
     213};
     214
     215static struct startup_info startInfo = { 0, NULL, 0, NULL, NULL, NULL };
     216
     217void sh_gpg_log_startup ()
     218{
     219  if (startInfo.program != NULL)
     220    {
     221      sh_error_handle ((-1), FIL__, startInfo.line, 0, MSG_START_GH,
     222                       startInfo.program, startInfo.uid,
     223                       startInfo.path,
     224                       startInfo.key_uid, startInfo.key_id);
     225    }
     226  return;
     227}
     228
     229static void sh_gpg_fill_startup (long line, char * program, long uid, char * path,
     230                                 char * key_uid, char * key_id)
     231{
     232  startInfo.line    = line;
     233  startInfo.program = sh_util_strdup(program);
     234  startInfo.uid     = uid;
     235  startInfo.path    = sh_util_strdup(path);
     236  startInfo.key_uid = sh_util_strdup(key_uid);
     237  startInfo.key_id  = sh_util_strdup(key_id);
     238  return;
     239}
    204240
    205241static FILE * sh_gpg_popen (sh_gpg_popen_t  *source, int fd,
     
    9681004            {
    9691005              tmp  = sh_util_safe_name(gp.conf_id);
    970               sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH,
     1006              sh_gpg_fill_startup (
     1007                                   /* sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH, */
    9711008                               sh.prg_name, sh.real.uid,
    9721009                               (sh.flag.hidefile == S_TRUE) ?
     
    9951032        {
    9961033          tmp = sh_util_safe_name(gp.conf_id);
    997           sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH,
     1034          sh_gpg_fill_startup (__LINE__,
     1035          /* sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH, */
    9981036                           sh.prg_name, sh.real.uid,
    9991037                           (sh.flag.hidefile == S_TRUE) ?
Note: See TracChangeset for help on using the changeset viewer.