~ubuntu-branches/ubuntu/oneiric/gnupg2/oneiric-proposed

« back to all changes in this revision

Viewing changes to agent/gpg-agent.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2010-01-22 21:49:55 UTC
  • mfrom: (1.1.14 upstream) (7.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100122214955-r2ab5it9rts5gqjf
Tags: 2.0.14-1ubuntu1
* Merge with Debian testing (lp: #511356). Remaining changes:
  - debian/gnupg2.dev: udev rules to set ACLs on SCM smartcard readers.
  - debian/rules: Call dh_installudev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
360
360
static void
361
361
set_debug (void)
362
362
{
 
363
  int numok = (debug_level && digitp (debug_level));
 
364
  int numlvl = numok? atoi (debug_level) : 0;
 
365
 
363
366
  if (!debug_level)
364
367
    ;
365
 
  else if (!strcmp (debug_level, "none"))
 
368
  else if (!strcmp (debug_level, "none") || (numok && numlvl < 1))
366
369
    opt.debug = 0;
367
 
  else if (!strcmp (debug_level, "basic"))
 
370
  else if (!strcmp (debug_level, "basic") || (numok && numlvl <= 2))
368
371
    opt.debug = DBG_ASSUAN_VALUE;
369
 
  else if (!strcmp (debug_level, "advanced"))
 
372
  else if (!strcmp (debug_level, "advanced") || (numok && numlvl <= 5))
370
373
    opt.debug = DBG_ASSUAN_VALUE|DBG_COMMAND_VALUE;
371
 
  else if (!strcmp (debug_level, "expert"))
 
374
  else if (!strcmp (debug_level, "expert") || (numok && numlvl <= 8))
372
375
    opt.debug = (DBG_ASSUAN_VALUE|DBG_COMMAND_VALUE
373
376
                 |DBG_CACHE_VALUE);
374
 
  else if (!strcmp (debug_level, "guru"))
375
 
    opt.debug = ~0;
 
377
  else if (!strcmp (debug_level, "guru") || numok)
 
378
    {
 
379
      opt.debug = ~0;
 
380
      /* Unless the "guru" string has been used we don't want to allow
 
381
         hashing debugging.  The rationale is that people tend to
 
382
         select the highest debug value and would then clutter their
 
383
         disk with debug files which may reveal confidential data.  */ 
 
384
      if (numok)
 
385
        opt.debug &= ~(DBG_HASHING_VALUE);
 
386
    }
376
387
  else
377
388
    {
378
389
      log_error (_("invalid debug-level `%s' given\n"), debug_level);
390
401
  if (opt.debug & DBG_CRYPTO_VALUE )
391
402
    gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1);
392
403
  gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose);
 
404
 
 
405
  if (opt.debug)
 
406
    log_info ("enabled debug flags:%s%s%s%s%s%s%s%s\n",
 
407
              (opt.debug & DBG_COMMAND_VALUE)? " command":"",    
 
408
              (opt.debug & DBG_MPI_VALUE    )? " mpi":"",    
 
409
              (opt.debug & DBG_CRYPTO_VALUE )? " crypto":"",    
 
410
              (opt.debug & DBG_MEMORY_VALUE )? " memory":"", 
 
411
              (opt.debug & DBG_CACHE_VALUE  )? " cache":"", 
 
412
              (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"", 
 
413
              (opt.debug & DBG_HASHING_VALUE)? " hashing":"", 
 
414
              (opt.debug & DBG_ASSUAN_VALUE )? " assuan":"");
393
415
}
394
416
 
395
417