int fd, len;
char snum[MAX_EPOCH_SIZE];
len=snprintf(snum, MAX_EPOCH_SIZE-1,"%d", n);
- fd = open(LAST_EPOCH_FILE, O_RDWR|O_CREAT|O_TRUNC);
+ fd = open(LAST_EPOCH_FILE, O_RDWR|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
if (fd == -1) {
my_log(LOG_ERR, "open() failed: %s.The next restart will resume logging from epoch id 0.",LAST_EPOCH_FILE);
return;
system(gzip_cmd);
}
snprintf(cur_output_file,MAX_PATH_LEN,"%s.%d",fname,cur_epoch);
- if ((write_fd = open(cur_output_file, O_RDWR|O_CREAT|O_TRUNC)) < 0) {
+ if ((write_fd = open(cur_output_file, O_RDWR|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH)) < 0) {
my_log(LOG_ERR, "open(): %s (%s)\n", cur_output_file, strerror(errno));
exit(1);
}