* tdbio.c (tdbio_set_dbname): Create new trustdbs with user-only

permissions.
This commit is contained in:
David Shaw 2002-08-08 19:09:34 +00:00
parent 0b01b9cb62
commit c3f1100411
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-08-08 David Shaw <dshaw@jabberwocky.com>
* tdbio.c (tdbio_set_dbname): Create new trustdbs with user-only
permissions.
2002-08-07 David Shaw <dshaw@jabberwocky.com>
* sig-check.c (signature_check2): Sanity check that the md has a

View File

@ -458,6 +458,7 @@ tdbio_set_dbname( const char *new_dbname, int create )
TRUSTREC rec;
int rc;
char *p = strrchr( fname, DIRSEP_C );
mode_t oldmask;
assert(p);
*p = 0;
@ -477,7 +478,9 @@ tdbio_set_dbname( const char *new_dbname, int create )
if( make_dotlock( lockhandle, -1 ) )
log_fatal( _("%s: can't make lock\n"), db_name );
#endif /* __riscos__ */
oldmask=umask(077);
fp =fopen( fname, "wb" );
umask(oldmask);
if( !fp )
log_fatal( _("%s: can't create: %s\n"), fname, strerror(errno) );
fclose(fp);