server: Reject -e with too long of a name
commita0cd924a8a586a84a1b127a00ed39243c03f3811
authorEric Blake <eblake@redhat.com>
Fri, 27 Sep 2019 21:41:14 +0000 (27 16:41 -0500)
committerEric Blake <eblake@redhat.com>
Mon, 30 Sep 2019 21:29:47 +0000 (30 16:29 -0500)
tree2a906b825bb7b10ba0111d2c991576e77c4e814d
parente49ed348fa2e9583910a1544f8baa365255450e3
server: Reject -e with too long of a name

The NBD protocol requires strings to be capped at 4k; we violated that
if the client requests NBD_OPT_LIST but the command line provided too
long of a string.

The protocol also requires that strings be valid UTF-8, but for now,
we are accepting any byte sequence.

However, we still need another patch before the test is fully
complete: qemu-nbd --list wants to send a valid NBD_OPT_INFO with
length longer than we currently permit.

Signed-off-by: Eric Blake <eblake@redhat.com>
server/main.c
tests/Makefile.am
tests/test-long-name.sh [new file with mode: 0755]