aboutsummaryrefslogtreecommitdiffstats
path: root/g10/sign.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-06-25 18:25:28 +0000
committerWerner Koch <[email protected]>2014-06-30 07:12:48 +0000
commitc434de4d83ccfaca8bde51de5c2ac8d9656e4e18 (patch)
tree07987f47300ad446063273961acf0437af24a2d2 /g10/sign.c
parentcommon: Minor code cleanup for a legacy OS. (diff)
downloadgnupg-c434de4d83ccfaca8bde51de5c2ac8d9656e4e18.tar.gz
gnupg-c434de4d83ccfaca8bde51de5c2ac8d9656e4e18.zip
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.
Diffstat (limited to 'g10/sign.c')
-rw-r--r--g10/sign.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/g10/sign.c b/g10/sign.c
index 8a878885b..907d8c517 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -871,7 +871,7 @@ sign_file (ctrl_t ctrl, strlist_t filenames, int detached, strlist_t locusr,
gpg_err_set_errno (EPERM);
}
else
- out = iobuf_create( outfile );
+ out = iobuf_create (outfile, 0);
if( !out )
{
rc = gpg_error_from_syserror ();
@@ -882,7 +882,7 @@ sign_file (ctrl_t ctrl, strlist_t filenames, int detached, strlist_t locusr,
log_info(_("writing to '%s'\n"), outfile );
}
else if( (rc = open_outfile (-1, fname,
- opt.armor? 1: detached? 2:0, &out )))
+ opt.armor? 1: detached? 2:0, 0, &out)))
goto leave;
/* prepare to calculate the MD over the input */
@@ -1188,7 +1188,7 @@ clearsign_file( const char *fname, strlist_t locusr, const char *outfile )
gpg_err_set_errno (EPERM);
}
else
- out = iobuf_create( outfile );
+ out = iobuf_create (outfile, 0);
if( !out )
{
rc = gpg_error_from_syserror ();
@@ -1198,7 +1198,7 @@ clearsign_file( const char *fname, strlist_t locusr, const char *outfile )
else if( opt.verbose )
log_info(_("writing to '%s'\n"), outfile );
}
- else if( (rc = open_outfile (-1, fname, 1, &out )) )
+ else if ((rc = open_outfile (-1, fname, 1, 0, &out)))
goto leave;
iobuf_writestr(out, "-----BEGIN PGP SIGNED MESSAGE-----" LF );
@@ -1366,7 +1366,7 @@ sign_symencrypt_file (const char *fname, strlist_t locusr)
cfx.dek->use_mdc=1;
/* now create the outfile */
- rc = open_outfile (-1, fname, opt.armor? 1:0, &out);
+ rc = open_outfile (-1, fname, opt.armor? 1:0, 0, &out);
if (rc)
goto leave;