]> git.ipfire.org Git - thirdparty/systemd.git/commit
systemctl: explicitly cast the constants to uint64_t
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 3 Mar 2023 11:17:27 +0000 (12:17 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 3 Mar 2023 15:57:34 +0000 (15:57 +0000)
commitc63bfd0884cf20e48befbee49d41f667660a8802
tree901c556cb406dfa84fe532f9a26c17bbb7f815f8
parent0c70d5e623a725c4e2f6ace0a492a7043c930d53
systemctl: explicitly cast the constants to uint64_t

Otherwise under certain conditions `va_arg()` might get garbage instead
of the expected value, i.e.:

$ sudo build-o0/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 0
Failed to disable unit: Unit file asdfasfaf.service does not exist.

$ sudo build-o1/systemctl disable asdfasfaf
sd_bus_message_appendv: Got uint64_t: 7954875719681572864
Failed to disable unit: Invalid argument

(reproduced on an armv7hl machine)

Resolves: #26568
Follow-up to: bf1bea43f15
Related issue: https://github.com/systemd/systemd/pull/14470#discussion_r362893735
src/systemctl/systemctl-enable.c