don't allow others to read the history file [from OpenBSD]

This commit is contained in:
christos 2001-03-20 00:03:27 +00:00
parent 23836945a3
commit 9de44fdf69
1 changed files with 4 additions and 4 deletions

View File

@ -138,7 +138,7 @@ read_history_range (filename, from, to)
buffer = (char *)NULL; buffer = (char *)NULL;
input = history_filename (filename); input = history_filename (filename);
file = open (input, O_RDONLY|O_BINARY, 0666); file = open (input, O_RDONLY|O_BINARY, 0600);
#ifdef __MSDOS__ #ifdef __MSDOS__
@ -147,7 +147,7 @@ read_history_range (filename, from, to)
if (file < 0 && !filename) if (file < 0 && !filename)
{ {
input[strlen (input) - 8] = '_'; input[strlen (input) - 8] = '_';
file = open (input, O_RDONLY|O_BINARY, 0666); file = open (input, O_RDONLY|O_BINARY, 0600);
} }
#endif #endif
if ((file < 0) || (fstat (file, &finfo) == -1)) if ((file < 0) || (fstat (file, &finfo) == -1))
@ -241,7 +241,7 @@ history_truncate_file (fname, lines)
buffer = (char *)NULL; buffer = (char *)NULL;
filename = history_filename (fname); filename = history_filename (fname);
file = open (filename, O_RDONLY|O_BINARY, 0666); file = open (filename, O_RDONLY|O_BINARY, 0600);
#ifdef __MSDOS__ #ifdef __MSDOS__
/* MSDOS doesn't allow leading dots in file names. Try again /* MSDOS doesn't allow leading dots in file names. Try again
@ -249,7 +249,7 @@ history_truncate_file (fname, lines)
if (file < 0 && !fname) if (file < 0 && !fname)
{ {
filename[strlen (filename) - 8] = '_'; filename[strlen (filename) - 8] = '_';
file = open (filename, O_RDONLY|O_BINARY, 0666); file = open (filename, O_RDONLY|O_BINARY, 0600);
} }
#endif #endif