Bug 134025
Summary: | Inefficient and possibly unsafe closing of file descriptors | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Ulrich Drepper <drepper> | ||||||||||
Component: | nfs-utils | Assignee: | Steve Dickson <steved> | ||||||||||
Status: | CLOSED RAWHIDE | QA Contact: | Ben Levenson <benl> | ||||||||||
Severity: | medium | Docs Contact: | |||||||||||
Priority: | medium | ||||||||||||
Version: | 3 | ||||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | --- | ||||||||||||
Hardware: | All | ||||||||||||
OS: | Linux | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | 1.0.6-37 | Doc Type: | Bug Fix | ||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2004-10-15 02:32:26 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
Ulrich Drepper
2004-09-29 01:23:17 UTC
Created attachment 104479 [details]
Replace brute force close loop
Created attachment 104492 [details]
Updated patch
Updated patch fixing the problem of closing the pipe.
Also replace signal(3) calls with sigaction calls. This is more portable and
the blocking mask includes all three signals for which the signal handler is
registered. Otherwise it could be possible to get a SIGINT, SIGTERM, and
SIGHUP signal all in a row, one handler interrupting the other. If the handler
one day does what it is supposed to do according to the context this might be
fatal.
Created attachment 104493 [details]
One more addition
One additional change. Three programs contain code like this
close(N); dup2(fd, N);
where N is the same in both function calls. This is completely unnecessary
since dup2() implicitly closes the descriptor for its second parameter. The
close() calls can be removed.
Created attachment 104497 [details]
One more addition to the patch
Yet more signal -> sigaction transformations. Again, all signals must be
blocked since otherwise they could interrupt each other.
fixed in nfs-utils-1.0.6-37 Verified. |