~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to common/audit.c

  • Committer: Bazaar Package Importer
  • Author(s): Eric Dorland
  • Date: 2009-03-08 22:46:47 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090308224647-gq17gatcl71lrc2k
Tags: 2.0.11-1
* New upstream release. (Closes: #496663)
* debian/control: Make the description a little more distinctive than
  gnupg v1's. Thanks Jari Aalto. (Closes: #496323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
static const char *
116
116
event2str (audit_event_t event)
117
117
{
118
 
  int idx = eventstr_msgidxof (event);
 
118
  /* We need the cast so that compiler does not complain about an
 
119
     always true comparison (>= 0) for an unsigned value.  */
 
120
  int idx = eventstr_msgidxof ((int)event);
119
121
  if (idx == -1)
120
122
    return "Unknown event";
121
123
  else
449
451
 
450
452
  if (ctx->use_html && format && oktext)
451
453
    {
 
454
      if (!strcmp (oktext, "Yes") 
 
455
          || !strcmp (oktext, "good") )
 
456
        color = "green";
 
457
      else if (!strcmp (oktext, "No")
 
458
               || !strcmp (oktext, "bad") )
 
459
        color = "red";
 
460
    }
 
461
 
 
462
  if (format && oktext)
 
463
    {
 
464
      const char *s = NULL;
 
465
 
452
466
      if (!strcmp (oktext, "Yes"))
453
 
        color = "green";
 
467
        oktext = _("Yes");
454
468
      else if (!strcmp (oktext, "No"))
455
 
        color = "red";
 
469
        oktext = _("No");
 
470
      else if (!strcmp (oktext, "good"))
 
471
        {
 
472
          /* TRANSLATORS: Copy the prefix between the vertical bars
 
473
             verbatim.  It will not be printed.  */
 
474
          oktext = _("|audit-log-result|Good");
 
475
        }
 
476
      else if (!strcmp (oktext, "bad"))
 
477
        oktext = _("|audit-log-result|Bad");
 
478
      else if (!strcmp (oktext, "unsupported"))
 
479
        oktext = _("|audit-log-result|Not supported");
 
480
      else if (!strcmp (oktext, "no-cert"))
 
481
        oktext = _("|audit-log-result|No certificate");
 
482
      else if (!strcmp (oktext, "error"))
 
483
        oktext = _("|audit-log-result|Error");
 
484
      else
 
485
        s = "";
 
486
 
 
487
      /* If we have set a prefix, skip it.  */
 
488
      if (!s && *oktext == '|' && (s=strchr (oktext+1,'|')))
 
489
        oktext = s+1;
456
490
    }
457
491
 
458
492
  if (ctx->use_html)