Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 602152 Details for
Bug 845341
/var/log/cluster/fenced.log created with insecure permissions
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
patch
0001-fenced-fix-log-file-mode.patch (text/plain), 2.03 KB, created by
David Teigland
on 2012-08-03 15:14:24 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
David Teigland
Created:
2012-08-03 15:14:24 UTC
Size:
2.03 KB
patch
obsolete
>From 638deec0ccbf45862eee97294f09ba9d6b3f56d0 Mon Sep 17 00:00:00 2001 >From: David Teigland <teigland@redhat.com> >Date: Fri, 3 Aug 2012 10:12:15 -0500 >Subject: [PATCH] fenced: fix log file mode > >Remove umask(0) which caused liblogthread's fopen to >create fenced.log with mode 666. > >Check if existing fenced.log has mode 666 and if so, >chmod to 644. > >bz 845341 > >Signed-off-by: David Teigland <teigland@redhat.com> >--- > fence/fenced/logging.c | 31 +++++++++++++++++++++++++++++++ > fence/fenced/main.c | 1 - > 2 files changed, 31 insertions(+), 1 deletion(-) > >diff --git a/fence/fenced/logging.c b/fence/fenced/logging.c >index a6a1a66..56a7e08 100644 >--- a/fence/fenced/logging.c >+++ b/fence/fenced/logging.c >@@ -39,8 +39,13 @@ void init_logging(void) > logfile_priority, logfile); > } > >+#define DEFAULT_LOGFILE_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) >+ > void setup_logging(void) > { >+ struct stat buf; >+ int rv; >+ > ccs_read_logging(ccs_handle, DAEMON_NAME, > &cfgd_debug_logfile, &log_mode, > &syslog_facility, &syslog_priority, >@@ -52,6 +57,32 @@ void setup_logging(void) > > logt_conf(DAEMON_NAME, log_mode, syslog_facility, syslog_priority, > logfile_priority, logfile); >+ >+ /* >+ * Previously fenced.log was created with mode 666, >+ * so fix it to be 644. >+ */ >+ >+ rv = stat(logfile, &buf); >+ if (rv) >+ return; >+ >+ log_debug("logfile cur mode %lo", (unsigned long)buf.st_mode); >+ >+ if ((buf.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) == DEFAULT_LOGFILE_MODE) >+ return; >+ >+ rv = chmod(logfile, DEFAULT_LOGFILE_MODE); >+ if (rv) { >+ log_error("chmod error %d", errno); >+ return; >+ } >+ >+ rv = stat(logfile, &buf); >+ if (rv) >+ return; >+ >+ log_debug("logfile new mode %lo", (unsigned long)buf.st_mode); > } > > void close_logging(void) >diff --git a/fence/fenced/main.c b/fence/fenced/main.c >index 835dc76..cc11382 100644 >--- a/fence/fenced/main.c >+++ b/fence/fenced/main.c >@@ -1039,7 +1039,6 @@ int main(int argc, char **argv) > perror("main: cannot fork"); > exit(EXIT_FAILURE); > } >- umask(0); > } > lockfile(); > init_logging(); >-- >1.7.10.1.362.g242cab3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 845341
: 602152