From 190aed4effbfb9a982f46250c82994f58f4e5fb5 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 13 Feb 2008 11:37:20 -0500 Subject: create the log file with S_IROTH and don't touch the log on build --- src/Makefile.am | 2 -- src/ck-event-logger.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 3712cff..8d5d83b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -202,5 +202,3 @@ install-data-local: -mkdir -p $(DESTDIR)$(libdir)/ConsoleKit/run-session.d -mkdir -p $(DESTDIR)$(localstatedir)/run/ConsoleKit -mkdir -p $(DESTDIR)$(localstatedir)/log/ConsoleKit - -umask 022 - -touch $(DESTDIR)$(localstatedir)/log/ConsoleKit/history diff --git a/src/ck-event-logger.c b/src/ck-event-logger.c index 5e4a212..6bbc1d9 100644 --- a/src/ck-event-logger.c +++ b/src/ck-event-logger.c @@ -109,13 +109,14 @@ open_log_file (CkEventLogger *event_logger) #endif retry: + errno = 0; fd = g_open (event_logger->priv->log_filename, flags, 0600); if (fd < 0) { if (errno == ENOENT) { /* FIXME: should we just skip if file doesn't exist? */ fd = g_open (event_logger->priv->log_filename, O_CREAT | O_EXCL | O_APPEND, - S_IRUSR | S_IWUSR | S_IRGRP); + S_IRUSR | S_IWUSR | S_IRGRP | S_IRGRP | S_IROTH); if (fd < 0) { g_warning ("Couldn't create log file %s (%s)", event_logger->priv->log_filename, -- cgit