Skip to content
Snippets Groups Projects
Commit 3b26f4d8 authored by dnovotny's avatar dnovotny
Browse files

a fix for rotating (copying) non-writable, readable files (rhbz#545919)

parent 9f459fd2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -436,7 +436,7 @@ static int copyTruncate(char *currLog, char *saveLog, struct stat *sb,
message(MESS_DEBUG, "copying %s to %s\n", currLog, saveLog);
 
if (!debug) {
if ((fdcurr = open(currLog, O_RDWR)) < 0) {
if ((fdcurr = open(currLog, (flags & LOG_FLAG_COPY) ? O_RDONLY : O_RDWR)) < 0) {
message(MESS_ERROR, "error opening %s: %s\n", currLog,
strerror(errno));
return 1;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment