[1883] in Moira Commits
/svn/moira r4024 - trunk/moira/clients/moira
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Mon Nov 29 15:20:38 2010
Date: Mon, 29 Nov 2010 15:20:26 -0500
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201011292020.oATKKQ18009034@drugstore.mit.edu>
To: moira-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: zacheiss
Date: 2010-11-29 15:20:25 -0500 (Mon, 29 Nov 2010)
New Revision: 4024
Modified:
trunk/moira/clients/moira/menu.c
Log:
Make log file only readable by user.
Modified: trunk/moira/clients/moira/menu.c
===================================================================
--- trunk/moira/clients/moira/menu.c 2010-09-22 21:12:18 UTC (rev 4023)
+++ trunk/moira/clients/moira/menu.c 2010-11-29 20:20:25 UTC (rev 4024)
@@ -802,13 +802,16 @@
int toggle_logging(int argc, char *argv[])
{
char buf[BUFSIZ];
+ mode_t oldmask;
if (!log_file)
{
sprintf(buf, "%s/%s-log.%d", get_tmp_dir(), whoami, getpid());
/* open the file */
+ oldmask = umask(077);
log_file = fopen(buf, "a");
+ umask(oldmask);
if (!log_file)
Put_message("Open of log file failed. Logging is not on.");