~ubuntu-branches/ubuntu/hardy/gnupg/hardy-updates

« back to all changes in this revision

Viewing changes to g10/keydb.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-12-16 16:57:39 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051216165739-v0m2d1you6hd8jho
Tags: upstream-1.4.2
ImportĀ upstreamĀ versionĀ 1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* keydb.c - key database dispatcher
2
 
 * Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
2
 * Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3
3
 *
4
4
 * This file is part of GnuPG.
5
5
 *
15
15
 *
16
16
 * You should have received a copy of the GNU General Public License
17
17
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 
19
 * USA.
19
20
 */
20
21
 
21
22
#include <config.h>
195
196
 * Note: this function may be called before secure memory is
196
197
 * available.
197
198
 * Flag 1 == force
198
 
 * Flag 2 == default
 
199
 * Flag 2 == mark resource as primary
 
200
 * Flag 4 == This is a default resources
199
201
 */
200
202
int
201
203
keydb_add_resource (const char *url, int flags, int secret)
305
307
 
306
308
  leave:
307
309
    if (rc)
308
 
        log_error ("keyblock resource `%s': %s\n", filename, g10_errstr(rc));
 
310
      {
 
311
        /* Secret keyrings are not required in all cases.  To avoid
 
312
           having gpg return failure we use log_info here if the
 
313
           rewsource is a secret one and marked as default
 
314
           resource.  */
 
315
        if ((flags&4) && secret)
 
316
          log_info (_("keyblock resource `%s': %s\n"),
 
317
                    filename, g10_errstr(rc));
 
318
        else
 
319
          log_error (_("keyblock resource `%s': %s\n"),
 
320
                     filename, g10_errstr(rc));
 
321
      }
309
322
    else if (secret)
310
323
        any_secret = 1;
311
324
    else