ui: Check numeric part of expire_password argument @time properly
authorMarkus Armbruster <armbru@redhat.com>
Mon, 9 Jan 2023 19:03:05 +0000 (20:03 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 19 Jan 2023 12:30:01 +0000 (13:30 +0100)
commit49e56287cccfe8b5def4bc4916f367b9a0303161
tree606bfafef55b80229459ea67b3c0cf23588f4d96
parent7ec8aeb6048018680c06fb9205c01ca6bda08846
ui: Check numeric part of expire_password argument @time properly

When argument @time isn't 'now' or 'never', we parse it as an integer,
optionally prefixed with '+'.  If parsing fails, we silently assume
zero.  Report an error and fail instead.

While there, use qemu_strtou64() instead of strtoull() so
checkpatch.pl won't complain.

Aside: encoding numbers in strings is bad QMP practice.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230109190321.1056914-2-armbru@redhat.com>
monitor/qmp-cmds.c