Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
In rhnsd an integer/float will be added to time_t, what is not recommended.
Instead of that difftime shall be used - in the way we do not add amount of seconds to time_t, but to go the other way around - to make a difference of two times in time_t
double difftime ( time_t time2, time_t time1 );
Return difference between two times
Calculates the difference in seconds between time1 and time2.
Parameters
time2 - time_t object representing the latter of the two times.
time1 - time_t object representing the earlier of the two times.
Return Value
The difference in seconds (time2-time1) as a floating point double.
Version-Release number of selected component (if applicable):
rhnsd-4.9.3-3
Using
time_t + float(int)
isn't strictly defined and may cause troubles mainly in the future, when internal representation of time_t changes
difftime() is recommended for time differences and shall always return time difference in seconds (also in the future)
Comment 1Jan Pazdziora (Red Hat)
2011-11-23 16:07:11 UTC
Tomas, the comment 0 is fairly confusing. Could you please amend the bugzilla with Actual results and Expected results, so that we have something to work wich while acking the proposed change, not mentioning the fact that QA will want this to make a test plan (should we ever decide some change is called for)?
Your cooperation in this matter would be greatly appreciated.
As already discussed with Simon, there's no real test plan available.
Everything we can do is to:
# grep difftime client/rhel/rhnsd/rhnsd.c
Adding float to time_t doesn't return correct values, however the deviation is that small (lowest rhnsd interval is 1 hour) that it's not really possible for QA to detect the difference between the correct behavior and misbehavior.
This BZ doesn't address any visible misbehavior, it addresses the concept and usage of adding and comparing of date structures.
Comment 3Jan Pazdziora (Red Hat)
2011-11-24 10:33:01 UTC
Thank you, Tomáš. Setting devel ack then. Let's leave it on QA to decide if they'd be able to QA the change at all.
Comment 5RHEL Program Management
2011-12-09 09:05:44 UTC
Quality Engineering Management has reviewed and declined this request. You may
appeal this decision by reopening this request.