Skip to content

Commit 082a0d3

Browse files
David BuckleFelipe Zimmerle
authored andcommitted
Adds ios::[open|app] to the parallel.cc to fix write over SELinux
1 parent 48be601 commit 082a0d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/audit_log/writer/parallel.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ bool Parallel::write(Transaction *transaction, int parts, std::string *error) {
133133
return false;
134134
}
135135

136-
fd = open(fileName.c_str(), O_CREAT | O_WRONLY,
136+
fd = open(fileName.c_str(), O_CREAT | O_WRONLY | O_APPEND,
137137
m_audit->getFilePermission());
138138
if (fd < 0) {
139139
error->assign("Not able to open: " + fileName + ". " \
@@ -144,7 +144,7 @@ bool Parallel::write(Transaction *transaction, int parts, std::string *error) {
144144

145145
std::ofstream myfile;
146146
std::string a(fileName.c_str());
147-
myfile.open(a);
147+
myfile.open(a, std::ofstream::out | std::ofstream::app);
148148
myfile << log;
149149
myfile.close();
150150

0 commit comments

Comments
 (0)