Skip to content
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

Make limitToUint parse to uint instead of int #1063

Merged
merged 1 commit into from Apr 25, 2021
Merged

Make limitToUint parse to uint instead of int #1063

merged 1 commit into from Apr 25, 2021

Conversation

damilola-bello
Copy link

Attempting to parse a soft/hard limit greater than int32 fails and returns 0 instead.
I believe soft/hard limits are always unsigned, hence no need to attempt to parse as int.

@shirou
Copy link
Owner

shirou commented Apr 25, 2021

Good catch! LGM, but could you add same thing to v2 also? thanks!

@damilola-bello
Copy link
Author

@shirou
Fixing v2 will break backward compatibility as it uses int32 for soft/hard limits:

type RlimitStat struct {

So nothing much can be done to change limitToInt here:

func limitToInt(val string) (int32, error) {

Let me know if I'm missing anything. Thanks.

@shirou
Copy link
Owner

shirou commented Apr 25, 2021

Sorry, you are correct. That struct has been changed at v3. so nothing can be done. Thank you for your contribution!

@shirou shirou merged commit 539c0d5 into shirou:master Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants