1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* misc.c (is_secured_filename): New.

* keydb.c (maybe_create_keyring)
* tdbio.c (tdbio_set_dbname)
* plaintext.c (handle_plaintext)
* openfile.c (copy_options_file, open_outfile)
* exec.c (exec_write)
* keygen.c (do_generate_keypair, gen_card_key_with_backup)
* sign.c (sign_file, clearsign_file)
* keyring.c (create_tmp_file, do_copy): Check for secured files
before creating them.

* keygen.c (print_status_key_created): s/unsigned char/byte/ due
to a strange typedef for RISC OS.  Noted by Stefan.
This commit is contained in:
Werner Koch 2004-10-14 07:11:57 +00:00
parent 0d6defc0da
commit 35774ec568
11 changed files with 159 additions and 36 deletions

View file

@ -477,13 +477,13 @@ int exec_write(struct exec_info **info,const char *program,
log_debug("using temp file `%s'\n",(*info)->tempfile_in);
/* It's not fork/exec/pipe, so create a temp file */
(*info)->tochild=fopen((*info)->tempfile_in,binary?"wb":"w");
if((*info)->tochild && is_secured_file (fileno ((*info)->tochild)))
if( is_secured_filename ((*info)->tempfile_in) )
{
fclose ((*info)->tochild);
(*info)->tochild = NULL;
errno = EPERM;
}
else
(*info)->tochild=fopen((*info)->tempfile_in,binary?"wb":"w");
if((*info)->tochild==NULL)
{
log_error(_("can't create file `%s': %s\n"),