Adds ios::[open|app] to the parallel.cc to fix write over SELinux

This commit is contained in:
David Buckle 2017-09-11 12:44:53 +00:00 committed by Felipe Zimmerle
parent 48be601ca7
commit 082a0d3aca
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -133,7 +133,7 @@ bool Parallel::write(Transaction *transaction, int parts, std::string *error) {
return false;
}
fd = open(fileName.c_str(), O_CREAT | O_WRONLY,
fd = open(fileName.c_str(), O_CREAT | O_WRONLY | O_APPEND,
m_audit->getFilePermission());
if (fd < 0) {
error->assign("Not able to open: " + fileName + ". " \
@ -144,7 +144,7 @@ bool Parallel::write(Transaction *transaction, int parts, std::string *error) {
std::ofstream myfile;
std::string a(fileName.c_str());
myfile.open(a);
myfile.open(a, std::ofstream::out | std::ofstream::app);
myfile << log;
myfile.close();