Log files are now 0600.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 1 Apr 2005 19:40:24 +0000 (19:40 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 1 Apr 2005 19:40:24 +0000 (19:40 +0000)
CHANGES
TODO
lib/silcutil/silclog.c

diff --git a/CHANGES b/CHANGES
index a5734c70a0676ae76374cb2cc64a426c2be61a30..5b0f891109fa78240488996d5f05f19ff2e8c085 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,8 @@ Fri Apr  1 18:52:47 EEST 2005  Pekka Riikonen <priikone@silcnet.org>
        * 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 <pat@icore.at>
 
        * Added new define SILC_MACOSX, if __APPLE__ and __MACH__ is defined.
diff --git a/TODO b/TODO
index 01e32f9f78d88a16c5f2c4d7e1269b6706c87736..84213bd65fb33ffe777ae2f1b034b0f0fb2240df 100644 (file)
--- 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.
 
index 31351ec8a0d4e612b7d337541a16363fa444ad07..976005266bb108c190096d9bd6134b79c103d838 100644 (file)
@@ -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 */