On Wed, Apr 24, 2024 at 9:20 AM Roger Pau Monne <roger....@citrix.com> wrote:
>
> It's incorrect to restrict strncmp to the length of the command line input
> parameter, as then a user passing a rune like:
>
> % xen-livepatch up foo.livepatch
>
> Would match against the "upload" command, because the string comparison has
> been truncated to the length of the input argument.  Use strcmp instead which
> doesn't truncate.  Otherwise in order to keep using strncmp we would need to
> also check strings are of the same length before doing the comparison.
>

I had previously assumed that this was intentional as a way of allowing
abbreviated syntax. Regardless of the original intent, I'm OK with this
change.

Reviewed-by: Ross Lagerwall <ross.lagerw...@citrix.com>

Reply via email to