-
Notifications
You must be signed in to change notification settings - Fork 348
Some iso8601 renames/deprecations #3993
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
Open
nrwahl2
wants to merge
36
commits into
ClusterLabs:main
Choose a base branch
from
nrwahl2:nrwahl2-time
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,101
−967
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
This is just so that we can guarantee that the argument to crm_get_utc_time() is non-NULL. All other callers already ensure this. Signed-off-by: Reid Wahl <[email protected]>
And rename to utc_from_crm_time(), to avoid using a public API prefix. Signed-off-by: Reid Wahl <[email protected]>
To restore ability to compile with C++ on supported platforms. This is a repeat of 426eef2. We've been making the same mistake again. Signed-off-by: Reid Wahl <[email protected]>
367aa8c to
b070ce3
Compare
Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
For clarity of purpose and to avoid using public API prefix. Signed-off-by: Reid Wahl <[email protected]>
It doesn't get the time zone. It converts the seconds member of the time object to hours and minutes, ignoring any remaining seconds. Signed-off-by: Reid Wahl <[email protected]>
b070ce3 to
688b129
Compare
To avoid using a public API prefix. Also set errno in the callers instead. It's silly to set it at all, but some public API function probably calls these, so keep the side effect for backward compatibility. Signed-off-by: Reid Wahl <[email protected]>
To avoid using a public API prefix. Also set errno in the caller instead. It's silly to set it at all, but some public API function probably calls this, so keep the side effect for backward compatibility. Signed-off-by: Reid Wahl <[email protected]>
To avoid using a public API prefix. Also stop setting errno. The caller already sets it if this function returns false. Rename a goto label to avoid a name conflict. Ideally this label will go away someday, but we might start using a third-party time library before that happens. Signed-off-by: Reid Wahl <[email protected]>
Both crm_time_parse_duration() and parse_date() set errno to EINVAL if they return NULL. So there's no harm in jumping to the invalid label and doing it again. Signed-off-by: Reid Wahl <[email protected]>
So that we can get rid of the forward declaration Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
Move the logic to pcmk__copy_timet(). This means some more allocations on the heap, but that seems like a worthy tradeoff for simplifying the interface. Have crm_time_set_timet() allocate a temporary object using pcmk__copy_timet() and copy the value to the target. Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
To replace crm_time_get_isoweek(), which doesn't seem as if it needs to be part of public API. We could make a case for keeping this public because we allow the use of ISO week dates in date specifications within rules. Some hypothetical user might want to get the ISO week date from a crm_time_t and use it to create a rule. However, that feels a bit contrived, and I think I would be in favor of deprecating ISO week dates from rules... it's not a ton of trouble to keep, but it's hard to imagine anyone using it. Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
To replace crm_time_log() and crm_time_log_alias(). Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
A lot of functions move around, but no code changes otherwise. Signed-off-by: Reid Wahl <[email protected]>
688b129 to
6dd7312
Compare
Contributor
Author
|
retest this please |
Contributor
Author
|
Remaining CI errors are for repo failures on two PowerPC machines: |
a6b4dca to
6dd7312
Compare
Contributor
Author
|
Dropped the commit that I had just added for "Assert non-NULL in parse_date()", as it was incorrect |
More similar to libqb's names. Signed-off-by: Reid Wahl <[email protected]>
More similar to libqb's names. Signed-off-by: Reid Wahl <[email protected]>
For clarity and to avoid typos. Signed-off-by: Reid Wahl <[email protected]>
For clarity and to avoid typos. Signed-off-by: Reid Wahl <[email protected]>
For clarity and to avoid typos. Signed-off-by: Reid Wahl <[email protected]>
The fuzzer found an overflow issue. If the sec argument was set to INT_MIN, then QB_ABS(INT_MIN) would expand to -INT_MIN. Avoid this by taking the absolute values at the end of the function, after division and subtraction have ensured that nothing is INT_MIN anymore. Fixes https://issues.oss-fuzz.com/u/1/issues/462062524/resources Note that the oss-fuzz issue report above is inaccessible at time of writing, unless you have specifically been granted access. Signed-off-by: Reid Wahl <[email protected]>
The fuzzer found an underflow here. Somehow crm_time_parse_period() -> crm_time_subtract() was able to pass INT_MIN as the a_time argument. The expression ((a_time->years - 1) < 1) underflows if a_time is INT_MIN. We could avoid this by subtracting 1LL (assuming int is not the same width as long long), but it seems simpler to use (a_time->years <= 1). Also update the analogous expression in the (extra > 0) block. Fixes https://issues.oss-fuzz.com/u/1/issues/462551155/resources Signed-off-by: Reid Wahl <[email protected]>
Signed-off-by: Reid Wahl <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trying to make the function names follow convention a little bit better and deprecate the things that we probably won't need to keep any analog of in the public API.