From: Pekka Riikonen Date: Fri, 1 Apr 2005 19:40:24 +0000 (+0000) Subject: Log files are now 0600. X-Git-Tag: silc.server.0.9.19~15 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=502ec67cd8a211c00c8819a34dd8092ea7d9c53e Log files are now 0600. --- diff --git a/CHANGES b/CHANGES index a5734c70..5b0f8911 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,8 @@ Fri Apr 1 18:52:47 EEST 2005 Pekka Riikonen * Fixed username handling in command reply. Affected file silcd/command_reply.c. + * Log files are now 0600. Affected file lib/silcutil/silclog.c. + Thu Mar 31 22:34:22 CEST 2005 Patrik Weiskircher * Added new define SILC_MACOSX, if __APPLE__ and __MACH__ is defined. diff --git a/TODO b/TODO index 01e32f9f..84213bd6 100644 --- a/TODO +++ b/TODO @@ -15,9 +15,6 @@ TODO for SILC Client 1.0 branch TODO for SILC Server 1.0 ======================== - o The log files should be opened with silc_file* routines to make - sure they are 0600. - o BUG: silc_idlist_del_client had been called but sock->user_data remained and pointed to invalid pointer. Where it was called is not known. diff --git a/lib/silcutil/silclog.c b/lib/silcutil/silclog.c index 31351ec8..97600526 100644 --- a/lib/silcutil/silclog.c +++ b/lib/silcutil/silclog.c @@ -137,6 +137,9 @@ static void silc_log_checksize(SilcLog log) if (!(log->fp = fopen(log->filename, "w"))) SILC_LOG_WARNING(("Couldn't reopen logfile %s for type \"%s\": %s", log->filename, log->typename, strerror(errno))); +#ifdef HAVE_CHMOD + chmod(log->filename, 0600); +#endif /* HAVE_CHMOD */ } /* Reset a logging channel (close and reopen) */ @@ -279,6 +282,9 @@ bool silc_log_set_file(SilcLogType type, char *filename, SilcUInt32 maxsize, filename, strerror(errno)); return FALSE; } +#ifdef HAVE_CHMOD + chmod(filename, 0600); +#endif /* HAVE_CHMOD */ } /* clean the logging channel */