Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:11.4:Update
logrotate
logrotate-CVE-2011-1098.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File logrotate-CVE-2011-1098.patch of Package logrotate
Index: logrotate-3.7.9/logrotate.c =================================================================== --- logrotate-3.7.9.orig/logrotate.c +++ logrotate-3.7.9/logrotate.c @@ -204,7 +204,9 @@ int createOutputFile(char *fileName, int { int fd; - fd = open(fileName, flags, sb->st_mode); + unlink(fileName); + fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW), + (S_IRUSR | S_IWUSR) & sb->st_mode); if (fd < 0) { message(MESS_ERROR, "error creating output file %s: %s\n", fileName, strerror(errno)); @@ -316,7 +318,7 @@ static int compressLogFile(char *name, s } outFile = - createOutputFile(compressedName, O_RDWR | O_CREAT | O_TRUNC, sb); + createOutputFile(compressedName, O_RDWR | O_CREAT, sb); if (outFile < 0) { close(inFile); return 1; @@ -495,7 +497,7 @@ static int copyTruncate(char *currLog, c } #endif fdsave = - createOutputFile(saveLog, O_WRONLY | O_CREAT | O_TRUNC, sb); + createOutputFile(saveLog, O_WRONLY | O_CREAT, sb); #ifdef WITH_SELINUX if (selinux_enabled) { setfscreatecon_raw(prev_context);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor