~ubuntu-branches/ubuntu/hardy/gnupg2/hardy-proposed

« back to all changes in this revision

Viewing changes to sm/keydb.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2007-05-15 13:54:55 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070515135455-89qfyalmgjy6gcqw
Tags: 2.0.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Remove libpcsclite-dev, libopensc2-dev build dependencies (they are in
    universe).
  - Build-depend on libcurl3-gnutls-dev
  - g10/call-agent.c: set DBG_ASSUAN to 0 to suppress a debug message
  - Include /doc files as done with gnupg
  - debian/rules: add doc/com-certs.pem to the docs for gpgsm
  - debian/copyright: update download url
  - debian/README.Debian: remove note the gnupg2 isn't released yet.
  - debian/control: Change Maintainer/XSBC-Original-Maintainer field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
722
722
 
723
723
 
724
724
 
725
 
/* update the current keyblock with KB */
 
725
/* Update the current keyblock with KB.  */
726
726
int
727
727
keydb_update_cert (KEYDB_HANDLE hd, ksba_cert_t cert)
728
728
{
1366
1366
   transaction by locating the certificate in the DB and updating the
1367
1367
   flags. */
1368
1368
gpg_error_t
1369
 
keydb_set_cert_flags (ksba_cert_t cert, int which, int idx, unsigned int value)
 
1369
keydb_set_cert_flags (ksba_cert_t cert, int ephemeral, 
 
1370
                      int which, int idx, 
 
1371
                      unsigned int mask, unsigned int value)
1370
1372
{
1371
1373
  KEYDB_HANDLE kh;
1372
1374
  gpg_error_t err;
1386
1388
      return gpg_error (GPG_ERR_ENOMEM);;
1387
1389
    }
1388
1390
 
 
1391
  if (ephemeral)
 
1392
    keydb_set_ephemeral (kh, 1);
 
1393
 
1389
1394
  err = keydb_lock (kh);
1390
1395
  if (err)
1391
1396
    {
1397
1402
  err = keydb_search_fpr (kh, fpr);
1398
1403
  if (err)
1399
1404
    {
1400
 
      log_error (_("problem re-searching certificate: %s\n"),
1401
 
                 gpg_strerror (err));
 
1405
      if (err == -1)
 
1406
        err = gpg_error (GPG_ERR_NOT_FOUND);
 
1407
      else
 
1408
        log_error (_("problem re-searching certificate: %s\n"),
 
1409
                   gpg_strerror (err));
1402
1410
      keydb_release (kh);
1403
1411
      return err;
1404
1412
    }
1410
1418
      keydb_release (kh);
1411
1419
      return err;
1412
1420
    }
 
1421
 
 
1422
  value = ((old_value & ~mask) | (value & mask));
 
1423
 
1413
1424
  if (value != old_value)
1414
1425
    {
1415
1426
      err = keydb_set_flags (kh, which, idx, value);
1420
1431
          return err;
1421
1432
        }
1422
1433
    }
 
1434
 
1423
1435
  keydb_release (kh);               
1424
1436
  return 0;
1425
1437
}