1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

* keylist.c (show_policy_url, show_keyserver_url, show_notation)

(list_one): Use const char* for i18n string helpers.

* keygen.c (do_generate_keypair, read_parameter_file): Really
close the files.
(do_generate_keypair): Create the secret key file using safe
permissions.  Noted by Atom Smasher.
This commit is contained in:
Werner Koch 2004-05-11 07:43:19 +00:00
parent 69df506b84
commit 536841ecae
4 changed files with 35 additions and 4 deletions

View File

@ -1,3 +1,13 @@
2004-05-11 Werner Koch <wk@gnupg.org>
* keylist.c (show_policy_url, show_keyserver_url, show_notation)
(list_one): Use const char* for i18n string helpers.
* keygen.c (do_generate_keypair, read_parameter_file): Really
close the files.
(do_generate_keypair): Create the secret key file using safe
permissions. Noted by Atom Smasher.
2004-05-10 David Shaw <dshaw@jabberwocky.com>
* options.h, mainproc.c (symkey_decrypt_seskey), keyserver.c

View File

@ -513,6 +513,9 @@ ccid_open_reader (ccid_driver_t *handle, int readerno)
if (rc)
{
DEBUGOUT_1 ("usb_claim_interface failed: %d\n", rc);
XXXXX;
free (*handle);
*handle = NULL;
goto leave;

View File

@ -26,6 +26,9 @@
#include <ctype.h>
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "util.h"
#include "main.h"
#include "packet.h"
@ -2152,6 +2155,13 @@ read_parameter_file( const char *fname )
if( outctrl.use_files ) { /* close open streams */
iobuf_close( outctrl.pub.stream );
iobuf_close( outctrl.sec.stream );
/* Must invalidate that ugly cache to actually close it. */
if (outctrl.pub.fname)
iobuf_ioctl (NULL, 2, 0, (char*)outctrl.pub.fname);
if (outctrl.sec.fname)
iobuf_ioctl (NULL, 2, 0, (char*)outctrl.sec.fname);
m_free( outctrl.pub.fname );
m_free( outctrl.pub.newfname );
m_free( outctrl.sec.fname );
@ -2388,6 +2398,8 @@ do_generate_keypair( struct para_data_s *para,
if( outctrl->pub.newfname ) {
iobuf_close(outctrl->pub.stream);
outctrl->pub.stream = NULL;
if (outctrl->pub.fname)
iobuf_ioctl (NULL, 2, 0, (char*)outctrl->pub.fname);
m_free( outctrl->pub.fname );
outctrl->pub.fname = outctrl->pub.newfname;
outctrl->pub.newfname = NULL;
@ -2405,13 +2417,19 @@ do_generate_keypair( struct para_data_s *para,
}
}
if( outctrl->sec.newfname ) {
mode_t oldmask;
iobuf_close(outctrl->sec.stream);
outctrl->sec.stream = NULL;
if (outctrl->sec.fname)
iobuf_ioctl (NULL, 2, 0, (char*)outctrl->sec.fname);
m_free( outctrl->sec.fname );
outctrl->sec.fname = outctrl->sec.newfname;
outctrl->sec.newfname = NULL;
oldmask = umask (077);
outctrl->sec.stream = iobuf_create( outctrl->sec.fname );
umask (oldmask);
if( !outctrl->sec.stream ) {
log_error("can't create `%s': %s\n", outctrl->sec.newfname,
strerror(errno) );

View File

@ -170,7 +170,7 @@ show_policy_url(PKT_signature *sig,int indent,int mode)
if(mode!=2)
{
int i;
char *str;
const char *str;
for(i=0;i<indent;i++)
putchar(' ');
@ -211,7 +211,7 @@ show_keyserver_url(PKT_signature *sig,int indent,int mode)
if(mode!=2)
{
int i;
char *str;
const char *str;
for(i=0;i<indent;i++)
putchar(' ');
@ -276,7 +276,7 @@ show_notation(PKT_signature *sig,int indent,int mode,int which)
if((which&1 && !has_at) || (which&2 && has_at))
{
int i;
char *str;
const char *str;
for(i=0;i<indent;i++)
putchar(' ');
@ -397,7 +397,7 @@ list_one( STRLIST names, int secret )
KBNODE keyblock = NULL;
GETKEY_CTX ctx;
const char *resname;
char *keyring_str = _("Keyring");
const char *keyring_str = _("Keyring");
int i;
struct sig_stats stats;