mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Create exported secret files and revocs with mode 700.
* common/iobuf.c (direct_open): Add arg MODE700. (iobuf_create): Ditto. * g10/openfile.c (open_outfile): Add arg RESTRICTEDPERM. Change call callers to pass 0 for it. * g10/revoke.c (gen_desig_revoke, gen_revoke): Here pass true for new arg. * g10/export.c (do_export): Pass true for new arg if SECRET is true. -- GnuPG-bug-id: 1653. Note that this works only if --output has been used.
This commit is contained in:
parent
35fdfaa0b9
commit
c434de4d83
12 changed files with 43 additions and 31 deletions
|
@ -1197,7 +1197,9 @@ create_tmp_file (const char *template,
|
|||
strcpy (stpcpy(tmpfname,template), EXTSEP_S "tmp");
|
||||
# endif /* Posix filename */
|
||||
|
||||
/* Create the temp file with limited access */
|
||||
/* Create the temp file with limited access. Note that the umask
|
||||
call is not anymore needed because iobuf_create now takes care
|
||||
of it. However, it does not harm and thus we keep it. */
|
||||
oldmask=umask(077);
|
||||
if (is_secured_filename (tmpfname))
|
||||
{
|
||||
|
@ -1205,7 +1207,7 @@ create_tmp_file (const char *template,
|
|||
gpg_err_set_errno (EPERM);
|
||||
}
|
||||
else
|
||||
*r_fp = iobuf_create (tmpfname);
|
||||
*r_fp = iobuf_create (tmpfname, 1);
|
||||
umask(oldmask);
|
||||
if (!*r_fp)
|
||||
{
|
||||
|
@ -1513,7 +1515,7 @@ do_copy (int mode, const char *fname, KBNODE root,
|
|||
gpg_err_set_errno (EPERM);
|
||||
}
|
||||
else
|
||||
newfp = iobuf_create (fname);
|
||||
newfp = iobuf_create (fname, 1);
|
||||
umask(oldmask);
|
||||
if( !newfp )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue