Bug 7955 - tevent_add_fd() should fail when passed a negative fd
tevent_add_fd() should fail when passed a negative fd
Status: NEW
Product: Samba 3.6
Classification: Unclassified
Component: Clustering
unspecified
All Linux
: P3 normal
: ---
Assigned To: Volker Lendecke
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-14 09:21 UTC by Stephen Gallagher
Modified: 2011-02-14 09:57 UTC (History)
1 user (show)

See Also:


Attachments
Patch to return NULL on negative file descriptor (946 bytes, patch)
2011-02-14 09:31 UTC, Stephen Gallagher
idra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Gallagher 2011-02-14 09:21:42 UTC
Currently, tevent_add_fd() will accept a negative fd (e.g. -1). It will then fail later when select() is called on that file descriptor. (Making it difficult to track down where the faulty tevent_add_fd() was called.

tevent_add_fd() should fail and return NULL if the file descriptor is negative

Bug was noted on libtevent 0.9.8 and 0.9.10.
Comment 1 Stephen Gallagher 2011-02-14 09:31:23 UTC
Created attachment 6246 [details]
Patch to return NULL on negative file descriptor