]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: when parsing resource limits, be more careful with types and corner cases
authorLennart Poettering <lennart@poettering.net>
Tue, 10 Nov 2015 15:10:24 +0000 (16:10 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 10 Nov 2015 16:31:31 +0000 (17:31 +0100)
commitd580265eb4bbbafabdb3b7f0b501c0b05b76b2b7
treee6274430c7edb85a4da57301898c6f1600ec2095
parent65dce26488030eff078c498673d5d93e3c87b6a1
core: when parsing resource limits, be more careful with types and corner cases

Let's not convert RLIM_INFINITY to "unsigned long long" and then back to
rlim_t, but let's leave it in the right type right-away.

Parse resource limits as 64 bit in all cases, as according to the man
page that's what libc does anyway.

Make sure setting a resource limit to (uint64_t) -1 results in a parsing
error, and isn't implicitly converted to RLIM_INFINITY.
src/core/load-fragment.c