Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#4002 closed defect (fixed)

errno may unexpectedly change between setting and use

Reported by: stephen Owned by: sar
Priority: low Milestone: Kea1.0-beta
Component: Unclassified Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

In some places in the code, an assumption is made that the value of errno is unchanged between two references to it. In some cases, this is incorrect:

ccsession.cc(readModuleSpecification): strerror(errno) is referenced in two successive lines, one logging an error, the other throwing a CSessionInitError message. LOG_ERROR may do file-related activity: as a result, errno could change between the two calls. It is suggested that the error string be retrieved before the LOG_ERROR call, and that error string be passed to the logging and the isc_throw macros.

signal_set.cc(add): if a call to sigaction() fails, an exception is raised. However, prior to errno being accessed to provide the text for the exception, SignalSet::erase() is called. At present this method does not appear to do anything that would alter errno, but this might not be true in the future. It is suggested that the error string be retrieved before the erase() call.

Subtickets

Change History (7)

comment:1 Changed 5 years ago by stephen

  • Milestone changed from Kea-proposed to Kea1.0

comment:2 Changed 4 years ago by sar

  • Owner set to sar
  • Status changed from new to accepted

Ready for review

Add a variable to save the string for errno in signal_set.cc:add()

ccsession.cc no longer exists

comment:3 Changed 4 years ago by sar

  • Owner changed from sar to UnAssigned
  • Status changed from accepted to reviewing

comment:4 Changed 4 years ago by stephen

  • Owner changed from UnAssigned to stephen

comment:5 Changed 4 years ago by stephen

  • Owner changed from stephen to sar

Reviewed commit 89f646302b1611cda5f0010c736af5085109669f

All OK, please merge. This change is sufficiently trivial so as not to require a ChangeLog entry.

comment:6 Changed 4 years ago by sar

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merged commit 7bba4a710dd16619b3c167e08c75d5cac03cc300

comment:7 Changed 4 years ago by tomek

  • Milestone changed from Kea1.0 to Kea1.0-beta

Milestone renamed

Note: See TracTickets for help on using tickets.