Bug 205072
Summary: | logrotate is leaking file descriptors. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Daniel Walsh <dwalsh> | ||||||
Component: | logrotate | Assignee: | Peter Vrabec <pvrabec> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | |||||||
Severity: | high | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | rawhide | ||||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | logrotate-3.7.4-6 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2006-10-03 09:02:55 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Daniel Walsh
2006-09-03 17:44:35 UTC
I can't reproduce it on clean FC-6 installation :-( Created attachment 136743 [details]
Closes leaky file descriptors
Daniel, I don't why I can't reproduce any of these AVC bugs(205072,205876). :-( I have looked at your patch and it seems to me there might be cleaner solution. logrotate.c:909 if (!debug) { fd = createOutputFile(log->files[logNum], O_CREAT | O_RDWR, &sb); if (fd < 0) hasErrors = 1; + else + close(fd); } I gonna test it. Is it necessary to use fcntl( {inFile,outFile}, F_SETFD, FD_CLOEXEC); in situation like this: if (!fork()) { dup2(inFile, 0); close(inFile); dup2(outFile, 1); close(outFile); execvp(fullCommand[0], (void *) fullCommand); No because you are explictly meaning to leak them in this case. The problem case is when they get leaked unexpectedly. Created attachment 137033 [details]
close fd
I think this patch fix the problem. Daniel, could you confirm it?
I am not able to recreate the situation on demand, so apply the patch and I will watch for additional avc messages. Patch applied in logrotate-3.7.4-6. If problem persist, reopen this bug report. |