1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-05-16 08:33:24 +02:00

* delkey.c (do_delete_key): Allow deleting a public key with a secret

present if --expert is set.

* plaintext.c (handle_plaintext): Make bytecount static so it works with
multiple literal packets inside a message.
This commit is contained in:
David Shaw 2004-02-25 23:32:34 +00:00
parent d08daf31e0
commit 693e4440b2
3 changed files with 15 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2004-02-25 David Shaw <dshaw@jabberwocky.com>
* delkey.c (do_delete_key): Allow deleting a public key with a
secret present if --expert is set.
* plaintext.c (handle_plaintext): Make bytecount static so it
works with multiple literal packets inside a message.
2004-02-24 David Shaw <dshaw@jabberwocky.com> 2004-02-24 David Shaw <dshaw@jabberwocky.com>
* encode.c (encode_simple): Show cipher with --verbose. * encode.c (encode_simple): Show cipher with --verbose.

View File

@ -1,5 +1,6 @@
/* delkey.c - delete keys /* delkey.c - delete keys
* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. * Copyright (C) 1998, 1999, 2000, 2001, 2002,
* 2004 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
* *
@ -98,7 +99,7 @@ do_delete_key( const char *username, int secret, int *r_sec_avail )
pk = node->pkt->pkt.public_key; pk = node->pkt->pkt.public_key;
keyid_from_pk( pk, keyid ); keyid_from_pk( pk, keyid );
rc = seckey_available( keyid ); rc = seckey_available( keyid );
if( !rc ) { if( !rc && !opt.expert ) {
*r_sec_avail = 1; *r_sec_avail = 1;
rc = -1; rc = -1;
goto leave; goto leave;

View File

@ -41,7 +41,6 @@
#include "i18n.h" #include "i18n.h"
/**************** /****************
* Handle a plaintext packet. If MFX is not NULL, update the MDs * Handle a plaintext packet. If MFX is not NULL, update the MDs
* Note: we should use the filter stuff here, but we have to add some * Note: we should use the filter stuff here, but we have to add some
@ -54,7 +53,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
{ {
char *fname = NULL; char *fname = NULL;
FILE *fp = NULL; FILE *fp = NULL;
off_t count=0; static off_t count=0;
int rc = 0; int rc = 0;
int c; int c;
int convert = pt->mode == 't'; int convert = pt->mode == 't';
@ -136,7 +135,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
#endif #endif
if( fp ) if( fp )
{ {
if(opt.max_output && (count++)>opt.max_output) if(opt.max_output && (++count)>opt.max_output)
{ {
log_error("Error writing to `%s': %s\n", log_error("Error writing to `%s': %s\n",
fname,"exceeded --max-output limit\n"); fname,"exceeded --max-output limit\n");
@ -202,7 +201,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
#endif #endif
if( fp ) if( fp )
{ {
if(opt.max_output && (count++)>opt.max_output) if(opt.max_output && (++count)>opt.max_output)
{ {
log_error("Error writing to `%s': %s\n", log_error("Error writing to `%s': %s\n",
fname,"exceeded --max-output limit\n"); fname,"exceeded --max-output limit\n");
@ -265,7 +264,7 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
while( (c = iobuf_get(pt->buf)) != -1 ) { while( (c = iobuf_get(pt->buf)) != -1 ) {
if( fp ) if( fp )
{ {
if(opt.max_output && (count++)>opt.max_output) if(opt.max_output && (++count)>opt.max_output)
{ {
log_error("Error writing to `%s': %s\n", log_error("Error writing to `%s': %s\n",
fname,"exceeded --max-output limit\n"); fname,"exceeded --max-output limit\n");