-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change from time_t to uint32_t for serial in calculateSOASerial #5068
Change from time_t to uint32_t for serial in calculateSOASerial #5068
Conversation
@@ -330,7 +330,7 @@ bool DNSBackend::getBeforeAndAfterNames(uint32_t id, const DNSName& zonename, co | |||
* \param sd Information about the SOA record already available | |||
* \param serial Output parameter. Only inspected when we return true | |||
*/ | |||
bool DNSBackend::calculateSOASerial(const DNSName& domain, const SOAData& sd, time_t& serial) | |||
bool DNSBackend::calculateSOASerial(const DNSName& domain, const SOAData& sd, uint32_t& serial) | |||
{ | |||
// we do this by listing the domain and taking the maximum last modified timestamp | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do this, we should probably make newest
a uint32_t
too then, and perhaps DNSResourceRecord::last_modified
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one, although last_modified
could be bigger when it comes from the backend (after 2038) so we might need some magic here to truncate properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't truncation be proper by default, just by merit of stuffing a bigger number into a smaller one?
This PR has conflicts. |
ping |
5fea984
to
c4e7632
Compare
`time_t` can be bigger or be negative, which could lead to overflow/underflow issues. Closes PowerDNS#1010
c4e7632
to
f101300
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like it, but note that the gsql schemas have change_date as signed 32bit ints...
Short description
time_t can be bigger, which could lead to overflow/underflow issues.
Closes #1010
Checklist
I have: