aboutsummaryrefslogtreecommitdiffstats
path: root/g10/openfile.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-08-09 02:23:42 +0000
committerDavid Shaw <[email protected]>2002-08-09 02:23:42 +0000
commit74a84ca93b9662b32475fd19af4ca41a96290d42 (patch)
treedbd137199de0a7cfbd91a7f48d6da9524465e572 /g10/openfile.c
parent* Makefile.am, md.c (load_digest_module): Allow switching TIGER on and off (diff)
downloadgnupg-74a84ca93b9662b32475fd19af4ca41a96290d42.tar.gz
gnupg-74a84ca93b9662b32475fd19af4ca41a96290d42.zip
* options.skel: Some language tweaks, and remove the load-extension
section for random gatherers. * keyring.c (create_tmp_file, rename_tmp_file): Create tmp files with user-only permissions, but restore the original permissions if the user has something special set. * openfile.c (copy_options_file): Create new options file (gpg.conf) with user-only permissions. * keydb.c (keydb_add_resource): Create new keyrings with user-only permissions.
Diffstat (limited to 'g10/openfile.c')
-rw-r--r--g10/openfile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/g10/openfile.c b/g10/openfile.c
index 083ec93bf..2b6bf9a21 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -289,6 +289,7 @@ copy_options_file( const char *destdir )
FILE *src, *dst;
int linefeeds=0;
int c;
+ mode_t oldmask;
if( opt.dry_run )
return;
@@ -302,7 +303,9 @@ copy_options_file( const char *destdir )
return;
}
strcpy(stpcpy(fname, destdir), DIRSEP_S "gpg" EXTSEP_S "conf" );
+ oldmask=umask(077);
dst = fopen( fname, "w" );
+ umask(oldmask);
if( !dst ) {
log_error(_("%s: can't create: %s\n"), fname, strerror(errno) );
fclose( src );