HomeClusterLabs Projects

Low: libcrmcommon: Allow negative numbers as cmdline options.

Description

Low: libcrmcommon: Allow negative numbers as cmdline options.

The bug here is that negative numbers (for instance, negative scores)
are not supported as command line arguments. Because we break up a
string that starts with a single dash into multiple arguments, "-1000"
becomes "-1", "-0", "-0", and "-0".

Because we don't have enough information about what is happening on the
command line, the best we can do here is recognize something as a
negative number and pass it on. Any errors will have to be detected at
a later step.

Also note that we only recognize negative numbers if they start with
1-9. Starting with 0 will be recognized as some sort of string.

Regression in 2.1.0 caused by a long-standing bug in
pcmk__cmdline_preproc_test.

Details

Provenance
clumensAuthored on Jul 19 2021, 11:37 AM
Parents
rPea5510dd979b: Low: tools: The --get-value option does not require an arg.
Branches
Unknown
Tags
Unknown

Event Timeline